update title setters API

This commit is contained in:
yggverse 2024-07-09 10:17:00 +03:00
parent 20f71fcdcf
commit 52ade7be77
2 changed files with 34 additions and 25 deletions

View file

@ -40,10 +40,28 @@ class Title
);
}
public function setValue(
public function set(
?string $value = null,
?string $subtitle = null,
?string $tooltip = null,
?string $tooltip = null
): void
{
$this->setValue(
$value
);
$this->setSubtitle(
$subtitle
);
$this->setTooltip(
is_null($tooltip) ? (mb_strlen(strval($value)) > $this->_length ? $value : null)
: $tooltip
);
}
public function setValue(
?string $value = null
): void
{
$this->gtk->set_text(
@ -51,15 +69,6 @@ class Title
$value
)
);
$this->gtk->set_tooltip_text(
is_null($tooltip) ? (mb_strlen(strval($value)) > $this->_length ? $value : null)
: trim($tooltip)
);
$this->setSubtitle(
$subtitle
);
}
public function setSubtitle(
@ -79,7 +88,7 @@ class Title
?string $tooltip = null
): void
{
$this->gtk->set_subtitle(
$this->gtk->set_tooltip_text(
is_null($tooltip) ? $this->_tooltip : trim(
$tooltip
)