mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
add tab tooltips
This commit is contained in:
parent
6cc1f1285d
commit
55763a643d
1 changed files with 25 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ class Title
|
||||||
private int $_length = 16;
|
private int $_length = 16;
|
||||||
private ?string $_value = 'New page';
|
private ?string $_value = 'New page';
|
||||||
private ?string $_subtitle = null;
|
private ?string $_subtitle = null;
|
||||||
|
private ?string $_tooltip = null;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
\Yggverse\Yoda\Entity\Browser\Container\Page $page,
|
\Yggverse\Yoda\Entity\Browser\Container\Page $page,
|
||||||
|
|
@ -41,7 +42,8 @@ class Title
|
||||||
|
|
||||||
public function setValue(
|
public function setValue(
|
||||||
?string $value = null,
|
?string $value = null,
|
||||||
?string $subtitle = null
|
?string $subtitle = null,
|
||||||
|
?string $tooltip = null,
|
||||||
): void
|
): void
|
||||||
{
|
{
|
||||||
$this->gtk->set_text(
|
$this->gtk->set_text(
|
||||||
|
|
@ -50,6 +52,12 @@ class Title
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->gtk->set_tooltip_text(
|
||||||
|
is_null($tooltip) ? $value : trim(
|
||||||
|
$tooltip
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
$this->setSubtitle(
|
$this->setSubtitle(
|
||||||
$subtitle
|
$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
|
public function getValue(): ?string
|
||||||
{
|
{
|
||||||
return $this->gtk->get_text();
|
return $this->gtk->get_text();
|
||||||
|
|
@ -77,4 +96,9 @@ class Title
|
||||||
{
|
{
|
||||||
return $this->gtk->get_subtitle();
|
return $this->gtk->get_subtitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getTooltip(): ?string
|
||||||
|
{
|
||||||
|
return $this->gtk->get_tooltip();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue