From 42d65d4a5026054f02db6392f7ddb502a6c0eaea Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 9 Apr 2024 15:32:40 +0300 Subject: [PATCH] draft new navigation buttons --- config.json | 4 ++++ src/Box/Navigation.php | 53 ++++++++++++++++++++++++++++++++++++++++++ src/Button/Back.php | 18 ++++++++++++++ src/Button/Forward.php | 18 ++++++++++++++ src/Button/Home.php | 18 ++++++++++++++ src/Button/Reload.php | 18 ++++++++++++++ 6 files changed, 129 insertions(+) create mode 100644 src/Button/Back.php create mode 100644 src/Button/Forward.php create mode 100644 src/Button/Home.php create mode 100644 src/Button/Reload.php diff --git a/config.json b/config.json index 1160d66..73a9f0e 100644 --- a/config.json +++ b/config.json @@ -17,6 +17,10 @@ { "button": { + "home":true, + "back":true, + "forward":true, + "reload":true, "go":true } }, diff --git a/src/Box/Navigation.php b/src/Box/Navigation.php index 69da102..64e09a8 100644 --- a/src/Box/Navigation.php +++ b/src/Box/Navigation.php @@ -9,6 +9,11 @@ class Navigation public \GtkBox $box; public \Yggverse\Yoda\Entry\Address $address; + + public \Yggverse\Yoda\Button\Home $home; + public \Yggverse\Yoda\Button\Back $back; + public \Yggverse\Yoda\Button\Forward $forward; + public \Yggverse\Yoda\Button\Reload $reload; public \Yggverse\Yoda\Button\Go $go; public function __construct( @@ -24,6 +29,54 @@ class Navigation $name ); + if ($config->interface->window->navigation->button->home) + { + $this->home = new \Yggverse\Yoda\Button\Home(); + + $this->box->pack_start( + $this->home->button, + false, + false, + 8 + ); + } + + if ($config->interface->window->navigation->button->back) + { + $this->back = new \Yggverse\Yoda\Button\Back(); + + $this->box->pack_start( + $this->back->button, + false, + false, + 8 + ); + } + + if ($config->interface->window->navigation->button->forward) + { + $this->forward = new \Yggverse\Yoda\Button\Forward(); + + $this->box->pack_start( + $this->forward->button, + false, + false, + 8 + ); + } + + if ($config->interface->window->navigation->button->reload) + { + $this->reload = new \Yggverse\Yoda\Button\Reload(); + + $this->box->pack_start( + $this->reload->button, + false, + false, + 8 + ); + } + $this->address = new \Yggverse\Yoda\Entry\Address( $config->homepage ); diff --git a/src/Button/Back.php b/src/Button/Back.php new file mode 100644 index 0000000..acd131a --- /dev/null +++ b/src/Button/Back.php @@ -0,0 +1,18 @@ +button = \GtkButton::new_with_label( + $label + ); + } +} \ No newline at end of file diff --git a/src/Button/Forward.php b/src/Button/Forward.php new file mode 100644 index 0000000..6619b68 --- /dev/null +++ b/src/Button/Forward.php @@ -0,0 +1,18 @@ +button = \GtkButton::new_with_label( + $label + ); + } +} \ No newline at end of file diff --git a/src/Button/Home.php b/src/Button/Home.php new file mode 100644 index 0000000..d419407 --- /dev/null +++ b/src/Button/Home.php @@ -0,0 +1,18 @@ +button = \GtkButton::new_with_label( + $label + ); + } +} \ No newline at end of file diff --git a/src/Button/Reload.php b/src/Button/Reload.php new file mode 100644 index 0000000..2f97768 --- /dev/null +++ b/src/Button/Reload.php @@ -0,0 +1,18 @@ +button = \GtkButton::new_with_label( + $label + ); + } +} \ No newline at end of file