init abstract window controller

This commit is contained in:
yggverse 2024-04-10 08:58:16 +03:00
parent 78a2fa16c9
commit 75806cd295
3 changed files with 83 additions and 74 deletions

View file

@ -6,69 +6,9 @@ require_once __DIR__ .
DIRECTORY_SEPARATOR . 'vendor' .
DIRECTORY_SEPARATOR . 'autoload.php';
// Init config
$config = \Yggverse\Yoda\Model\File::getConfig();
// Init GTK
// Init app
\Gtk::init();
// Init theme
$css = new \GtkCssProvider();
$css->load_from_data(
\Yggverse\Yoda\Model\File::getTheme(
$config->interface->theme
)
);
$style = new \GtkStyleContext();
$style->add_provider_for_screen(
$css,
600
);
// Init app window
$window = new \GtkWindow();
$window->set_size_request(
$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'
);
$window->connect(
'destroy',
function()
{
\Gtk::main_quit();
}
);
$controller = new \Yggverse\Yoda\Controller\Tab(
$window
);
$window->add(
$controller->tab->box
);
$window->show_all();
new \Yggverse\Yoda\Controller\Browser();
\Gtk::main();