mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
init abstract window controller
This commit is contained in:
parent
78a2fa16c9
commit
75806cd295
3 changed files with 83 additions and 74 deletions
64
src/Yoda.php
64
src/Yoda.php
|
|
@ -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();
|
||||
Loading…
Add table
Add a link
Reference in a new issue