mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
define dependencies ns
This commit is contained in:
parent
8c6936f5b1
commit
14ee41e735
22 changed files with 154 additions and 76 deletions
|
|
@ -4,6 +4,8 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity;
|
||||
|
||||
use \GtkWindow;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\Header;
|
||||
use \Yggverse\Yoda\Entity\Browser\Container;
|
||||
|
||||
|
|
@ -11,7 +13,8 @@ use \Yggverse\Yoda\Model\Database;
|
|||
|
||||
class Browser
|
||||
{
|
||||
public \GtkWindow $gtk;
|
||||
// GTK
|
||||
public GtkWindow $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Database $database;
|
||||
|
|
@ -32,7 +35,7 @@ class Browser
|
|||
$this->database = $database;
|
||||
|
||||
// Init window
|
||||
$this->gtk = new \GtkWindow;
|
||||
$this->gtk = new GtkWindow;
|
||||
|
||||
$this->gtk->set_size_request(
|
||||
$this::WIDTH,
|
||||
|
|
@ -69,8 +72,8 @@ class Browser
|
|||
$this->gtk->connect(
|
||||
'configure-event',
|
||||
function(
|
||||
\GtkWindow $window,
|
||||
// \GdkEvent $event
|
||||
GtkWindow $window,
|
||||
// GdkEvent $event
|
||||
) {
|
||||
// @TODO render data wordwrap by $window->get_size()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,15 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser;
|
||||
|
||||
use \GtkBox;
|
||||
use \GtkOrientation;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser;
|
||||
|
||||
class Container
|
||||
{
|
||||
public \GtkBox $gtk;
|
||||
// GTK
|
||||
public GtkBox $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Browser $browser;
|
||||
|
|
@ -23,8 +27,8 @@ class Container
|
|||
$this->browser = $browser;
|
||||
|
||||
// Init container
|
||||
$this->gtk = new \GtkBox(
|
||||
\GtkOrientation::VERTICAL
|
||||
$this->gtk = new GtkBox(
|
||||
GtkOrientation::VERTICAL
|
||||
);
|
||||
|
||||
// Init tab
|
||||
|
|
|
|||
|
|
@ -4,11 +4,14 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser;
|
||||
|
||||
use \GtkHeaderBar;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser;
|
||||
|
||||
class Header
|
||||
{
|
||||
public \GtkHeaderBar $gtk;
|
||||
// GTK
|
||||
public GtkHeaderBar $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Browser $browser;
|
||||
|
|
@ -28,7 +31,7 @@ class Header
|
|||
$this->browser = $browser;
|
||||
|
||||
// Init header
|
||||
$this->gtk = new \GtkHeaderBar;
|
||||
$this->gtk = new GtkHeaderBar;
|
||||
|
||||
$this->gtk->set_show_close_button(
|
||||
$this::ACTIONS
|
||||
|
|
|
|||
|
|
@ -4,10 +4,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser;
|
||||
|
||||
use \GtkWindow;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser;
|
||||
|
||||
class History
|
||||
{
|
||||
// GTK
|
||||
public \GtkWindow $gtk;
|
||||
|
||||
// Dependencies
|
||||
|
|
@ -29,7 +32,7 @@ class History
|
|||
$this->browser = $browser;
|
||||
|
||||
// Init window
|
||||
$this->gtk = new \GtkWindow;
|
||||
$this->gtk = new GtkWindow;
|
||||
|
||||
$this->gtk->set_size_request(
|
||||
$this::WIDTH,
|
||||
|
|
|
|||
|
|
@ -4,11 +4,15 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\History;
|
||||
|
||||
use \GtkBox;
|
||||
use \GtkOrientation;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\History;
|
||||
|
||||
class Container
|
||||
{
|
||||
public \GtkBox $gtk;
|
||||
// GTK
|
||||
public GtkBox $gtk;
|
||||
|
||||
// Dependencies
|
||||
public History $history;
|
||||
|
|
@ -24,8 +28,8 @@ class Container
|
|||
$this->history = $history;
|
||||
|
||||
// Init container
|
||||
$this->gtk = new \GtkBox(
|
||||
\GtkOrientation::VERTICAL
|
||||
$this->gtk = new GtkBox(
|
||||
GtkOrientation::VERTICAL
|
||||
);
|
||||
|
||||
// Init navbar
|
||||
|
|
|
|||
|
|
@ -4,11 +4,14 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\History\Container;
|
||||
|
||||
use \GtkScrolledWindow;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\History\Container;
|
||||
|
||||
class Content
|
||||
{
|
||||
public \GtkScrolledWindow $gtk;
|
||||
// GTK
|
||||
public GtkScrolledWindow $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Container $container;
|
||||
|
|
@ -27,7 +30,7 @@ class Content
|
|||
$this->container = $container;
|
||||
|
||||
// Init container
|
||||
$this->gtk = new \GtkScrolledWindow;
|
||||
$this->gtk = new GtkScrolledWindow;
|
||||
|
||||
$this->gtk->set_margin_start(
|
||||
$this::MARGIN
|
||||
|
|
|
|||
|
|
@ -4,11 +4,15 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\History\Container\Content;
|
||||
|
||||
use \GtkCellRendererText;
|
||||
use \GtkTreeView;
|
||||
use \GtkTreeViewColumn;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\History\Container\Content;
|
||||
|
||||
class Table
|
||||
{
|
||||
public \GtkTreeView $gtk;
|
||||
public GtkTreeView $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Content $content;
|
||||
|
|
@ -28,30 +32,30 @@ class Table
|
|||
$this->content = $content;
|
||||
|
||||
// Init tree view
|
||||
$this->gtk = new \GtkTreeView;
|
||||
$this->gtk = new GtkTreeView;
|
||||
|
||||
$this->gtk->append_column(
|
||||
new \GtkTreeViewColumn(
|
||||
new GtkTreeViewColumn(
|
||||
$this::TIME,
|
||||
new \GtkCellRendererText(),
|
||||
new GtkCellRendererText(),
|
||||
'text',
|
||||
1
|
||||
)
|
||||
);
|
||||
|
||||
$this->gtk->append_column(
|
||||
new \GtkTreeViewColumn(
|
||||
new GtkTreeViewColumn(
|
||||
$this::URL,
|
||||
new \GtkCellRendererText(),
|
||||
new GtkCellRendererText(),
|
||||
'text',
|
||||
2
|
||||
)
|
||||
);
|
||||
|
||||
$this->gtk->append_column(
|
||||
new \GtkTreeViewColumn(
|
||||
new GtkTreeViewColumn(
|
||||
$this::TITLE,
|
||||
new \GtkCellRendererText(),
|
||||
new GtkCellRendererText(),
|
||||
'text',
|
||||
3
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4,11 +4,14 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\History\Container\Content\Table;
|
||||
|
||||
use \GObject;
|
||||
use \GtkListStore;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\History\Container\Content\Table;
|
||||
|
||||
class Data
|
||||
{
|
||||
public \GtkListStore $gtk;
|
||||
public GtkListStore $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Table $table;
|
||||
|
|
@ -23,11 +26,11 @@ class Data
|
|||
$this->table = $table;
|
||||
|
||||
// Init tree view
|
||||
$this->gtk = new \GtkListStore(
|
||||
\GObject::TYPE_INT,
|
||||
\GObject::TYPE_STRING,
|
||||
\GObject::TYPE_STRING,
|
||||
\GObject::TYPE_STRING
|
||||
$this->gtk = new GtkListStore(
|
||||
GObject::TYPE_INT,
|
||||
GObject::TYPE_STRING,
|
||||
GObject::TYPE_STRING,
|
||||
GObject::TYPE_STRING
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,14 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\History\Container\Content;
|
||||
|
||||
use \GtkViewport;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\History\Container\Content;
|
||||
|
||||
class Viewport
|
||||
{
|
||||
public \GtkViewport $gtk;
|
||||
// GTK
|
||||
public GtkViewport $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Content $content;
|
||||
|
|
@ -20,7 +23,7 @@ class Viewport
|
|||
$this->content = $content;
|
||||
|
||||
// Init viewport
|
||||
$this->gtk = new \GtkViewport;
|
||||
$this->gtk = new GtkViewport;
|
||||
|
||||
// Render
|
||||
$this->gtk->show();
|
||||
|
|
|
|||
|
|
@ -4,11 +4,14 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\History\Container;
|
||||
|
||||
use \GtkBox;
|
||||
use \GtkOrientation;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\History\Container;
|
||||
|
||||
class Navbar
|
||||
{
|
||||
public \GtkBox $gtk;
|
||||
public GtkBox $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Container $container;
|
||||
|
|
@ -30,8 +33,8 @@ class Navbar
|
|||
$this->container = $container;
|
||||
|
||||
// Init container
|
||||
$this->gtk = new \GtkBox(
|
||||
\GtkOrientation::HORIZONTAL
|
||||
$this->gtk = new GtkBox(
|
||||
GtkOrientation::HORIZONTAL
|
||||
);
|
||||
|
||||
$this->gtk->set_margin_top(
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\History\Container\Navbar;
|
||||
|
||||
use \GtkButton;
|
||||
|
||||
use \Yggverse\Yoda\Abstract\Entity\Browser\History\Container\Navbar\Button;
|
||||
|
||||
class Delete extends Button
|
||||
|
|
@ -13,7 +15,7 @@ class Delete extends Button
|
|||
public const TOOLTIP = 'Delete';
|
||||
|
||||
protected function _onCLick(
|
||||
\GtkButton $entity
|
||||
GtkButton $entity
|
||||
): void
|
||||
{
|
||||
if ($id = $this->navbar->container->content->table->getSelectedId())
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\History\Container\Navbar;
|
||||
|
||||
use \GdkEvent;
|
||||
use \GtkEntry;
|
||||
|
||||
use \Yggverse\Yoda\Abstract\Entity\Browser\History\Container\Navbar\Entry;
|
||||
|
||||
class Filter extends Entry
|
||||
|
|
@ -11,7 +14,7 @@ class Filter extends Entry
|
|||
public const PLACEHOLDER = 'Search in history...';
|
||||
|
||||
protected function _onActivate(
|
||||
\GtkEntry $entry
|
||||
GtkEntry $entry
|
||||
): void
|
||||
{
|
||||
$this->navbar->container->content->search(
|
||||
|
|
@ -20,8 +23,8 @@ class Filter extends Entry
|
|||
}
|
||||
|
||||
protected function _onKeyRelease(
|
||||
\GtkEntry $entry,
|
||||
\GdkEvent $event
|
||||
GtkEntry $entry,
|
||||
GdkEvent $event
|
||||
): void
|
||||
{
|
||||
$this->navbar->container->content->search(
|
||||
|
|
@ -30,13 +33,13 @@ class Filter extends Entry
|
|||
}
|
||||
|
||||
protected function _onChanged(
|
||||
\GtkEntry $entry
|
||||
GtkEntry $entry
|
||||
): void
|
||||
{}
|
||||
|
||||
protected function _onFocusOut(
|
||||
\GtkEntry $entry,
|
||||
\GdkEvent $event
|
||||
GtkEntry $entry,
|
||||
GdkEvent $event
|
||||
): void
|
||||
{}
|
||||
}
|
||||
|
|
@ -4,6 +4,8 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\History\Container\Navbar;
|
||||
|
||||
use \GtkButton;
|
||||
|
||||
use \Yggverse\Yoda\Abstract\Entity\Browser\History\Container\Navbar\Button;
|
||||
|
||||
class Open extends Button
|
||||
|
|
@ -13,7 +15,7 @@ class Open extends Button
|
|||
public const TOOLTIP = 'Open';
|
||||
|
||||
protected function _onCLick(
|
||||
\GtkButton $entity
|
||||
GtkButton $entity
|
||||
): void
|
||||
{
|
||||
$this->navbar->container->history->browser->container->tab->append(
|
||||
|
|
|
|||
|
|
@ -4,9 +4,11 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\History;
|
||||
|
||||
use \GtkHeaderBar;
|
||||
|
||||
class Header
|
||||
{
|
||||
public \GtkHeaderBar $gtk;
|
||||
public GtkHeaderBar $gtk;
|
||||
|
||||
public const ACTIONS = true;
|
||||
public const TITLE = 'History - Yoda';
|
||||
|
|
@ -14,7 +16,7 @@ class Header
|
|||
|
||||
public function __construct()
|
||||
{
|
||||
$this->gtk = new \GtkHeaderBar;
|
||||
$this->gtk = new GtkHeaderBar;
|
||||
|
||||
$this->gtk->set_show_close_button(
|
||||
$this::ACTIONS
|
||||
|
|
|
|||
|
|
@ -4,11 +4,14 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser;
|
||||
|
||||
use \GtkMenu;
|
||||
use \GtkSeparatorMenuItem;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser;
|
||||
|
||||
class Menu
|
||||
{
|
||||
public \GtkMenu $gtk;
|
||||
public GtkMenu $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Browser $browser;
|
||||
|
|
@ -26,7 +29,7 @@ class Menu
|
|||
$this->browser = $browser;
|
||||
|
||||
// Init menu
|
||||
$this->gtk = new \GtkMenu;
|
||||
$this->gtk = new GtkMenu;
|
||||
|
||||
// Init file menu item
|
||||
$this->file = new Menu\File(
|
||||
|
|
@ -57,7 +60,7 @@ class Menu
|
|||
|
||||
// Add separator
|
||||
$this->gtk->append(
|
||||
new \GtkSeparatorMenuItem
|
||||
new GtkSeparatorMenuItem
|
||||
);
|
||||
|
||||
// Init quit menu item
|
||||
|
|
|
|||
|
|
@ -4,11 +4,15 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
use \GtkMenu;
|
||||
use \GtkMenuItem;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
class File
|
||||
{
|
||||
public \GtkMenuItem $gtk;
|
||||
// GTK
|
||||
public GtkMenuItem $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Menu $menu;
|
||||
|
|
@ -23,12 +27,12 @@ class File
|
|||
$this->menu = $menu;
|
||||
|
||||
// Init menu item
|
||||
$this->gtk = \GtkMenuItem::new_with_label(
|
||||
$this->gtk = GtkMenuItem::new_with_label(
|
||||
$this::LABEL
|
||||
);
|
||||
|
||||
// Init submenu container
|
||||
$file = new \GtkMenu;
|
||||
$file = new GtkMenu;
|
||||
|
||||
// Init tab menu items
|
||||
$open = new File\Open(
|
||||
|
|
|
|||
|
|
@ -4,11 +4,18 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Menu\File;
|
||||
|
||||
use \GtkFileChooserAction;
|
||||
use \GtkFileChooserDialog;
|
||||
use \GtkFileFilter;
|
||||
use \GtkMenuItem;
|
||||
use \GtkResponseType;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\Menu\File;
|
||||
|
||||
class Open
|
||||
{
|
||||
public \GtkMenuItem $gtk;
|
||||
// GTK
|
||||
public GtkMenuItem $gtk;
|
||||
|
||||
// Dependencies
|
||||
public File $file;
|
||||
|
|
@ -29,7 +36,7 @@ class Open
|
|||
$this->file = $file;
|
||||
|
||||
// Init menu item
|
||||
$this->gtk = \GtkMenuItem::new_with_label(
|
||||
$this->gtk = GtkMenuItem::new_with_label(
|
||||
$this::LABEL
|
||||
);
|
||||
|
||||
|
|
@ -41,15 +48,15 @@ class Open
|
|||
'activate',
|
||||
function()
|
||||
{
|
||||
$dialog = new \GtkFileChooserDialog(
|
||||
$dialog = new GtkFileChooserDialog(
|
||||
'Open file',
|
||||
$this->file->menu->browser->gtk,
|
||||
\GtkFileChooserAction::OPEN,
|
||||
GtkFileChooserAction::OPEN,
|
||||
[
|
||||
'Cancel',
|
||||
\GtkResponseType::CANCEL,
|
||||
GtkResponseType::CANCEL,
|
||||
'Open',
|
||||
\GtkResponseType::OK
|
||||
GtkResponseType::OK
|
||||
]
|
||||
);
|
||||
|
||||
|
|
@ -66,7 +73,7 @@ class Open
|
|||
|
||||
foreach ($this::PATTERN as $pattern => $name)
|
||||
{
|
||||
$filter = new \GtkFileFilter;
|
||||
$filter = new GtkFileFilter;
|
||||
|
||||
$filter->set_name(
|
||||
$name ? $name : $pattern
|
||||
|
|
@ -81,7 +88,7 @@ class Open
|
|||
);
|
||||
}
|
||||
|
||||
if (\GtkResponseType::OK == $dialog->run())
|
||||
if (GtkResponseType::OK == $dialog->run())
|
||||
{
|
||||
foreach ($dialog->get_filenames() as $filename)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,11 +4,17 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Menu\File;
|
||||
|
||||
use \GtkMenuItem;
|
||||
use \GtkFileChooserDialog;
|
||||
use \GtkFileChooserAction;
|
||||
use \GtkResponseType;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\Menu\File;
|
||||
|
||||
class Save
|
||||
{
|
||||
public \GtkMenuItem $gtk;
|
||||
// GTK
|
||||
public GtkMenuItem $gtk;
|
||||
|
||||
// Dependencies
|
||||
public File $file;
|
||||
|
|
@ -23,7 +29,7 @@ class Save
|
|||
$this->file = $file;
|
||||
|
||||
// Init menu item
|
||||
$this->gtk = \GtkMenuItem::new_with_label(
|
||||
$this->gtk = GtkMenuItem::new_with_label(
|
||||
$this::LABEL
|
||||
);
|
||||
|
||||
|
|
@ -35,15 +41,15 @@ class Save
|
|||
'activate',
|
||||
function()
|
||||
{
|
||||
$dialog = new \GtkFileChooserDialog(
|
||||
$dialog = new GtkFileChooserDialog(
|
||||
'Save to file',
|
||||
$this->file->menu->browser->gtk,
|
||||
\GtkFileChooserAction::SAVE,
|
||||
GtkFileChooserAction::SAVE,
|
||||
[
|
||||
'Cancel',
|
||||
\GtkResponseType::CANCEL,
|
||||
GtkResponseType::CANCEL,
|
||||
'Save',
|
||||
\GtkResponseType::APPLY
|
||||
GtkResponseType::APPLY
|
||||
]
|
||||
);
|
||||
|
||||
|
|
@ -58,7 +64,7 @@ class Save
|
|||
true
|
||||
);
|
||||
|
||||
if (\GtkResponseType::APPLY == $dialog->run())
|
||||
if (GtkResponseType::APPLY == $dialog->run())
|
||||
{
|
||||
if ($page = $this->file->menu->browser->container->tab->get())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,11 +4,16 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
use \GtkMenuItem;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\History as Window;
|
||||
|
||||
class History
|
||||
{
|
||||
public \GtkMenuItem $gtk;
|
||||
// GTK
|
||||
public GtkMenuItem $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Menu $menu;
|
||||
|
|
@ -23,7 +28,7 @@ class History
|
|||
$this->menu = $menu;
|
||||
|
||||
// Init menu item
|
||||
$this->gtk = \GtkMenuItem::new_with_label(
|
||||
$this->gtk = GtkMenuItem::new_with_label(
|
||||
$this::LABEL
|
||||
);
|
||||
|
||||
|
|
@ -35,7 +40,7 @@ class History
|
|||
'activate',
|
||||
function()
|
||||
{
|
||||
$history = new \Yggverse\Yoda\Entity\Browser\History(
|
||||
$history = new Window(
|
||||
$this->menu->browser
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,15 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
use \Gtk;
|
||||
use \GtkMenuItem;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
class Quit
|
||||
{
|
||||
public \GtkMenuItem $gtk;
|
||||
// GTK
|
||||
public GtkMenuItem $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Menu $menu;
|
||||
|
|
@ -23,7 +27,7 @@ class Quit
|
|||
$this->menu = $menu;
|
||||
|
||||
// Init menu item
|
||||
$this->gtk = \GtkMenuItem::new_with_label(
|
||||
$this->gtk = GtkMenuItem::new_with_label(
|
||||
$this::LABEL
|
||||
);
|
||||
|
||||
|
|
@ -35,7 +39,7 @@ class Quit
|
|||
'activate',
|
||||
function()
|
||||
{
|
||||
\Gtk::main_quit();
|
||||
Gtk::main_quit();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,15 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
use \GtkMenu;
|
||||
use \GtkMenuItem;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
class Tab
|
||||
{
|
||||
public \GtkMenuItem $gtk;
|
||||
// GTK
|
||||
public GtkMenuItem $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Menu $menu;
|
||||
|
|
@ -27,12 +31,12 @@ class Tab
|
|||
$this->menu = $menu;
|
||||
|
||||
// Init menu item
|
||||
$this->gtk = \GtkMenuItem::new_with_label(
|
||||
$this->gtk = GtkMenuItem::new_with_label(
|
||||
$this::LABEL
|
||||
);
|
||||
|
||||
// Init submenu container
|
||||
$tab = new \GtkMenu;
|
||||
$tab = new GtkMenu;
|
||||
|
||||
// Init new tab menu item
|
||||
$this->add = new Tab\Add(
|
||||
|
|
|
|||
|
|
@ -4,11 +4,14 @@ declare(strict_types=1);
|
|||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Menu\Tab;
|
||||
|
||||
use \GtkMenuItem;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\Menu\Tab;
|
||||
|
||||
class Add
|
||||
{
|
||||
public \GtkMenuItem $gtk;
|
||||
// GTK
|
||||
public GtkMenuItem $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Tab $tab;
|
||||
|
|
@ -24,7 +27,7 @@ class Add
|
|||
$this->tab = $tab;
|
||||
|
||||
// Init menu item
|
||||
$this->gtk = \GtkMenuItem::new_with_label(
|
||||
$this->gtk = GtkMenuItem::new_with_label(
|
||||
_($this::LABEL)
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue