mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
init window tabs, init gemtext parser, refactor app sceleton
This commit is contained in:
parent
196b30e8d2
commit
ad04be61cb
19 changed files with 664 additions and 884 deletions
52
src/Yoda.php
52
src/Yoda.php
|
|
@ -9,6 +9,56 @@ require_once __DIR__ .
|
|||
// Init app
|
||||
\Gtk::init();
|
||||
|
||||
new \Yggverse\Yoda\Controller\Browser();
|
||||
$config = \Yggverse\Yoda\Model\File::getConfig(); // @TODO
|
||||
|
||||
$window = new \GtkWindow();
|
||||
|
||||
$window->set_size_request(
|
||||
$config->window->width,
|
||||
$config->window->height
|
||||
);
|
||||
|
||||
if ($config->window->header->enabled)
|
||||
{
|
||||
$header = new \GtkHeaderBar();
|
||||
|
||||
$header->set_title(
|
||||
$config->window->title
|
||||
);
|
||||
|
||||
$header->set_show_close_button(
|
||||
$config->window->header->button->close
|
||||
);
|
||||
|
||||
$window->set_titlebar(
|
||||
$header
|
||||
);
|
||||
}
|
||||
|
||||
$window->connect(
|
||||
'destroy',
|
||||
function()
|
||||
{
|
||||
\Gtk::main_quit();
|
||||
}
|
||||
);
|
||||
|
||||
$page = new \Yggverse\Yoda\Tab\Page();
|
||||
|
||||
$page->open(
|
||||
'yoda://welcome'
|
||||
);
|
||||
|
||||
$tab = new \GtkNotebook();
|
||||
|
||||
$tab->add(
|
||||
$page->box
|
||||
);
|
||||
|
||||
$window->add(
|
||||
$tab
|
||||
);
|
||||
|
||||
$window->show_all();
|
||||
|
||||
\Gtk::main();
|
||||
Loading…
Add table
Add a link
Reference in a new issue