Browse Source

draft new navigation buttons

PHP-GTK3
yggverse 7 months ago
parent
commit
42d65d4a50
  1. 4
      config.json
  2. 53
      src/Box/Navigation.php
  3. 18
      src/Button/Back.php
  4. 18
      src/Button/Forward.php
  5. 18
      src/Button/Home.php
  6. 18
      src/Button/Reload.php

4
config.json

@ -17,6 +17,10 @@ @@ -17,6 +17,10 @@
{
"button":
{
"home":true,
"back":true,
"forward":true,
"reload":true,
"go":true
}
},

53
src/Box/Navigation.php

@ -9,6 +9,11 @@ class Navigation @@ -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 @@ -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

@ -0,0 +1,18 @@ @@ -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

@ -0,0 +1,18 @@ @@ -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

@ -0,0 +1,18 @@ @@ -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

@ -0,0 +1,18 @@ @@ -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…
Cancel
Save