mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
add debug menu item
This commit is contained in:
parent
7135d668c9
commit
a8cca0ed5b
3 changed files with 64 additions and 2 deletions
|
|
@ -17,11 +17,12 @@ class Menu
|
|||
public Browser $browser;
|
||||
|
||||
// Requirements
|
||||
public Menu\File $file;
|
||||
public Menu\Tab $tab;
|
||||
public Menu\Bookmark $bookmark;
|
||||
public Menu\Debug $debug;
|
||||
public Menu\File $file;
|
||||
public Menu\History $history;
|
||||
public Menu\Quit $quit;
|
||||
public Menu\Tab $tab;
|
||||
|
||||
public function __construct(
|
||||
Browser $browser
|
||||
|
|
@ -73,6 +74,15 @@ class Menu
|
|||
new GtkSeparatorMenuItem
|
||||
);
|
||||
|
||||
// Init debug menu item
|
||||
$this->debug = new Menu\Debug(
|
||||
$this
|
||||
);
|
||||
|
||||
$this->gtk->append(
|
||||
$this->debug->gtk
|
||||
);
|
||||
|
||||
// Init quit menu item
|
||||
$this->quit = new Menu\Quit(
|
||||
$this
|
||||
|
|
|
|||
47
src/Entity/Browser/Menu/Debug.php
Normal file
47
src/Entity/Browser/Menu/Debug.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
use \GtkMenuItem;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
class Debug
|
||||
{
|
||||
// GTK
|
||||
public GtkMenuItem $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Menu $menu;
|
||||
|
||||
// Defaults
|
||||
public const LABEL = 'Debug';
|
||||
|
||||
public function __construct(
|
||||
Menu $menu
|
||||
) {
|
||||
// Init dependencies
|
||||
$this->menu = $menu;
|
||||
|
||||
// Init menu item
|
||||
$this->gtk = GtkMenuItem::new_with_label(
|
||||
$this::LABEL
|
||||
);
|
||||
|
||||
// Render
|
||||
$this->gtk->show();
|
||||
|
||||
// Int events
|
||||
$this->gtk->connect(
|
||||
'activate',
|
||||
function()
|
||||
{
|
||||
$this->menu->browser->gtk->set_interactive_debugging(
|
||||
true
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue