From 12a1473d8cd82536114055ed851d2b2a3527f0f0 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 8 Jul 2024 00:04:49 +0300 Subject: [PATCH] use local gtk show initiation instead of show_all method --- src/Abstract/Entity/Button.php | 4 ++++ src/Abstract/Entity/Entry.php | 4 ++++ src/Entity/Browser.php | 3 +++ src/Entity/Browser/Container.php | 3 +++ src/Entity/Browser/Container/Tab.php | 5 +++-- src/Entity/Browser/Container/Tab/Page.php | 2 +- src/Entity/Browser/Container/Tab/Page/Content.php | 3 +++ src/Entity/Browser/Container/Tab/Page/Content/Data.php | 4 ++++ src/Entity/Browser/Container/Tab/Page/Content/Viewport.php | 3 +++ src/Entity/Browser/Container/Tab/Page/Navbar.php | 3 +++ src/Entity/Browser/Container/Tab/Page/Navbar/History.php | 3 +++ src/Entity/Browser/Container/Tab/Page/Response.php | 2 +- src/Entity/Browser/Header.php | 3 +++ src/Entity/Browser/Header/Navigation.php | 3 +++ src/Entity/Browser/History.php | 3 +++ src/Entity/Browser/History/Container.php | 3 +++ src/Entity/Browser/History/Container/Content.php | 3 +++ src/Entity/Browser/History/Container/Content/Table.php | 5 ++++- src/Entity/Browser/History/Container/Content/Viewport.php | 3 +++ src/Entity/Browser/History/Container/Navbar.php | 3 +++ src/Entity/Browser/History/Header.php | 3 +++ src/Entity/Browser/Menu.php | 2 +- src/Entity/Browser/Menu/History.php | 5 +++-- src/Entity/Browser/Menu/Quit.php | 3 +++ src/Entity/Browser/Menu/Tab.php | 3 +++ src/Entity/Browser/Menu/Tab/Add.php | 3 +++ src/Entity/Browser/Menu/Tab/Close.php | 3 +++ src/Yoda.php | 2 -- 28 files changed, 79 insertions(+), 10 deletions(-) diff --git a/src/Abstract/Entity/Button.php b/src/Abstract/Entity/Button.php index 04e27133..febf8c86 100644 --- a/src/Abstract/Entity/Button.php +++ b/src/Abstract/Entity/Button.php @@ -23,6 +23,10 @@ abstract class Button $this->_label ); + // Render + $this->gtk->show(); + + // Init events $this->gtk->connect( 'clicked', function( diff --git a/src/Abstract/Entity/Entry.php b/src/Abstract/Entity/Entry.php index 6a87912f..6ccdc4c1 100644 --- a/src/Abstract/Entity/Entry.php +++ b/src/Abstract/Entity/Entry.php @@ -28,6 +28,10 @@ abstract class Entry $this->_value ); + // Render + $this->gtk->show(); + + // Init events $this->gtk->connect( 'activate', function( diff --git a/src/Entity/Browser.php b/src/Entity/Browser.php index 9519910b..76c23491 100644 --- a/src/Entity/Browser.php +++ b/src/Entity/Browser.php @@ -59,5 +59,8 @@ class Browser $this->gtk->add( $this->container->gtk ); + + // Render + $this->gtk->show(); } } \ No newline at end of file diff --git a/src/Entity/Browser/Container.php b/src/Entity/Browser/Container.php index 4c553788..2de5d522 100644 --- a/src/Entity/Browser/Container.php +++ b/src/Entity/Browser/Container.php @@ -38,6 +38,9 @@ class Container true, 0 ); + + // Render + $this->gtk->show(); } public function refresh() diff --git a/src/Entity/Browser/Container/Tab.php b/src/Entity/Browser/Container/Tab.php index 1362c49d..3bf05828 100644 --- a/src/Entity/Browser/Container/Tab.php +++ b/src/Entity/Browser/Container/Tab.php @@ -33,7 +33,7 @@ class Tab 'gemini://yggverse.cities.yesterweb.org' ); - // Connect events + // Init events $this->gtk->connect( 'switch-page', function ( @@ -101,6 +101,7 @@ class Tab ); } - $this->gtk->show_all(); + // Render + $this->gtk->show(); } } \ No newline at end of file diff --git a/src/Entity/Browser/Container/Tab/Page.php b/src/Entity/Browser/Container/Tab/Page.php index fc7990ae..c3d9961e 100644 --- a/src/Entity/Browser/Container/Tab/Page.php +++ b/src/Entity/Browser/Container/Tab/Page.php @@ -66,7 +66,7 @@ class Page ); // Render - $this->gtk->show_all(); + $this->gtk->show(); } public function refresh(): void diff --git a/src/Entity/Browser/Container/Tab/Page/Content.php b/src/Entity/Browser/Container/Tab/Page/Content.php index b7e1d115..66f9ffb0 100644 --- a/src/Entity/Browser/Container/Tab/Page/Content.php +++ b/src/Entity/Browser/Container/Tab/Page/Content.php @@ -67,6 +67,9 @@ class Content $this->gtk->add( $this->viewport->gtk ); + + // Render + $this->gtk->show(); } public function refresh() diff --git a/src/Entity/Browser/Container/Tab/Page/Content/Data.php b/src/Entity/Browser/Container/Tab/Page/Content/Data.php index 5aff2688..015c92c2 100644 --- a/src/Entity/Browser/Container/Tab/Page/Content/Data.php +++ b/src/Entity/Browser/Container/Tab/Page/Content/Data.php @@ -54,6 +54,10 @@ class Data 0 ); + // Render + $this->gtk->show(); + + // Init events $this->gtk->connect( 'activate-link', function( diff --git a/src/Entity/Browser/Container/Tab/Page/Content/Viewport.php b/src/Entity/Browser/Container/Tab/Page/Content/Viewport.php index 656cf91b..1cc951de 100644 --- a/src/Entity/Browser/Container/Tab/Page/Content/Viewport.php +++ b/src/Entity/Browser/Container/Tab/Page/Content/Viewport.php @@ -19,5 +19,8 @@ class Viewport // Init viewport $this->gtk = new \GtkViewport; + + // Render + $this->gtk->show(); } } \ No newline at end of file diff --git a/src/Entity/Browser/Container/Tab/Page/Navbar.php b/src/Entity/Browser/Container/Tab/Page/Navbar.php index 25a287ab..f96ccb03 100644 --- a/src/Entity/Browser/Container/Tab/Page/Navbar.php +++ b/src/Entity/Browser/Container/Tab/Page/Navbar.php @@ -94,6 +94,9 @@ class Navbar $this->gtk->add( $this->go->gtk ); + + // Render + $this->gtk->show(); } public function refresh() diff --git a/src/Entity/Browser/Container/Tab/Page/Navbar/History.php b/src/Entity/Browser/Container/Tab/Page/Navbar/History.php index 97e6abb7..ea57f353 100644 --- a/src/Entity/Browser/Container/Tab/Page/Navbar/History.php +++ b/src/Entity/Browser/Container/Tab/Page/Navbar/History.php @@ -50,6 +50,9 @@ class History $this->gtk->add( $this->forward->gtk ); + + // Render + $this->gtk->show(); } public function add( diff --git a/src/Entity/Browser/Container/Tab/Page/Response.php b/src/Entity/Browser/Container/Tab/Page/Response.php index e4d21538..1a607309 100644 --- a/src/Entity/Browser/Container/Tab/Page/Response.php +++ b/src/Entity/Browser/Container/Tab/Page/Response.php @@ -81,7 +81,7 @@ class Response public function show(): void { - $this->gtk->show_all(); + $this->gtk->show(); } public function hide(): void diff --git a/src/Entity/Browser/Header.php b/src/Entity/Browser/Header.php index acb70891..817a9770 100644 --- a/src/Entity/Browser/Header.php +++ b/src/Entity/Browser/Header.php @@ -50,6 +50,9 @@ class Header $this->gtk->add( $this->navigation->gtk ); + + // Render + $this->gtk->show(); } public function setTitle( diff --git a/src/Entity/Browser/Header/Navigation.php b/src/Entity/Browser/Header/Navigation.php index 0818c50e..500bc658 100644 --- a/src/Entity/Browser/Header/Navigation.php +++ b/src/Entity/Browser/Header/Navigation.php @@ -33,5 +33,8 @@ class Navigation $this->gtk->set_popup( $this->menu->gtk ); + + // Render + $this->gtk->show(); } } \ No newline at end of file diff --git a/src/Entity/Browser/History.php b/src/Entity/Browser/History.php index 7257b589..a285a338 100644 --- a/src/Entity/Browser/History.php +++ b/src/Entity/Browser/History.php @@ -59,5 +59,8 @@ class History $this->gtk->add( $this->container->gtk ); + + // Render + $this->gtk->show(); } } \ No newline at end of file diff --git a/src/Entity/Browser/History/Container.php b/src/Entity/Browser/History/Container.php index f4ef0464..12d948d7 100644 --- a/src/Entity/Browser/History/Container.php +++ b/src/Entity/Browser/History/Container.php @@ -49,6 +49,9 @@ class Container true, 0 ); + + // Render + $this->gtk->show(); } public function refresh() diff --git a/src/Entity/Browser/History/Container/Content.php b/src/Entity/Browser/History/Container/Content.php index 8dfc36a7..54f4d1cc 100644 --- a/src/Entity/Browser/History/Container/Content.php +++ b/src/Entity/Browser/History/Container/Content.php @@ -60,6 +60,9 @@ class Content $this->viewport->gtk ); + // Render + $this->gtk->show(); + // Do initial search $this->search(); } diff --git a/src/Entity/Browser/History/Container/Content/Table.php b/src/Entity/Browser/History/Container/Content/Table.php index 4b3ee733..fa766c09 100644 --- a/src/Entity/Browser/History/Container/Content/Table.php +++ b/src/Entity/Browser/History/Container/Content/Table.php @@ -66,7 +66,10 @@ class Table $this->data->gtk ); - // Connect events + // Render + $this->gtk->show(); + + // Init events $this->gtk->connect( 'row-activated', function() diff --git a/src/Entity/Browser/History/Container/Content/Viewport.php b/src/Entity/Browser/History/Container/Content/Viewport.php index 8660a5e9..ae7d164c 100644 --- a/src/Entity/Browser/History/Container/Content/Viewport.php +++ b/src/Entity/Browser/History/Container/Content/Viewport.php @@ -19,5 +19,8 @@ class Viewport // Init viewport $this->gtk = new \GtkViewport; + + // Render + $this->gtk->show(); } } \ No newline at end of file diff --git a/src/Entity/Browser/History/Container/Navbar.php b/src/Entity/Browser/History/Container/Navbar.php index d7638aa7..c5db79ec 100644 --- a/src/Entity/Browser/History/Container/Navbar.php +++ b/src/Entity/Browser/History/Container/Navbar.php @@ -94,6 +94,9 @@ class Navbar $this->gtk->add( $this->search->gtk ); + + // Render + $this->gtk->show(); } public function refresh(): void diff --git a/src/Entity/Browser/History/Header.php b/src/Entity/Browser/History/Header.php index 0c1371fc..b9cf1548 100644 --- a/src/Entity/Browser/History/Header.php +++ b/src/Entity/Browser/History/Header.php @@ -27,5 +27,8 @@ class Header $this->gtk->set_subtitle( $this->_subtitle ); + + // Render + $this->gtk->show(); } } \ No newline at end of file diff --git a/src/Entity/Browser/Menu.php b/src/Entity/Browser/Menu.php index ecccad61..5cc99db7 100644 --- a/src/Entity/Browser/Menu.php +++ b/src/Entity/Browser/Menu.php @@ -62,6 +62,6 @@ class Menu ); // Render - $this->gtk->show_all(); + $this->gtk->show(); } } \ No newline at end of file diff --git a/src/Entity/Browser/Menu/History.php b/src/Entity/Browser/Menu/History.php index 395b2a05..bf513d17 100644 --- a/src/Entity/Browser/Menu/History.php +++ b/src/Entity/Browser/Menu/History.php @@ -25,6 +25,9 @@ class History $this->_label ); + // Render + $this->gtk->show(); + // Int events $this->gtk->connect( 'activate', @@ -33,8 +36,6 @@ class History $history = new \Yggverse\Yoda\Entity\Browser\History( $this->menu->browser ); - - $history->gtk->show_all(); } ); } diff --git a/src/Entity/Browser/Menu/Quit.php b/src/Entity/Browser/Menu/Quit.php index 3a6d7431..28a47ce5 100644 --- a/src/Entity/Browser/Menu/Quit.php +++ b/src/Entity/Browser/Menu/Quit.php @@ -25,6 +25,9 @@ class Quit $this->_label ); + // Render + $this->gtk->show(); + // Int events $this->gtk->connect( 'activate', diff --git a/src/Entity/Browser/Menu/Tab.php b/src/Entity/Browser/Menu/Tab.php index 7df229bb..f5e66b6b 100644 --- a/src/Entity/Browser/Menu/Tab.php +++ b/src/Entity/Browser/Menu/Tab.php @@ -56,5 +56,8 @@ class Tab $this->gtk->set_submenu( $tab ); + + // Render + $this->gtk->show(); } } \ No newline at end of file diff --git a/src/Entity/Browser/Menu/Tab/Add.php b/src/Entity/Browser/Menu/Tab/Add.php index d8bbc1f1..0a986ba0 100644 --- a/src/Entity/Browser/Menu/Tab/Add.php +++ b/src/Entity/Browser/Menu/Tab/Add.php @@ -25,6 +25,9 @@ class Add $this->_label ); + // Render + $this->gtk->show(); + // Init events $this->gtk->connect( 'activate', diff --git a/src/Entity/Browser/Menu/Tab/Close.php b/src/Entity/Browser/Menu/Tab/Close.php index 612db34c..54cb7762 100644 --- a/src/Entity/Browser/Menu/Tab/Close.php +++ b/src/Entity/Browser/Menu/Tab/Close.php @@ -25,6 +25,9 @@ class Close $this->_label ); + // Render + $this->gtk->show(); + // Int events $this->gtk->connect( 'activate', diff --git a/src/Yoda.php b/src/Yoda.php index ee1ef5da..e467d9f9 100644 --- a/src/Yoda.php +++ b/src/Yoda.php @@ -36,6 +36,4 @@ $browser->gtk->connect( } ); -$browser->gtk->show_all(); - \Gtk::main(); \ No newline at end of file