use tray container for header elements

This commit is contained in:
yggverse 2024-07-20 14:54:59 +03:00
parent 5edba96a3c
commit c1a9f9aecf
4 changed files with 85 additions and 30 deletions

View file

@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Header\Tray;
use \Yggverse\Yoda\Entity\Browser\Header\Tray;
use \Yggverse\Yoda\Entity\Browser\Menu;
class Navigation
{
public \GtkMenuButton $gtk;
// Dependencies
public Tray $tray;
// Requirements
public Menu $menu;
// Defaults
private string $_tooltip = 'Navigation';
public function __construct(
Tray $tray
) {
// Init dependencies
$this->tray = $tray;
// Init navigation container
$this->gtk = new \GtkMenuButton;
$this->gtk->set_tooltip_text(
_($this->_tooltip)
);
// Init menu
$this->menu = new Menu(
$this->tray->header->browser
);
$this->gtk->set_popup(
$this->menu->gtk
);
// Render
$this->gtk->show();
}
}