mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
draft new navigation buttons
This commit is contained in:
parent
9635f6fcea
commit
42d65d4a50
6 changed files with 129 additions and 0 deletions
|
|
@ -17,6 +17,10 @@
|
||||||
{
|
{
|
||||||
"button":
|
"button":
|
||||||
{
|
{
|
||||||
|
"home":true,
|
||||||
|
"back":true,
|
||||||
|
"forward":true,
|
||||||
|
"reload":true,
|
||||||
"go":true
|
"go":true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,11 @@ class Navigation
|
||||||
public \GtkBox $box;
|
public \GtkBox $box;
|
||||||
|
|
||||||
public \Yggverse\Yoda\Entry\Address $address;
|
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 \Yggverse\Yoda\Button\Go $go;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
|
@ -24,6 +29,54 @@ class Navigation
|
||||||
$name
|
$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(
|
$this->address = new \Yggverse\Yoda\Entry\Address(
|
||||||
$config->homepage
|
$config->homepage
|
||||||
);
|
);
|
||||||
|
|
|
||||||
18
src/Button/Back.php
Normal file
18
src/Button/Back.php
Normal 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
18
src/Button/Forward.php
Normal 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
18
src/Button/Home.php
Normal 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
18
src/Button/Reload.php
Normal 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
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue