From fb3ad27e187e480ecfb8800336f12821c5ab0dc6 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 28 Jul 2024 04:26:51 +0300 Subject: [PATCH] fix tabs clean feature --- src/Entity/Browser/Container/Tab.php | 8 ++++++++ src/Entity/Browser/Menu/Tab/Clean.php | 7 +------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Entity/Browser/Container/Tab.php b/src/Entity/Browser/Container/Tab.php index fc2181de..ca932af8 100644 --- a/src/Entity/Browser/Container/Tab.php +++ b/src/Entity/Browser/Container/Tab.php @@ -241,6 +241,14 @@ class Tab } } + public function clean(): void + { + while ($this->pages) + { + $this->close(); + } + } + public function reorder(): void { // Init new index diff --git a/src/Entity/Browser/Menu/Tab/Clean.php b/src/Entity/Browser/Menu/Tab/Clean.php index aa02c58a..edaf93b0 100644 --- a/src/Entity/Browser/Menu/Tab/Clean.php +++ b/src/Entity/Browser/Menu/Tab/Clean.php @@ -62,12 +62,7 @@ class Clean if (GtkResponseType::OK == $dialog->run()) { - foreach ($this->tab->menu->browser->container->tab->pages as $page_num => $page) - { - $this->tab->menu->browser->container->tab->close( - $page_num - ); - } + $this->tab->menu->browser->container->tab->clean(); } $dialog->destroy();