Browse Source

define dependencies ns

PHP-GTK3
yggverse 4 months ago
parent
commit
14ee41e735
  1. 11
      src/Entity/Browser.php
  2. 10
      src/Entity/Browser/Container.php
  3. 7
      src/Entity/Browser/Header.php
  4. 5
      src/Entity/Browser/History.php
  5. 10
      src/Entity/Browser/History/Container.php
  6. 7
      src/Entity/Browser/History/Container/Content.php
  7. 20
      src/Entity/Browser/History/Container/Content/Table.php
  8. 15
      src/Entity/Browser/History/Container/Content/Table/Data.php
  9. 7
      src/Entity/Browser/History/Container/Content/Viewport.php
  10. 9
      src/Entity/Browser/History/Container/Navbar.php
  11. 4
      src/Entity/Browser/History/Container/Navbar/Delete.php
  12. 15
      src/Entity/Browser/History/Container/Navbar/Filter.php
  13. 4
      src/Entity/Browser/History/Container/Navbar/Open.php
  14. 6
      src/Entity/Browser/History/Header.php
  15. 9
      src/Entity/Browser/Menu.php
  16. 10
      src/Entity/Browser/Menu/File.php
  17. 23
      src/Entity/Browser/Menu/File/Open.php
  18. 20
      src/Entity/Browser/Menu/File/Save.php
  19. 11
      src/Entity/Browser/Menu/History.php
  20. 10
      src/Entity/Browser/Menu/Quit.php
  21. 10
      src/Entity/Browser/Menu/Tab.php
  22. 7
      src/Entity/Browser/Menu/Tab/Add.php

11
src/Entity/Browser.php

