diff --git a/src/Entity/Browser/Container/Page/Title.php b/src/Entity/Browser/Container/Page/Title.php index c62e044e..c92bfda1 100644 --- a/src/Entity/Browser/Container/Page/Title.php +++ b/src/Entity/Browser/Container/Page/Title.php @@ -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(); + } } \ No newline at end of file