diff --git a/src/Entity/Browser/Menu.php b/src/Entity/Browser/Menu.php index e54c7998..97693dbb 100644 --- a/src/Entity/Browser/Menu.php +++ b/src/Entity/Browser/Menu.php @@ -20,6 +20,7 @@ class Menu public Menu\Bookmark $bookmark; public Menu\Debug $debug; public Menu\File $file; + public Menu\Help $help; public Menu\History $history; public Menu\Quit $quit; public Menu\Tab $tab; @@ -69,11 +70,6 @@ class Menu $this->history->gtk ); - // Add separator - $this->gtk->append( - new GtkSeparatorMenuItem - ); - // Init debug menu item $this->debug = new Menu\Debug( $this @@ -83,6 +79,20 @@ class Menu $this->debug->gtk ); + // Init help menu item + $this->help = new Menu\Help( + $this + ); + + $this->gtk->append( + $this->help->gtk + ); + + // Add separator + $this->gtk->append( + new GtkSeparatorMenuItem + ); + // Init quit menu item $this->quit = new Menu\Quit( $this diff --git a/src/Entity/Browser/Menu/Help.php b/src/Entity/Browser/Menu/Help.php new file mode 100644 index 00000000..60ceea06 --- /dev/null +++ b/src/Entity/Browser/Menu/Help.php @@ -0,0 +1,76 @@ +menu = $menu; + + // Init menu item + $this->gtk = GtkMenuItem::new_with_label( + $this::LABEL + ); + + // Init submenu container + $tab = new GtkMenu; + + // Init about menu item + $this->about = new Help\About( + $this + ); + + $tab->append( + $this->about->gtk + ); + + // Init gemlog menu item + $this->gemlog = new Help\Gemlog( + $this + ); + + $tab->append( + $this->gemlog->gtk + ); + + // Init issue menu item + $this->issue = new Help\Issue( + $this + ); + + $tab->append( + $this->issue->gtk + ); + + $this->gtk->set_submenu( + $tab + ); + + // Render + $this->gtk->show(); + } +} \ No newline at end of file diff --git a/src/Entity/Browser/Menu/Help/About.php b/src/Entity/Browser/Menu/Help/About.php new file mode 100644 index 00000000..94fc3d1a --- /dev/null +++ b/src/Entity/Browser/Menu/Help/About.php @@ -0,0 +1,46 @@ +help = $help; + + // Init menu item + $this->gtk = GtkMenuItem::new_with_label( + $this::LABEL + ); + + // Render + $this->gtk->show(); + + // Int events + $this->gtk->connect( + 'activate', + function() + { + // @TODO + } + ); + } +} \ No newline at end of file diff --git a/src/Entity/Browser/Menu/Help/Gemlog.php b/src/Entity/Browser/Menu/Help/Gemlog.php new file mode 100644 index 00000000..90e3f40f --- /dev/null +++ b/src/Entity/Browser/Menu/Help/Gemlog.php @@ -0,0 +1,49 @@ +help = $help; + + // Init menu item + $this->gtk = GtkMenuItem::new_with_label( + $this::LABEL + ); + + // Render + $this->gtk->show(); + + // Int events + $this->gtk->connect( + 'activate', + function() + { + $this->help->menu->browser->container->tab->append( + self::URL + ); + } + ); + } +} \ No newline at end of file diff --git a/src/Entity/Browser/Menu/Help/Issue.php b/src/Entity/Browser/Menu/Help/Issue.php new file mode 100644 index 00000000..3d2702df --- /dev/null +++ b/src/Entity/Browser/Menu/Help/Issue.php @@ -0,0 +1,47 @@ +help = $help; + + // Init menu item + $this->gtk = GtkMenuItem::new_with_label( + $this::LABEL + ); + + // Render + $this->gtk->show(); + + // Int events + $this->gtk->connect( + 'activate', + function() + { + // @TODO self::URL + } + ); + } +} \ No newline at end of file