mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-03 01:55:27 +00:00
use tool parent menu for debug item
This commit is contained in:
parent
cb4c86bdac
commit
f124f20660
4 changed files with 73 additions and 15 deletions
|
|
@ -18,12 +18,12 @@ class Menu
|
||||||
|
|
||||||
// Requirements
|
// Requirements
|
||||||
public Menu\Bookmark $bookmark;
|
public Menu\Bookmark $bookmark;
|
||||||
public Menu\Debug $debug;
|
|
||||||
public Menu\File $file;
|
public Menu\File $file;
|
||||||
public Menu\Help $help;
|
public Menu\Help $help;
|
||||||
public Menu\History $history;
|
public Menu\History $history;
|
||||||
public Menu\Quit $quit;
|
public Menu\Quit $quit;
|
||||||
public Menu\Tab $tab;
|
public Menu\Tab $tab;
|
||||||
|
public Menu\Tool $tool;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Browser $browser
|
Browser $browser
|
||||||
|
|
@ -70,13 +70,13 @@ class Menu
|
||||||
$this->history->gtk
|
$this->history->gtk
|
||||||
);
|
);
|
||||||
|
|
||||||
// Init debug menu item
|
// Init tool menu item
|
||||||
$this->debug = new Menu\Debug(
|
$this->tool = new Menu\Tool(
|
||||||
$this
|
$this
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->gtk->append(
|
$this->gtk->append(
|
||||||
$this->debug->gtk
|
$this->tool->gtk
|
||||||
);
|
);
|
||||||
|
|
||||||
// Init help menu item
|
// Init help menu item
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ class Help
|
||||||
|
|
||||||
// Requirements
|
// Requirements
|
||||||
public Help\About $about;
|
public Help\About $about;
|
||||||
|
public Help\Debug $debug;
|
||||||
public Help\Gemlog $gemlog;
|
public Help\Gemlog $gemlog;
|
||||||
public Help\Issue $issue;
|
public Help\Issue $issue;
|
||||||
|
|
||||||
|
|
@ -37,14 +38,14 @@ class Help
|
||||||
);
|
);
|
||||||
|
|
||||||
// Init submenu container
|
// Init submenu container
|
||||||
$tab = new GtkMenu;
|
$help = new GtkMenu;
|
||||||
|
|
||||||
// Init about menu item
|
// Init about menu item
|
||||||
$this->about = new Help\About(
|
$this->about = new Help\About(
|
||||||
$this
|
$this
|
||||||
);
|
);
|
||||||
|
|
||||||
$tab->append(
|
$help->append(
|
||||||
$this->about->gtk
|
$this->about->gtk
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -53,7 +54,7 @@ class Help
|
||||||
$this
|
$this
|
||||||
);
|
);
|
||||||
|
|
||||||
$tab->append(
|
$help->append(
|
||||||
$this->gemlog->gtk
|
$this->gemlog->gtk
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -62,12 +63,13 @@ class Help
|
||||||
$this
|
$this
|
||||||
);
|
);
|
||||||
|
|
||||||
$tab->append(
|
$help->append(
|
||||||
$this->issue->gtk
|
$this->issue->gtk
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Set submenu
|
||||||
$this->gtk->set_submenu(
|
$this->gtk->set_submenu(
|
||||||
$tab
|
$help
|
||||||
);
|
);
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
|
|
|
||||||
56
src/Entity/Browser/Menu/Tool.php
Normal file
56
src/Entity/Browser/Menu/Tool.php
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Yggverse\Yoda\Entity\Browser\Menu;
|
||||||
|
|
||||||
|
use \GtkMenu;
|
||||||
|
use \GtkMenuItem;
|
||||||
|
|
||||||
|
use \Yggverse\Yoda\Entity\Browser\Menu;
|
||||||
|
|
||||||
|
class Tool
|
||||||
|
{
|
||||||
|
// GTK
|
||||||
|
public GtkMenuItem $gtk;
|
||||||
|
|
||||||
|
// Dependencies
|
||||||
|
public Menu $menu;
|
||||||
|
|
||||||
|
// Requirements
|
||||||
|
public Tool\Debug $debug;
|
||||||
|
|
||||||
|
// Defaults
|
||||||
|
public const LABEL = 'Tool';
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
Menu $menu
|
||||||
|
) {
|
||||||
|
// Init dependencies
|
||||||
|
$this->menu = $menu;
|
||||||
|
|
||||||
|
// Init menu item
|
||||||
|
$this->gtk = GtkMenuItem::new_with_label(
|
||||||
|
$this::LABEL
|
||||||
|
);
|
||||||
|
|
||||||
|
// Init submenu container
|
||||||
|
$tool = new GtkMenu;
|
||||||
|
|
||||||
|
// Init debug menu item
|
||||||
|
$this->debug = new Tool\Debug(
|
||||||
|
$this
|
||||||
|
);
|
||||||
|
|
||||||
|
$tool->append(
|
||||||
|
$this->debug->gtk
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->gtk->set_submenu(
|
||||||
|
$tool
|
||||||
|
);
|
||||||
|
|
||||||
|
// Render
|
||||||
|
$this->gtk->show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Yggverse\Yoda\Entity\Browser\Menu;
|
namespace Yggverse\Yoda\Entity\Browser\Menu\Tool;
|
||||||
|
|
||||||
use \GtkMenuItem;
|
use \GtkMenuItem;
|
||||||
|
|
||||||
use \Yggverse\Yoda\Entity\Browser\Menu;
|
use \Yggverse\Yoda\Entity\Browser\Menu\Tool;
|
||||||
|
|
||||||
class Debug
|
class Debug
|
||||||
{
|
{
|
||||||
|
|
@ -14,16 +14,16 @@ class Debug
|
||||||
public GtkMenuItem $gtk;
|
public GtkMenuItem $gtk;
|
||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
public Menu $menu;
|
public Tool $tool;
|
||||||
|
|
||||||
// Defaults
|
// Defaults
|
||||||
public const LABEL = 'Debug';
|
public const LABEL = 'Debug';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Menu $menu
|
Tool $tool
|
||||||
) {
|
) {
|
||||||
// Init dependencies
|
// Init dependencies
|
||||||
$this->menu = $menu;
|
$this->tool = $tool;
|
||||||
|
|
||||||
// Init menu item
|
// Init menu item
|
||||||
$this->gtk = GtkMenuItem::new_with_label(
|
$this->gtk = GtkMenuItem::new_with_label(
|
||||||
|
|
@ -38,7 +38,7 @@ class Debug
|
||||||
'activate',
|
'activate',
|
||||||
function()
|
function()
|
||||||
{
|
{
|
||||||
$this->menu->browser->gtk->set_interactive_debugging(
|
$this->tool->menu->browser->gtk->set_interactive_debugging(
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue