add tab tooltips

This commit is contained in:
yggverse 2024-07-09 08:38:06 +03:00
parent 6cc1f1285d
commit 55763a643d

View file

@ -18,6 +18,7 @@ class Title
private int $_length = 16;
private ?string $_value = 'New page';
private ?string $_subtitle = null;
private ?string $_tooltip = null;
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Page $page,
@ -41,7 +42,8 @@ class Title
public function setValue(
?string $value = null,
?string $subtitle = null
?string $subtitle = null,
?string $tooltip = null,
): void
{
$this->gtk->set_text(
@ -50,6 +52,12 @@ class Title
)
);
$this->gtk->set_tooltip_text(
is_null($tooltip) ? $value : trim(
$tooltip
)
);
$this->setSubtitle(
$subtitle
);
@ -68,6 +76,17 @@ class Title
);
}
public function setTooltip(
?string $tooltip = null
): void
{
$this->gtk->set_subtitle(
is_null($tooltip) ? $this->_tooltip : trim(
$tooltip
)
);
}
public function getValue(): ?string
{
return $this->gtk->get_text();
@ -77,4 +96,9 @@ class Title
{
return $this->gtk->get_subtitle();
}
public function getTooltip(): ?string
{
return $this->gtk->get_tooltip();
}
}