mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-13 06:01:21 +00:00
update application namespaces, update window title on page change
This commit is contained in:
parent
183c26e56a
commit
c2bc925b70
@ -1,5 +1,5 @@
|
||||
{
|
||||
"window":
|
||||
"app":
|
||||
{
|
||||
"title":"Yoda",
|
||||
"theme":"Default",
|
||||
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Yoda\Entity;
|
||||
|
||||
class Window
|
||||
class App
|
||||
{
|
||||
public \GtkWindow $window;
|
||||
public \GtkNotebook $tab;
|
||||
@ -13,7 +13,7 @@ class Window
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->config = \Yggverse\Yoda\Model\File::getConfig()->window; // @TODO
|
||||
$this->config = \Yggverse\Yoda\Model\File::getConfig()->app; // @TODO
|
||||
|
||||
$this->window = new \GtkWindow();
|
||||
|
||||
@ -68,6 +68,13 @@ class Window
|
||||
)
|
||||
);
|
||||
|
||||
$this->tab->set_menu_label(
|
||||
$page->box,
|
||||
new \GtkLabel(
|
||||
'2' // @TODO
|
||||
)
|
||||
);
|
||||
|
||||
$this->tab->set_tab_reorderable(
|
||||
$page->box,
|
||||
true
|
@ -6,9 +6,9 @@ namespace Yggverse\Yoda\Entity\Tab;
|
||||
|
||||
class Page
|
||||
{
|
||||
public \Yggverse\Yoda\Entity\Window $window;
|
||||
public \Yggverse\Yoda\Entity\App $app;
|
||||
|
||||
public \Yggverse\Yoda\Model\Memory $dns;
|
||||
public \Yggverse\Yoda\Model\Memory $dns;
|
||||
public \Yggverse\Yoda\Model\History $history;
|
||||
|
||||
public \GtkBox $box,
|
||||
@ -31,13 +31,13 @@ class Page
|
||||
public object $config;
|
||||
|
||||
public function __construct(
|
||||
\Yggverse\Yoda\Entity\Window $window
|
||||
\Yggverse\Yoda\Entity\App $app
|
||||
) {
|
||||
// Init window
|
||||
$this->window = $window;
|
||||
// Init app
|
||||
$this->app = $app;
|
||||
|
||||
// Init config
|
||||
$this->config = \Yggverse\Yoda\Model\File::getConfig()->window->tab->page;
|
||||
$this->config = \Yggverse\Yoda\Model\File::getConfig()->app->tab->page;
|
||||
|
||||
// Init DNS memory
|
||||
$this->dns = new \Yggverse\Yoda\Model\Memory();
|
||||
@ -423,21 +423,22 @@ class Page
|
||||
)
|
||||
);
|
||||
|
||||
/* @TODO
|
||||
$body = new \Yggverse\Gemini\Gemtext\Body(
|
||||
$response->getBody()
|
||||
);
|
||||
|
||||
if ($h1 = $body->getH1())
|
||||
{
|
||||
$this->window->set_title(
|
||||
$this->app->window->set_title(
|
||||
sprintf(
|
||||
'%s - Yoda',
|
||||
empty($h1[0]) ? $address->getHost() : $h1[0]
|
||||
'%s - %s',
|
||||
empty($h1[0]) ? $address->getHost() : $h1[0],
|
||||
$this->app->config->title
|
||||
)
|
||||
);
|
||||
|
||||
// @TODO update tab title
|
||||
}
|
||||
*/
|
||||
|
||||
$this->status->set_text(
|
||||
str_replace( // Custom macros mask from config.json
|
||||
@ -487,18 +488,18 @@ class Page
|
||||
);
|
||||
|
||||
// Parse gemtext
|
||||
/* @TODO
|
||||
$body = new \Yggverse\Gemini\Gemtext\Body(
|
||||
$data
|
||||
);
|
||||
|
||||
if ($h1 = $body->getH1())
|
||||
{
|
||||
$this->window->set_title(
|
||||
$this->app->window->set_title(
|
||||
$h1[0]
|
||||
);
|
||||
|
||||
// @TODO update tab title
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
private function _gemtext(
|
||||
|
@ -9,6 +9,6 @@ require_once __DIR__ .
|
||||
// Init app
|
||||
\Gtk::init();
|
||||
|
||||
new \Yggverse\Yoda\Entity\Window();
|
||||
new \Yggverse\Yoda\Entity\App();
|
||||
|
||||
\Gtk::main();
|
Loading…
x
Reference in New Issue
Block a user