mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
remove HeaderBar abstraction
This commit is contained in:
parent
950304af3f
commit
c5b62addd4
3 changed files with 74 additions and 48 deletions
|
|
@ -1,46 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Yggverse\Yoda\Abstract\Entity;
|
|
||||||
|
|
||||||
abstract class HeaderBar
|
|
||||||
{
|
|
||||||
public \GtkHeaderBar $gtk;
|
|
||||||
|
|
||||||
protected bool $_actions = true;
|
|
||||||
protected string $_title = 'Yoda';
|
|
||||||
protected string $_subtitle = '';
|
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
$this->gtk = new \GtkHeaderBar;
|
|
||||||
|
|
||||||
$this->gtk->set_show_close_button(
|
|
||||||
$this->_actions
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->gtk->set_title(
|
|
||||||
$this->_title
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->gtk->set_subtitle(
|
|
||||||
$this->_subtitle
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setTitle(
|
|
||||||
?string $title = null
|
|
||||||
): void
|
|
||||||
{
|
|
||||||
$this->gtk->set_title(
|
|
||||||
is_null($title) ? $this->_title : sprintf(
|
|
||||||
'%s - %s',
|
|
||||||
trim(
|
|
||||||
$title
|
|
||||||
),
|
|
||||||
$this->_title
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -4,7 +4,43 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Yggverse\Yoda\Entity\Browser;
|
namespace Yggverse\Yoda\Entity\Browser;
|
||||||
|
|
||||||
class Header extends \Yggverse\Yoda\Abstract\Entity\HeaderBar
|
class Header
|
||||||
{
|
{
|
||||||
|
public \GtkHeaderBar $gtk;
|
||||||
|
|
||||||
|
protected bool $_actions = true;
|
||||||
protected string $_title = 'Yoda';
|
protected string $_title = 'Yoda';
|
||||||
|
protected string $_subtitle = '';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->gtk = new \GtkHeaderBar;
|
||||||
|
|
||||||
|
$this->gtk->set_show_close_button(
|
||||||
|
$this->_actions
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->gtk->set_title(
|
||||||
|
$this->_title
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->gtk->set_subtitle(
|
||||||
|
$this->_subtitle
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setTitle(
|
||||||
|
?string $title = null
|
||||||
|
): void
|
||||||
|
{
|
||||||
|
$this->gtk->set_title(
|
||||||
|
is_null($title) ? $this->_title : sprintf(
|
||||||
|
'%s - %s',
|
||||||
|
trim(
|
||||||
|
$title
|
||||||
|
),
|
||||||
|
$this->_title
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,7 +4,43 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Yggverse\Yoda\Entity\Browser\History;
|
namespace Yggverse\Yoda\Entity\Browser\History;
|
||||||
|
|
||||||
class Header extends \Yggverse\Yoda\Abstract\Entity\HeaderBar
|
class Header
|
||||||
{
|
{
|
||||||
|
public \GtkHeaderBar $gtk;
|
||||||
|
|
||||||
|
protected bool $_actions = true;
|
||||||
protected string $_title = 'History - Yoda';
|
protected string $_title = 'History - Yoda';
|
||||||
|
protected string $_subtitle = '';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->gtk = new \GtkHeaderBar;
|
||||||
|
|
||||||
|
$this->gtk->set_show_close_button(
|
||||||
|
$this->_actions
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->gtk->set_title(
|
||||||
|
$this->_title
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->gtk->set_subtitle(
|
||||||
|
$this->_subtitle
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setTitle(
|
||||||
|
?string $title = null
|
||||||
|
): void
|
||||||
|
{
|
||||||
|
$this->gtk->set_title(
|
||||||
|
is_null($title) ? $this->_title : sprintf(
|
||||||
|
'%s - %s',
|
||||||
|
trim(
|
||||||
|
$title
|
||||||
|
),
|
||||||
|
$this->_title
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue