mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
add debug menu item
This commit is contained in:
parent
7135d668c9
commit
a8cca0ed5b
3 changed files with 64 additions and 2 deletions
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