Browse Source

change menu namespace

PHP-GTK3
yggverse 5 months ago
parent
commit
445b6c06fc
  1. 2
      src/Entity/Browser/Header.php
  2. 6
      src/Entity/Browser/Header/Navigation.php
  3. 16
      src/Entity/Browser/Menu.php
  4. 8
      src/Entity/Browser/Menu/History.php
  5. 6
      src/Entity/Browser/Menu/Quit.php

2
src/Entity/Browser/Header.php

@ -42,7 +42,7 @@ class Header
$this->_subtitle $this->_subtitle
); );
// Init navigation element // Init navigation
$this->navigation = new Navigation( $this->navigation = new Navigation(
$this $this
); );

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

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Header; namespace Yggverse\Yoda\Entity\Browser\Header;
use \Yggverse\Yoda\Entity\Browser\Header\Navigation\Menu; use \Yggverse\Yoda\Entity\Browser\Menu;
class Navigation class Navigation
{ {
@ -14,7 +14,7 @@ class Navigation
public \Yggverse\Yoda\Entity\Browser\Header $header; public \Yggverse\Yoda\Entity\Browser\Header $header;
// Requirements // Requirements
public \Yggverse\Yoda\Entity\Browser\Header\Navigation\Menu $menu; public \Yggverse\Yoda\Entity\Browser\Menu $menu;
public function __construct( public function __construct(
\Yggverse\Yoda\Entity\Browser\Header $header \Yggverse\Yoda\Entity\Browser\Header $header
@ -27,7 +27,7 @@ class Navigation
// Init menu // Init menu
$this->menu = new Menu( $this->menu = new Menu(
$this $this->header->browser
); );
$this->gtk->set_popup( $this->gtk->set_popup(

16
src/Entity/Browser/Header/Navigation/Menu.php → src/Entity/Browser/Menu.php

@ -2,27 +2,27 @@
declare(strict_types=1); declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Header\Navigation; namespace Yggverse\Yoda\Entity\Browser;
use \Yggverse\Yoda\Entity\Browser\Header\Navigation\Menu\History; use \Yggverse\Yoda\Entity\Browser\Menu\History;
use \Yggverse\Yoda\Entity\Browser\Header\Navigation\Menu\Quit; use \Yggverse\Yoda\Entity\Browser\Menu\Quit;
class Menu class Menu
{ {
public \GtkMenu $gtk; public \GtkMenu $gtk;
// Dependencies // Dependencies
public \Yggverse\Yoda\Entity\Browser\Header\Navigation $navigation; public \Yggverse\Yoda\Entity\Browser $browser;
// Requirements // Requirements
public \Yggverse\Yoda\Entity\Browser\Header\Navigation\Menu\History $history; public \Yggverse\Yoda\Entity\Browser\Menu\History $history;
public \Yggverse\Yoda\Entity\Browser\Header\Navigation\Menu\Quit $quit; public \Yggverse\Yoda\Entity\Browser\Menu\Quit $quit;
public function __construct( public function __construct(
\Yggverse\Yoda\Entity\Browser\Header\Navigation $navigation \Yggverse\Yoda\Entity\Browser $browser
) { ) {
// Init dependencies // Init dependencies
$this->navigation = $navigation; $this->browser = $browser;
// Init menu // Init menu
$this->gtk = new \GtkMenu; $this->gtk = new \GtkMenu;

8
src/Entity/Browser/Header/Navigation/Menu/History.php → src/Entity/Browser/Menu/History.php

@ -2,20 +2,20 @@
declare(strict_types=1); declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Header\Navigation\Menu; namespace Yggverse\Yoda\Entity\Browser\Menu;
class History class History
{ {
public \GtkMenuItem $gtk; public \GtkMenuItem $gtk;
// Dependencies // Dependencies
public \Yggverse\Yoda\Entity\Browser\Header\Navigation\Menu $menu; public \Yggverse\Yoda\Entity\Browser\Menu $menu;
// Defaults // Defaults
private string $_label = 'History'; private string $_label = 'History';
public function __construct( public function __construct(
\Yggverse\Yoda\Entity\Browser\Header\Navigation\Menu $menu \Yggverse\Yoda\Entity\Browser\Menu $menu
) { ) {
// Init dependencies // Init dependencies
$this->menu = $menu; $this->menu = $menu;
@ -31,7 +31,7 @@ class History
function() function()
{ {
$history = new \Yggverse\Yoda\Entity\Browser\History( $history = new \Yggverse\Yoda\Entity\Browser\History(
$this->menu->navigation->header->browser $this->menu->browser
); );
$history->gtk->show_all(); $history->gtk->show_all();

6
src/Entity/Browser/Header/Navigation/Menu/Quit.php → src/Entity/Browser/Menu/Quit.php

@ -2,20 +2,20 @@
declare(strict_types=1); declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Header\Navigation\Menu; namespace Yggverse\Yoda\Entity\Browser\Menu;
class Quit class Quit
{ {
public \GtkMenuItem $gtk; public \GtkMenuItem $gtk;
// Dependencies // Dependencies
public \Yggverse\Yoda\Entity\Browser\Header\Navigation\Menu $menu; public \Yggverse\Yoda\Entity\Browser\Menu $menu;
// Defaults // Defaults
private string $_label = 'Quit'; private string $_label = 'Quit';
public function __construct( public function __construct(
\Yggverse\Yoda\Entity\Browser\Header\Navigation\Menu $menu \Yggverse\Yoda\Entity\Browser\Menu $menu
) { ) {
// Init dependencies // Init dependencies
$this->menu = $menu; $this->menu = $menu;
Loading…
Cancel
Save