mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
implement setText method
This commit is contained in:
parent
6f69dc63ee
commit
50460d3928
2 changed files with 26 additions and 4 deletions
|
|
@ -13,7 +13,7 @@ class Title
|
||||||
// Defaults
|
// Defaults
|
||||||
private int $_ellipsize = 3;
|
private int $_ellipsize = 3;
|
||||||
private int $_length = 12;
|
private int $_length = 12;
|
||||||
private string $_value = 'New address';
|
private string $_text = 'New address';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
\Yggverse\Yoda\Entity\Window\Tab\Address $address,
|
\Yggverse\Yoda\Entity\Window\Tab\Address $address,
|
||||||
|
|
@ -21,7 +21,7 @@ class Title
|
||||||
$this->address = $address;
|
$this->address = $address;
|
||||||
|
|
||||||
$this->gtk = new \GtkLabel(
|
$this->gtk = new \GtkLabel(
|
||||||
$this->_value
|
$this->_text
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->gtk->set_width_chars(
|
$this->gtk->set_width_chars(
|
||||||
|
|
@ -32,4 +32,15 @@ class Title
|
||||||
$this->_ellipsize
|
$this->_ellipsize
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setText(
|
||||||
|
?string $text = null
|
||||||
|
): void
|
||||||
|
{
|
||||||
|
$this->gtk->set_text(
|
||||||
|
is_null($text) ? $this->_text : trim(
|
||||||
|
$text
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -13,7 +13,7 @@ class Title
|
||||||
// Defaults
|
// Defaults
|
||||||
private int $_ellipsize = 0;
|
private int $_ellipsize = 0;
|
||||||
private int $_length = 12;
|
private int $_length = 12;
|
||||||
private string $_value = 'History';
|
private string $_text = 'History';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
\Yggverse\Yoda\Entity\Window\Tab\History $history
|
\Yggverse\Yoda\Entity\Window\Tab\History $history
|
||||||
|
|
@ -21,7 +21,7 @@ class Title
|
||||||
$this->history = $history;
|
$this->history = $history;
|
||||||
|
|
||||||
$this->gtk = new \GtkLabel(
|
$this->gtk = new \GtkLabel(
|
||||||
$this->_value
|
$this->_text
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->gtk->set_width_chars(
|
$this->gtk->set_width_chars(
|
||||||
|
|
@ -32,4 +32,15 @@ class Title
|
||||||
$this->_ellipsize
|
$this->_ellipsize
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setText(
|
||||||
|
?string $text = null
|
||||||
|
): void
|
||||||
|
{
|
||||||
|
$this->gtk->set_text(
|
||||||
|
is_null($text) ? $this->_text : trim(
|
||||||
|
$text
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue