mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
change menu namespace
This commit is contained in:
parent
006f039282
commit
445b6c06fc
5 changed files with 19 additions and 19 deletions
41
src/Entity/Browser/Menu/History.php
Normal file
41
src/Entity/Browser/Menu/History.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
class History
|
||||
{
|
||||
public \GtkMenuItem $gtk;
|
||||
|
||||
// Dependencies
|
||||
public \Yggverse\Yoda\Entity\Browser\Menu $menu;
|
||||
|
||||
// Defaults
|
||||
private string $_label = 'History';
|
||||
|
||||
public function __construct(
|
||||
\Yggverse\Yoda\Entity\Browser\Menu $menu
|
||||
) {
|
||||
// Init dependencies
|
||||
$this->menu = $menu;
|
||||
|
||||
// Init menu item
|
||||
$this->gtk = \GtkMenuItem::new_with_label(
|
||||
$this->_label
|
||||
);
|
||||
|
||||
// Int events
|
||||
$this->gtk->connect(
|
||||
'activate',
|
||||
function()
|
||||
{
|
||||
$history = new \Yggverse\Yoda\Entity\Browser\History(
|
||||
$this->menu->browser
|
||||
);
|
||||
|
||||
$history->gtk->show_all();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
37
src/Entity/Browser/Menu/Quit.php
Normal file
37
src/Entity/Browser/Menu/Quit.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
class Quit
|
||||
{
|
||||
public \GtkMenuItem $gtk;
|
||||
|
||||
// Dependencies
|
||||
public \Yggverse\Yoda\Entity\Browser\Menu $menu;
|
||||
|
||||
// Defaults
|
||||
private string $_label = 'Quit';
|
||||
|
||||
public function __construct(
|
||||
\Yggverse\Yoda\Entity\Browser\Menu $menu
|
||||
) {
|
||||
// Init dependencies
|
||||
$this->menu = $menu;
|
||||
|
||||
// Init menu item
|
||||
$this->gtk = \GtkMenuItem::new_with_label(
|
||||
$this->_label
|
||||
);
|
||||
|
||||
// Int events
|
||||
$this->gtk->connect(
|
||||
'activate',
|
||||
function()
|
||||
{
|
||||
\Gtk::main_quit();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue