Browse Source

add tab tooltips

PHP-GTK3
yggverse 4 months ago
parent
commit
55763a643d
  1. 26
      src/Entity/Browser/Container/Page/Title.php

26
src/Entity/Browser/Container/Page/Title.php

@ -18,6 +18,7 @@ class Title @@ -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 @@ -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 @@ -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 @@ -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 @@ -77,4 +96,9 @@ class Title
{
return $this->gtk->get_subtitle();
}
public function getTooltip(): ?string
{
return $this->gtk->get_tooltip();
}
}
Loading…
Cancel
Save