draft new navigation buttons

This commit is contained in:
yggverse 2024-04-09 15:32:40 +03:00
parent 9635f6fcea
commit 42d65d4a50
6 changed files with 129 additions and 0 deletions

View file

@ -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
);

18
src/Button/Back.php Normal file
View file

@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Button;
class Back
{
public \GtkButton $button;
public function __construct(
?string $label = 'Back'
) {
$this->button = \GtkButton::new_with_label(
$label
);
}
}

18
src/Button/Forward.php Normal file
View file

@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Button;
class Forward
{
public \GtkButton $button;
public function __construct(
?string $label = 'Forward'
) {
$this->button = \GtkButton::new_with_label(
$label
);
}
}

18
src/Button/Home.php Normal file
View file

@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Button;
class Home
{
public \GtkButton $button;
public function __construct(
?string $label = 'Home'
) {
$this->button = \GtkButton::new_with_label(
$label
);
}
}

18
src/Button/Reload.php Normal file
View file

@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Button;
class Reload
{
public \GtkButton $button;
public function __construct(
?string $label = 'Reload'
) {
$this->button = \GtkButton::new_with_label(
$label
);
}
}