@ -4,6 +4,8 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity; namespace Yggverse\Yoda\Entity;
use \GtkWindow;
use \Yggverse\Yoda\Entity\Browser\Header; use \Yggverse\Yoda\Entity\Browser\Header;
use \Yggverse\Yoda\Entity\Browser\Container; use \Yggverse\Yoda\Entity\Browser\Container;
@ -11,7 +13,8 @@ use \Yggverse\Yoda\Model\Database;
class Browser class Browser
{ {
public \GtkWindow $gtk; // GTK
public GtkWindow $gtk;
// Dependencies // Dependencies
public Database $database; public Database $database;
@ -32,7 +35,7 @@ class Browser
$this->database = $database; $this->database = $database;
// Init window // Init window
$this->gtk = new \GtkWindow; $this->gtk = new GtkWindow;
$this->gtk->set_size_request( $this->gtk->set_size_request(
$this::WIDTH, $this::WIDTH,
@ -69,8 +72,8 @@ class Browser
$this->gtk->connect( $this->gtk->connect(
'configure-event', 'configure-event',
function( function(
\GtkWindow $window, GtkWindow $window,
// \GdkEvent $event // GdkEvent $event
) { ) {
// @TODO render data wordwrap by $window->get_size() // @TODO render data wordwrap by $window->get_size()
} }

10
src/Entity/Browser/Container.php

@ -4,11 +4,15 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser; namespace Yggverse\Yoda\Entity\Browser;
use \GtkBox;
use \GtkOrientation;
use \Yggverse\Yoda\Entity\Browser; use \Yggverse\Yoda\Entity\Browser;
class Container class Container
{ {
public \GtkBox $gtk; // GTK
public GtkBox $gtk;
// Dependencies // Dependencies
public Browser $browser; public Browser $browser;
@ -23,8 +27,8 @@ class Container
$this->browser = $browser; $this->browser = $browser;
// Init container // Init container
$this->gtk = new \GtkBox( $this->gtk = new GtkBox(
\GtkOrientation::VERTICAL GtkOrientation::VERTICAL
); );
// Init tab // Init tab

7
src/Entity/Browser/Header.php

@ -4,11 +4,14 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser; namespace Yggverse\Yoda\Entity\Browser;
use \GtkHeaderBar;
use \Yggverse\Yoda\Entity\Browser; use \Yggverse\Yoda\Entity\Browser;
class Header class Header
{ {
public \GtkHeaderBar $gtk; // GTK
public GtkHeaderBar $gtk;
// Dependencies // Dependencies
public Browser $browser; public Browser $browser;
@ -28,7 +31,7 @@ class Header
$this->browser = $browser; $this->browser = $browser;
// Init header // Init header
$this->gtk = new \GtkHeaderBar; $this->gtk = new GtkHeaderBar;
$this->gtk->set_show_close_button( $this->gtk->set_show_close_button(
$this::ACTIONS $this::ACTIONS

5
src/Entity/Browser/History.php

@ -4,10 +4,13 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser; namespace Yggverse\Yoda\Entity\Browser;
use \GtkWindow;
use \Yggverse\Yoda\Entity\Browser; use \Yggverse\Yoda\Entity\Browser;
class History class History
{ {
// GTK
public \GtkWindow $gtk; public \GtkWindow $gtk;
// Dependencies // Dependencies
@ -29,7 +32,7 @@ class History
$this->browser = $browser; $this->browser = $browser;
// Init window // Init window
$this->gtk = new \GtkWindow; $this->gtk = new GtkWindow;
$this->gtk->set_size_request( $this->gtk->set_size_request(
$this::WIDTH, $this::WIDTH,

10
src/Entity/Browser/History/Container.php

@ -4,11 +4,15 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\History; namespace Yggverse\Yoda\Entity\Browser\History;
use \GtkBox;
use \GtkOrientation;
use \Yggverse\Yoda\Entity\Browser\History; use \Yggverse\Yoda\Entity\Browser\History;
class Container class Container
{ {
public \GtkBox $gtk; // GTK
public GtkBox $gtk;
// Dependencies // Dependencies
public History $history; public History $history;
@ -24,8 +28,8 @@ class Container
$this->history = $history; $this->history = $history;
// Init container // Init container
$this->gtk = new \GtkBox( $this->gtk = new GtkBox(
\GtkOrientation::VERTICAL GtkOrientation::VERTICAL
); );
// Init navbar // Init navbar

7
src/Entity/Browser/History/Container/Content.php

@ -4,11 +4,14 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\History\Container; namespace Yggverse\Yoda\Entity\Browser\History\Container;
use \GtkScrolledWindow;
use \Yggverse\Yoda\Entity\Browser\History\Container; use \Yggverse\Yoda\Entity\Browser\History\Container;
class Content class Content
{ {
public \GtkScrolledWindow $gtk; // GTK
public GtkScrolledWindow $gtk;
// Dependencies // Dependencies
public Container $container; public Container $container;
@ -27,7 +30,7 @@ class Content
$this->container = $container; $this->container = $container;
// Init container // Init container
$this->gtk = new \GtkScrolledWindow; $this->gtk = new GtkScrolledWindow;
$this->gtk->set_margin_start( $this->gtk->set_margin_start(
$this::MARGIN $this::MARGIN

20
src/Entity/Browser/History/Container/Content/Table.php

@ -4,11 +4,15 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\History\Container\Content; namespace Yggverse\Yoda\Entity\Browser\History\Container\Content;
use \GtkCellRendererText;
use \GtkTreeView;
use \GtkTreeViewColumn;
use \Yggverse\Yoda\Entity\Browser\History\Container\Content; use \Yggverse\Yoda\Entity\Browser\History\Container\Content;
class Table class Table
{ {
public \GtkTreeView $gtk; public GtkTreeView $gtk;
// Dependencies // Dependencies
public Content $content; public Content $content;
@ -28,30 +32,30 @@ class Table
$this->content = $content; $this->content = $content;
// Init tree view // Init tree view
$this->gtk = new \GtkTreeView; $this->gtk = new GtkTreeView;
$this->gtk->append_column( $this->gtk->append_column(
new \GtkTreeViewColumn( new GtkTreeViewColumn(
$this::TIME, $this::TIME,
new \GtkCellRendererText(), new GtkCellRendererText(),
'text', 'text',
1 1
) )
); );
$this->gtk->append_column( $this->gtk->append_column(
new \GtkTreeViewColumn( new GtkTreeViewColumn(
$this::URL, $this::URL,
new \GtkCellRendererText(), new GtkCellRendererText(),
'text', 'text',
2 2
) )
); );
$this->gtk->append_column( $this->gtk->append_column(
new \GtkTreeViewColumn( new GtkTreeViewColumn(
$this::TITLE, $this::TITLE,
new \GtkCellRendererText(), new GtkCellRendererText(),
'text', 'text',
3 3
) )

15
src/Entity/Browser/History/Container/Content/Table/Data.php

@ -4,11 +4,14 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\History\Container\Content\Table; namespace Yggverse\Yoda\Entity\Browser\History\Container\Content\Table;
use \GObject;
use \GtkListStore;
use \Yggverse\Yoda\Entity\Browser\History\Container\Content\Table; use \Yggverse\Yoda\Entity\Browser\History\Container\Content\Table;
class Data class Data
{ {
public \GtkListStore $gtk; public GtkListStore $gtk;
// Dependencies // Dependencies
public Table $table; public Table $table;
@ -23,11 +26,11 @@ class Data
$this->table = $table; $this->table = $table;
// Init tree view // Init tree view
$this->gtk = new \GtkListStore( $this->gtk = new GtkListStore(
\GObject::TYPE_INT, GObject::TYPE_INT,
\GObject::TYPE_STRING, GObject::TYPE_STRING,
\GObject::TYPE_STRING, GObject::TYPE_STRING,
\GObject::TYPE_STRING GObject::TYPE_STRING
); );
} }

7
src/Entity/Browser/History/Container/Content/Viewport.php

@ -4,11 +4,14 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\History\Container\Content; namespace Yggverse\Yoda\Entity\Browser\History\Container\Content;
use \GtkViewport;
use \Yggverse\Yoda\Entity\Browser\History\Container\Content; use \Yggverse\Yoda\Entity\Browser\History\Container\Content;
class Viewport class Viewport
{ {
public \GtkViewport $gtk; // GTK
public GtkViewport $gtk;
// Dependencies // Dependencies
public Content $content; public Content $content;
@ -20,7 +23,7 @@ class Viewport
$this->content = $content; $this->content = $content;
// Init viewport // Init viewport
$this->gtk = new \GtkViewport; $this->gtk = new GtkViewport;
// Render // Render
$this->gtk->show(); $this->gtk->show();

9
src/Entity/Browser/History/Container/Navbar.php

@ -4,11 +4,14 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\History\Container; namespace Yggverse\Yoda\Entity\Browser\History\Container;
use \GtkBox;
use \GtkOrientation;
use \Yggverse\Yoda\Entity\Browser\History\Container; use \Yggverse\Yoda\Entity\Browser\History\Container;
class Navbar class Navbar
{ {
public \GtkBox $gtk; public GtkBox $gtk;
// Dependencies // Dependencies
public Container $container; public Container $container;
@ -30,8 +33,8 @@ class Navbar
$this->container = $container; $this->container = $container;
// Init container // Init container
$this->gtk = new \GtkBox( $this->gtk = new GtkBox(
\GtkOrientation::HORIZONTAL GtkOrientation::HORIZONTAL
); );
$this->gtk->set_margin_top( $this->gtk->set_margin_top(

4
src/Entity/Browser/History/Container/Navbar/Delete.php

@ -4,6 +4,8 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\History\Container\Navbar; namespace Yggverse\Yoda\Entity\Browser\History\Container\Navbar;
use \GtkButton;
use \Yggverse\Yoda\Abstract\Entity\Browser\History\Container\Navbar\Button; use \Yggverse\Yoda\Abstract\Entity\Browser\History\Container\Navbar\Button;
class Delete extends Button class Delete extends Button
@ -13,7 +15,7 @@ class Delete extends Button
public const TOOLTIP = 'Delete'; public const TOOLTIP = 'Delete';
protected function _onCLick( protected function _onCLick(
\GtkButton $entity GtkButton $entity
): void ): void
{ {
if ($id = $this->navbar->container->content->table->getSelectedId()) if ($id = $this->navbar->container->content->table->getSelectedId())

15
src/Entity/Browser/History/Container/Navbar/Filter.php

@ -4,6 +4,9 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\History\Container\Navbar; namespace Yggverse\Yoda\Entity\Browser\History\Container\Navbar;
use \GdkEvent;
use \GtkEntry;
use \Yggverse\Yoda\Abstract\Entity\Browser\History\Container\Navbar\Entry; use \Yggverse\Yoda\Abstract\Entity\Browser\History\Container\Navbar\Entry;
class Filter extends Entry class Filter extends Entry
@ -11,7 +14,7 @@ class Filter extends Entry
public const PLACEHOLDER = 'Search in history...'; public const PLACEHOLDER = 'Search in history...';
protected function _onActivate( protected function _onActivate(
\GtkEntry $entry GtkEntry $entry
): void ): void
{ {
$this->navbar->container->content->search( $this->navbar->container->content->search(
@ -20,8 +23,8 @@ class Filter extends Entry
} }
protected function _onKeyRelease( protected function _onKeyRelease(
\GtkEntry $entry, GtkEntry $entry,
\GdkEvent $event GdkEvent $event
): void ): void
{ {
$this->navbar->container->content->search( $this->navbar->container->content->search(
@ -30,13 +33,13 @@ class Filter extends Entry
} }
protected function _onChanged( protected function _onChanged(
\GtkEntry $entry GtkEntry $entry
): void ): void
{} {}
protected function _onFocusOut( protected function _onFocusOut(
\GtkEntry $entry, GtkEntry $entry,
\GdkEvent $event GdkEvent $event
): void ): void
{} {}
} }

4
src/Entity/Browser/History/Container/Navbar/Open.php

@ -4,6 +4,8 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\History\Container\Navbar; namespace Yggverse\Yoda\Entity\Browser\History\Container\Navbar;
use \GtkButton;
use \Yggverse\Yoda\Abstract\Entity\Browser\History\Container\Navbar\Button; use \Yggverse\Yoda\Abstract\Entity\Browser\History\Container\Navbar\Button;
class Open extends Button class Open extends Button
@ -13,7 +15,7 @@ class Open extends Button
public const TOOLTIP = 'Open'; public const TOOLTIP = 'Open';
protected function _onCLick( protected function _onCLick(
\GtkButton $entity GtkButton $entity
): void ): void
{ {
$this->navbar->container->history->browser->container->tab->append( $this->navbar->container->history->browser->container->tab->append(

6
src/Entity/Browser/History/Header.php

@ -4,9 +4,11 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\History; namespace Yggverse\Yoda\Entity\Browser\History;
use \GtkHeaderBar;
class Header class Header
{ {
public \GtkHeaderBar $gtk; public GtkHeaderBar $gtk;
public const ACTIONS = true; public const ACTIONS = true;
public const TITLE = 'History - Yoda'; public const TITLE = 'History - Yoda';
@ -14,7 +16,7 @@ class Header
public function __construct() public function __construct()
{ {
$this->gtk = new \GtkHeaderBar; $this->gtk = new GtkHeaderBar;
$this->gtk->set_show_close_button( $this->gtk->set_show_close_button(
$this::ACTIONS $this::ACTIONS

9
src/Entity/Browser/Menu.php

@ -4,11 +4,14 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser; namespace Yggverse\Yoda\Entity\Browser;
use \GtkMenu;
use \GtkSeparatorMenuItem;
use \Yggverse\Yoda\Entity\Browser; use \Yggverse\Yoda\Entity\Browser;
class Menu class Menu
{ {
public \GtkMenu $gtk; public GtkMenu $gtk;
// Dependencies // Dependencies
public Browser $browser; public Browser $browser;
@ -26,7 +29,7 @@ class Menu
$this->browser = $browser; $this->browser = $browser;
// Init menu // Init menu
$this->gtk = new \GtkMenu; $this->gtk = new GtkMenu;
// Init file menu item // Init file menu item
$this->file = new Menu\File( $this->file = new Menu\File(
@ -57,7 +60,7 @@ class Menu
// Add separator // Add separator
$this->gtk->append( $this->gtk->append(
new \GtkSeparatorMenuItem new GtkSeparatorMenuItem
); );
// Init quit menu item // Init quit menu item

10
src/Entity/Browser/Menu/File.php

@ -4,11 +4,15 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Menu; namespace Yggverse\Yoda\Entity\Browser\Menu;
use \GtkMenu;
use \GtkMenuItem;
use \Yggverse\Yoda\Entity\Browser\Menu; use \Yggverse\Yoda\Entity\Browser\Menu;
class File class File
{ {
public \GtkMenuItem $gtk; // GTK
public GtkMenuItem $gtk;
// Dependencies // Dependencies
public Menu $menu; public Menu $menu;
@ -23,12 +27,12 @@ class File
$this->menu = $menu; $this->menu = $menu;
// Init menu item // Init menu item
$this->gtk = \GtkMenuItem::new_with_label( $this->gtk = GtkMenuItem::new_with_label(
$this::LABEL $this::LABEL
); );
// Init submenu container // Init submenu container
$file = new \GtkMenu; $file = new GtkMenu;
// Init tab menu items // Init tab menu items
$open = new File\Open( $open = new File\Open(

23
src/Entity/Browser/Menu/File/Open.php

@ -4,11 +4,18 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Menu\File; namespace Yggverse\Yoda\Entity\Browser\Menu\File;
use \GtkFileChooserAction;
use \GtkFileChooserDialog;
use \GtkFileFilter;
use \GtkMenuItem;
use \GtkResponseType;
use \Yggverse\Yoda\Entity\Browser\Menu\File; use \Yggverse\Yoda\Entity\Browser\Menu\File;
class Open class Open
{ {
public \GtkMenuItem $gtk; // GTK
public GtkMenuItem $gtk;
// Dependencies // Dependencies
public File $file; public File $file;
@ -29,7 +36,7 @@ class Open
$this->file = $file; $this->file = $file;
// Init menu item // Init menu item
$this->gtk = \GtkMenuItem::new_with_label( $this->gtk = GtkMenuItem::new_with_label(
$this::LABEL $this::LABEL
); );
@ -41,15 +48,15 @@ class Open
'activate', 'activate',
function() function()
{ {
$dialog = new \GtkFileChooserDialog( $dialog = new GtkFileChooserDialog(
'Open file', 'Open file',
$this->file->menu->browser->gtk, $this->file->menu->browser->gtk,
\GtkFileChooserAction::OPEN, GtkFileChooserAction::OPEN,
[ [
'Cancel', 'Cancel',
\GtkResponseType::CANCEL, GtkResponseType::CANCEL,
'Open', 'Open',
\GtkResponseType::OK GtkResponseType::OK
] ]
); );
@ -66,7 +73,7 @@ class Open
foreach ($this::PATTERN as $pattern => $name) foreach ($this::PATTERN as $pattern => $name)
{ {
$filter = new \GtkFileFilter; $filter = new GtkFileFilter;
$filter->set_name( $filter->set_name(
$name ? $name : $pattern $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) foreach ($dialog->get_filenames() as $filename)
{ {

20
src/Entity/Browser/Menu/File/Save.php

@ -4,11 +4,17 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Menu\File; namespace Yggverse\Yoda\Entity\Browser\Menu\File;
use \GtkMenuItem;
use \GtkFileChooserDialog;
use \GtkFileChooserAction;
use \GtkResponseType;
use \Yggverse\Yoda\Entity\Browser\Menu\File; use \Yggverse\Yoda\Entity\Browser\Menu\File;
class Save class Save
{ {
public \GtkMenuItem $gtk; // GTK
public GtkMenuItem $gtk;
// Dependencies // Dependencies
public File $file; public File $file;
@ -23,7 +29,7 @@ class Save
$this->file = $file; $this->file = $file;
// Init menu item // Init menu item
$this->gtk = \GtkMenuItem::new_with_label( $this->gtk = GtkMenuItem::new_with_label(
$this::LABEL $this::LABEL
); );
@ -35,15 +41,15 @@ class Save
'activate', 'activate',
function() function()
{ {
$dialog = new \GtkFileChooserDialog( $dialog = new GtkFileChooserDialog(
'Save to file', 'Save to file',
$this->file->menu->browser->gtk, $this->file->menu->browser->gtk,
\GtkFileChooserAction::SAVE, GtkFileChooserAction::SAVE,
[ [
'Cancel', 'Cancel',
\GtkResponseType::CANCEL, GtkResponseType::CANCEL,
'Save', 'Save',
\GtkResponseType::APPLY GtkResponseType::APPLY
] ]
); );
@ -58,7 +64,7 @@ class Save
true true
); );
if (\GtkResponseType::APPLY == $dialog->run()) if (GtkResponseType::APPLY == $dialog->run())
{ {
if ($page = $this->file->menu->browser->container->tab->get()) if ($page = $this->file->menu->browser->container->tab->get())
{ {

11
src/Entity/Browser/Menu/History.php

@ -4,11 +4,16 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Menu; namespace Yggverse\Yoda\Entity\Browser\Menu;
use \GtkMenuItem;
use \Yggverse\Yoda\Entity\Browser\Menu; use \Yggverse\Yoda\Entity\Browser\Menu;
use \Yggverse\Yoda\Entity\Browser\History as Window;
class History class History
{ {
public \GtkMenuItem $gtk; // GTK
public GtkMenuItem $gtk;
// Dependencies // Dependencies
public Menu $menu; public Menu $menu;
@ -23,7 +28,7 @@ class History
$this->menu = $menu; $this->menu = $menu;
// Init menu item // Init menu item
$this->gtk = \GtkMenuItem::new_with_label( $this->gtk = GtkMenuItem::new_with_label(
$this::LABEL $this::LABEL
); );
@ -35,7 +40,7 @@ class History
'activate', 'activate',
function() function()
{ {
$history = new \Yggverse\Yoda\Entity\Browser\History( $history = new Window(
$this->menu->browser $this->menu->browser
); );
} }

10
src/Entity/Browser/Menu/Quit.php

@ -4,11 +4,15 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Menu; namespace Yggverse\Yoda\Entity\Browser\Menu;
use \Gtk;
use \GtkMenuItem;
use \Yggverse\Yoda\Entity\Browser\Menu; use \Yggverse\Yoda\Entity\Browser\Menu;
class Quit class Quit
{ {
public \GtkMenuItem $gtk; // GTK
public GtkMenuItem $gtk;
// Dependencies // Dependencies
public Menu $menu; public Menu $menu;
@ -23,7 +27,7 @@ class Quit
$this->menu = $menu; $this->menu = $menu;
// Init menu item // Init menu item
$this->gtk = \GtkMenuItem::new_with_label( $this->gtk = GtkMenuItem::new_with_label(
$this::LABEL $this::LABEL
); );
@ -35,7 +39,7 @@ class Quit
'activate', 'activate',
function() function()
{ {
\Gtk::main_quit(); Gtk::main_quit();
} }
); );
} }

10
src/Entity/Browser/Menu/Tab.php

@ -4,11 +4,15 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Menu; namespace Yggverse\Yoda\Entity\Browser\Menu;
use \GtkMenu;
use \GtkMenuItem;
use \Yggverse\Yoda\Entity\Browser\Menu; use \Yggverse\Yoda\Entity\Browser\Menu;
class Tab class Tab
{ {
public \GtkMenuItem $gtk; // GTK
public GtkMenuItem $gtk;
// Dependencies // Dependencies
public Menu $menu; public Menu $menu;
@ -27,12 +31,12 @@ class Tab
$this->menu = $menu; $this->menu = $menu;
// Init menu item // Init menu item
$this->gtk = \GtkMenuItem::new_with_label( $this->gtk = GtkMenuItem::new_with_label(
$this::LABEL $this::LABEL
); );
// Init submenu container // Init submenu container
$tab = new \GtkMenu; $tab = new GtkMenu;
// Init new tab menu item // Init new tab menu item
$this->add = new Tab\Add( $this->add = new Tab\Add(

7
src/Entity/Browser/Menu/Tab/Add.php

@ -4,11 +4,14 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Menu\Tab; namespace Yggverse\Yoda\Entity\Browser\Menu\Tab;
use \GtkMenuItem;
use \Yggverse\Yoda\Entity\Browser\Menu\Tab; use \Yggverse\Yoda\Entity\Browser\Menu\Tab;
class Add class Add
{ {
public \GtkMenuItem $gtk; // GTK
public GtkMenuItem $gtk;
// Dependencies // Dependencies
public Tab $tab; public Tab $tab;
@ -24,7 +27,7 @@ class Add
$this->tab = $tab; $this->tab = $tab;
// Init menu item // Init menu item
$this->gtk = \GtkMenuItem::new_with_label( $this->gtk = GtkMenuItem::new_with_label(
_($this::LABEL) _($this::LABEL)
); );

Loading…
Cancel
Save