mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
implement bookmarks browser
This commit is contained in:
parent
107718022d
commit
49ec6ee23d
16 changed files with 840 additions and 1 deletions
49
src/Entity/Browser/Menu/Bookmark.php
Normal file
49
src/Entity/Browser/Menu/Bookmark.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
use \GtkMenuItem;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\Menu;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\Bookmark as Window;
|
||||
|
||||
class Bookmark
|
||||
{
|
||||
// GTK
|
||||
public GtkMenuItem $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Menu $menu;
|
||||
|
||||
// Defaults
|
||||
public const LABEL = 'Bookmarks';
|
||||
|
||||
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()
|
||||
{
|
||||
new Window(
|
||||
$this->menu->browser
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -40,7 +40,7 @@ class History
|
|||
'activate',
|
||||
function()
|
||||
{
|
||||
$history = new Window(
|
||||
new Window(
|
||||
$this->menu->browser
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue