mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
fix page entity operations
This commit is contained in:
parent
7be7717897
commit
f65458ca70
2 changed files with 13 additions and 26 deletions
|
|
@ -75,8 +75,8 @@ class Tab
|
|||
?\GtkWidget $child,
|
||||
int $page_num
|
||||
) {
|
||||
$this->closePage(
|
||||
$page_num
|
||||
$this->reorderPage(
|
||||
null // all
|
||||
);
|
||||
}
|
||||
);
|
||||
|
|
@ -88,7 +88,9 @@ class Tab
|
|||
?\GtkWidget $child,
|
||||
int $page_num
|
||||
) {
|
||||
$this->reorderPage();
|
||||
$this->reorderPage(
|
||||
null // all
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -168,30 +170,17 @@ class Tab
|
|||
}
|
||||
|
||||
public function closePage(
|
||||
int $page_num
|
||||
?int $page_num = null
|
||||
): void
|
||||
{
|
||||
// Validate page index exists
|
||||
if (empty($this->_page[$page_num]))
|
||||
if ($page = $this->getPage($page_num))
|
||||
{
|
||||
throw new \Exception;
|
||||
$this->gtk->remove_page(
|
||||
$this->gtk->page_num(
|
||||
$page->gtk
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Remove GTK node
|
||||
$this->gtk->remove_page(
|
||||
$page_num
|
||||
);
|
||||
/*
|
||||
// Free memory
|
||||
$this->_page[$page_num] = null;
|
||||
|
||||
// Cleanup internal record
|
||||
unset(
|
||||
$this->_page[$page_num]
|
||||
);
|
||||
*/
|
||||
// Reorder
|
||||
$this->reorderPage();
|
||||
}
|
||||
|
||||
public function reorderPage(
|
||||
|
|
|
|||
|
|
@ -34,10 +34,8 @@ class Close
|
|||
function()
|
||||
{
|
||||
$this->tab->menu->browser->container->tab->closePage(
|
||||
$this->tab->menu->browser->container->tab->gtk->get_current_page()
|
||||
null // active
|
||||
);
|
||||
|
||||
// @TODO unset page entity
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue