mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
implement new tab button
This commit is contained in:
parent
5559b236fe
commit
b9ca9616ff
2 changed files with 60 additions and 1 deletions
48
src/Entity/Browser/Header/Tab.php
Normal file
48
src/Entity/Browser/Header/Tab.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Header;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\Header;
|
||||
|
||||
class Tab
|
||||
{
|
||||
public \GtkButton $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Header $header;
|
||||
|
||||
// Defaults
|
||||
protected string $_label = '+';
|
||||
|
||||
public function __construct(
|
||||
Header $header
|
||||
) {
|
||||
// Init dependency
|
||||
$this->header = $header;
|
||||
|
||||
// Init GTK
|
||||
$this->gtk = new \GtkButton;
|
||||
|
||||
$this->gtk->set_label(
|
||||
$this->_label
|
||||
);
|
||||
|
||||
// Render
|
||||
$this->gtk->show();
|
||||
|
||||
// Init events
|
||||
$this->gtk->connect(
|
||||
'clicked',
|
||||
function(
|
||||
\GtkButton $entity
|
||||
) {
|
||||
$this->header->browser->container->tab->append(
|
||||
null,
|
||||
false
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue