mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
use tray container for header elements
This commit is contained in:
parent
5edba96a3c
commit
c1a9f9aecf
4 changed files with 85 additions and 30 deletions
48
src/Entity/Browser/Header/Tray/Navigation.php
Normal file
48
src/Entity/Browser/Header/Tray/Navigation.php
Normal 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();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue