Browse Source

add interface window settings

PHP-GTK3
yggverse 8 months ago
parent
commit
d0863884e3
  1. 18
      config.json
  2. 19
      src/Yoda.php

18
config.json

@ -1,6 +1,22 @@ @@ -1,6 +1,22 @@
{
"homepage":"gemini://yggverse.cities.yesterweb.org",
"theme":"Default",
"interface":
{
"theme":"Default",
"window":
{
"header":
{
"enabled":true,
"button":
{
"close":true
}
},
"width":640,
"height":480
}
},
"resolver":
{
"enabled":true,

19
src/Yoda.php

@ -20,7 +20,7 @@ $css = new \GtkCssProvider(); @@ -20,7 +20,7 @@ $css = new \GtkCssProvider();
$css->load_from_data(
\Yggverse\Yoda\Model\File::getTheme(
$config->theme
$config->interface->theme
)
);
@ -35,10 +35,23 @@ $style->add_provider_for_screen( @@ -35,10 +35,23 @@ $style->add_provider_for_screen(
$window = new \GtkWindow();
$window->set_size_request(
600,
480
$config->interface->window->width,
$config->interface->window->height
);
if ($config->interface->window->header->enabled)
{
$header = new \GtkHeaderBar();
$header->set_show_close_button(
$config->interface->window->header->button->close
);
$window->set_titlebar(
$header
);
}
$window->set_title(
'Yoda'
);

Loading…
Cancel
Save