Browse Source

draft navigation button

PHP-GTK3
yggverse 8 months ago
parent
commit
b48b3a6980
  1. 10
      config.json
  2. 22
      src/Box/Navigation.php
  3. 18
      src/Button/Go.php

10
config.json

@ -13,6 +13,16 @@
"close":true "close":true
} }
}, },
"navigation":
{
"button":
{
"go":
{
"enabled":true
}
}
},
"width":640, "width":640,
"height":480 "height":480
} }

22
src/Box/Navigation.php

@ -9,6 +9,7 @@ class Navigation
public \GtkBox $box; public \GtkBox $box;
public \Yggverse\Yoda\Entry\Address $address; public \Yggverse\Yoda\Entry\Address $address;
public \Yggverse\Yoda\Button\Go $go;
public function __construct( public function __construct(
string $name = 'boxNavigation' string $name = 'boxNavigation'
@ -16,7 +17,7 @@ class Navigation
global $config; global $config;
$this->box = new \GtkBox( $this->box = new \GtkBox(
\GtkOrientation::VERTICAL \GtkOrientation::HORIZONTAL
); );
$this->box->set_name( $this->box->set_name(
@ -27,8 +28,23 @@ class Navigation
$config->homepage $config->homepage
); );
$this->box->add( $this->box->pack_start(
$this->address->entry $this->address->entry,
true,
true,
8
); );
if ($config->interface->window->navigation->button->go->enabled)
{
$this->go = new \Yggverse\Yoda\Button\Go();
$this->box->pack_end(
$this->go->button,
false,
false,
8
);
}
} }
} }

18
src/Button/Go.php

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