mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
draft navigation button
This commit is contained in:
parent
9ba43116b0
commit
b48b3a6980
3 changed files with 47 additions and 3 deletions
10
config.json
10
config.json
|
|
@ -13,6 +13,16 @@
|
||||||
"close":true
|
"close":true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"navigation":
|
||||||
|
{
|
||||||
|
"button":
|
||||||
|
{
|
||||||
|
"go":
|
||||||
|
{
|
||||||
|
"enabled":true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"width":640,
|
"width":640,
|
||||||
"height":480
|
"height":480
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
Normal file
18
src/Button/Go.php
Normal file
|
|
@ -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…
Add table
Add a link
Reference in a new issue