From b2e4cf70b96be6dcdfc90a3aca7f70a84ba8444c Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 10 Apr 2024 06:41:53 +0300 Subject: [PATCH] show homepage button only if provided in settings --- src/Box/Navigation.php | 2 +- src/Box/Tab.php | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/Box/Navigation.php b/src/Box/Navigation.php index 59c5c066..91fbc4f1 100644 --- a/src/Box/Navigation.php +++ b/src/Box/Navigation.php @@ -29,7 +29,7 @@ class Navigation $name ); - if ($config->interface->window->navigation->button->home) + if ($config->interface->window->navigation->button->home && $config->homepage) { $this->home = new \Yggverse\Yoda\Button\Home(); diff --git a/src/Box/Tab.php b/src/Box/Tab.php index e9bbc69e..37f2a2d9 100644 --- a/src/Box/Tab.php +++ b/src/Box/Tab.php @@ -109,19 +109,22 @@ class Tab } ); - $this->navigation->home->button->connect( - 'released', - function ($entry) - { - $this->navigation->address->entry->set_text( - $this->config->homepage - ); + if ($this->config->homepage) + { + $this->navigation->home->button->connect( + 'released', + function ($entry) + { + $this->navigation->address->entry->set_text( + $this->config->homepage + ); - $this->navigate( - $this->config->homepage - ); - } - ); + $this->navigate( + $this->config->homepage + ); + } + ); + } // @TODO back, forward buttons }