mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-13 06:01:21 +00:00
remove HeaderBar abstraction
This commit is contained in:
parent
950304af3f
commit
c5b62addd4
@ -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;
|
||||
|
||||
class Header extends \Yggverse\Yoda\Abstract\Entity\HeaderBar
|
||||
class Header
|
||||
{
|
||||
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\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 $_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…
x
Reference in New Issue
Block a user