mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
init multi-window implementation
This commit is contained in:
parent
6f99b36a44
commit
847a0fb01d
45 changed files with 904 additions and 833 deletions
49
src/Entity/Browser/Container/Tab/Page/Title.php
Normal file
49
src/Entity/Browser/Container/Tab/Page/Title.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page;
|
||||
|
||||
class Title
|
||||
{
|
||||
public \GtkLabel $gtk;
|
||||
|
||||
// Dependencies
|
||||
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page $page;
|
||||
|
||||
// Defaults
|
||||
private int $_ellipsize = 3;
|
||||
private int $_length = 12;
|
||||
private string $_value = 'New page';
|
||||
|
||||
public function __construct(
|
||||
\Yggverse\Yoda\Entity\Browser\Container\Tab\Page $page,
|
||||
) {
|
||||
// Init dependencies
|
||||
$this->page = $page;
|
||||
|
||||
// Init container
|
||||
$this->gtk = new \GtkLabel(
|
||||
$this->_value
|
||||
);
|
||||
|
||||
$this->gtk->set_width_chars(
|
||||
$this->_length
|
||||
);
|
||||
|
||||
$this->gtk->set_ellipsize(
|
||||
$this->_ellipsize
|
||||
);
|
||||
}
|
||||
|
||||
public function setValue(
|
||||
?string $value = null
|
||||
): void
|
||||
{
|
||||
$this->gtk->set_text(
|
||||
is_null($value) ? $this->_value : trim(
|
||||
$value
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue