mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +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
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();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue