diff --git a/src/Entity/Browser/Menu.php b/src/Entity/Browser/Menu.php index 93070893..ecccad61 100644 --- a/src/Entity/Browser/Menu.php +++ b/src/Entity/Browser/Menu.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Yggverse\Yoda\Entity\Browser; +use \Yggverse\Yoda\Entity\Browser\Menu\Tab; use \Yggverse\Yoda\Entity\Browser\Menu\History; use \Yggverse\Yoda\Entity\Browser\Menu\Quit; @@ -15,6 +16,7 @@ class Menu public \Yggverse\Yoda\Entity\Browser $browser; // Requirements + public \Yggverse\Yoda\Entity\Browser\Menu\Tab $tab; public \Yggverse\Yoda\Entity\Browser\Menu\History $history; public \Yggverse\Yoda\Entity\Browser\Menu\Quit $quit; @@ -27,7 +29,16 @@ class Menu // Init menu $this->gtk = new \GtkMenu; - // Init history + // Init tab menu item + $this->tab = new Tab( + $this + ); + + $this->gtk->append( + $this->tab->gtk + ); + + // Init history menu item $this->history = new History( $this ); @@ -36,7 +47,12 @@ class Menu $this->history->gtk ); - // Init quit + // Add separator + $this->gtk->append( + new \GtkSeparatorMenuItem + ); + + // Init quit menu item $this->quit = new Quit( $this ); diff --git a/src/Entity/Browser/Menu/Tab.php b/src/Entity/Browser/Menu/Tab.php new file mode 100644 index 00000000..7df229bb --- /dev/null +++ b/src/Entity/Browser/Menu/Tab.php @@ -0,0 +1,60 @@ +menu = $menu; + + // Init menu item + $this->gtk = \GtkMenuItem::new_with_label( + $this->_label + ); + + // Init submenu container + $tab = new \GtkMenu; + + // Init new tab menu item + $this->add = new Add( + $this + ); + + $tab->append( + $this->add->gtk + ); + + // Init close tab menu item + $this->close = new Close( + $this + ); + + $tab->append( + $this->close->gtk + ); + + $this->gtk->set_submenu( + $tab + ); + } +} \ No newline at end of file diff --git a/src/Entity/Browser/Menu/Tab/Add.php b/src/Entity/Browser/Menu/Tab/Add.php new file mode 100644 index 00000000..0a6e7a14 --- /dev/null +++ b/src/Entity/Browser/Menu/Tab/Add.php @@ -0,0 +1,37 @@ +tab = $tab; + + // Init menu item + $this->gtk = \GtkMenuItem::new_with_label( + $this->_label + ); + + // Int events + $this->gtk->connect( + 'activate', + function() + { + // @TODO + } + ); + } +} \ No newline at end of file diff --git a/src/Entity/Browser/Menu/Tab/Close.php b/src/Entity/Browser/Menu/Tab/Close.php new file mode 100644 index 00000000..2fffb9a6 --- /dev/null +++ b/src/Entity/Browser/Menu/Tab/Close.php @@ -0,0 +1,37 @@ +tab = $tab; + + // Init menu item + $this->gtk = \GtkMenuItem::new_with_label( + $this->_label + ); + + // Int events + $this->gtk->connect( + 'activate', + function() + { + // @TODO + } + ); + } +} \ No newline at end of file