mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
init tab registry, implement tabs refresh method
This commit is contained in:
parent
278b421c0f
commit
902f594336
1 changed files with 21 additions and 0 deletions
|
|
@ -13,6 +13,9 @@ class Tab
|
||||||
|
|
||||||
public \Yggverse\Yoda\Entity\Window $window;
|
public \Yggverse\Yoda\Entity\Window $window;
|
||||||
|
|
||||||
|
// App entity operations
|
||||||
|
private array $_tab = [];
|
||||||
|
|
||||||
// Defaults
|
// Defaults
|
||||||
private bool $_reorderable = true;
|
private bool $_reorderable = true;
|
||||||
private bool $_scrollable = true;
|
private bool $_scrollable = true;
|
||||||
|
|
@ -84,5 +87,23 @@ class Tab
|
||||||
$this->window->header->setTitle(
|
$this->window->header->setTitle(
|
||||||
$entity->title->gtk->get_text()
|
$entity->title->gtk->get_text()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Register new tab entity
|
||||||
|
$this->_tab[] = $entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function refresh()
|
||||||
|
{
|
||||||
|
foreach ($this->_tab as $entity)
|
||||||
|
{
|
||||||
|
switch (true)
|
||||||
|
{
|
||||||
|
case $entity instanceof History:
|
||||||
|
|
||||||
|
$entity->content->update();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue