Browse Source

listen enabled buttons only, disable home button on same url

PHP-GTK3
yggverse 8 months ago
parent
commit
46a6a240cc
  1. 55
      src/Controller/Browser.php

55
src/Controller/Browser.php

@ -30,27 +30,33 @@ class Browser extends \Yggverse\Yoda\Abstract\Window
} }
); );
$this->tab->navigation->go->button->connect( if ($this->config->interface->window->navigation->button->go)
'released', {
function ($entry) $this->tab->navigation->go->button->connect(
{ 'released',
$this->navigate( function ($entry)
$this->tab->navigation->address->entry->get_text() {
); $this->navigate(
} $this->tab->navigation->address->entry->get_text()
); );
}
);
}
$this->tab->navigation->reload->button->connect( if ($this->config->interface->window->navigation->button->reload)
'released', {
function ($entry) $this->tab->navigation->reload->button->connect(
{ 'released',
$this->navigate( function ($entry)
$this->tab->navigation->address->entry->get_text() {
); $this->navigate(
} $this->tab->navigation->address->entry->get_text()
); );
}
);
}
if ($this->config->homepage) if ($this->config->interface->window->navigation->button->home && $this->config->homepage)
{ {
$this->tab->navigation->home->button->connect( $this->tab->navigation->home->button->connect(
'released', 'released',
@ -65,6 +71,10 @@ class Browser extends \Yggverse\Yoda\Abstract\Window
); );
} }
); );
$this->tab->navigation->home->button->set_sensitive(
!($url == $this->config->homepage)
);
} }
$this->window->add( $this->window->add(
@ -168,5 +178,12 @@ class Browser extends \Yggverse\Yoda\Abstract\Window
) )
) )
); );
if ($this->config->interface->window->navigation->button->home && $this->config->homepage)
{
$this->tab->navigation->home->button->set_sensitive(
!($url == $this->config->homepage)
);
}
} }
} }
Loading…
Cancel
Save