mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
fix use const
This commit is contained in:
parent
bb3f7595f7
commit
0f01ecde96
5 changed files with 26 additions and 29 deletions
|
|
@ -11,7 +11,7 @@ class Query extends \Yggverse\Yoda\Abstract\Entity\Entry
|
||||||
public Response $response;
|
public Response $response;
|
||||||
|
|
||||||
// Defaults
|
// Defaults
|
||||||
protected string $_placeholder = 'Enter response...';
|
public const PLACEHOLDER = 'Enter your response...';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Response $response
|
Response $response
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class Send extends \Yggverse\Yoda\Abstract\Entity\Button
|
||||||
public Response $response;
|
public Response $response;
|
||||||
|
|
||||||
// Defaults
|
// Defaults
|
||||||
protected string $_label = 'Send';
|
public const LABEL = 'Send';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Response $response
|
Response $response
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@ class Header
|
||||||
public Header\Tray $tray;
|
public Header\Tray $tray;
|
||||||
|
|
||||||
// Defaults
|
// Defaults
|
||||||
protected bool $_actions = true;
|
public const ACTIONS = true;
|
||||||
protected string $_title = 'Yoda';
|
public const TITLE = 'Yoda';
|
||||||
protected string $_subtitle = '';
|
public const SUBTITLE = '';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Browser $browser
|
Browser $browser
|
||||||
|
|
@ -31,15 +31,15 @@ class Header
|
||||||
$this->gtk = new \GtkHeaderBar;
|
$this->gtk = new \GtkHeaderBar;
|
||||||
|
|
||||||
$this->gtk->set_show_close_button(
|
$this->gtk->set_show_close_button(
|
||||||
$this->_actions
|
$this::ACTIONS
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->gtk->set_title(
|
$this->gtk->set_title(
|
||||||
$this->_title
|
$this::TITLE
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->gtk->set_subtitle(
|
$this->gtk->set_subtitle(
|
||||||
$this->_subtitle
|
$this::SUBTITLE
|
||||||
);
|
);
|
||||||
|
|
||||||
// Init tray area
|
// Init tray area
|
||||||
|
|
@ -56,17 +56,17 @@ class Header
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTitle(
|
public function setTitle(
|
||||||
?string $value = null,
|
?string $title = null,
|
||||||
?string $subtitle = null
|
?string $subtitle = null
|
||||||
): void
|
): void
|
||||||
{
|
{
|
||||||
$this->gtk->set_title(
|
$this->gtk->set_title(
|
||||||
is_null($value) ? $this->_title : sprintf(
|
is_null($title) ? $this::TITLE : sprintf(
|
||||||
'%s - %s',
|
'%s - %s',
|
||||||
trim(
|
trim(
|
||||||
$value
|
$title
|
||||||
),
|
),
|
||||||
$this->_title
|
$this::TITLE
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -76,12 +76,12 @@ class Header
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSubtitle(
|
public function setSubtitle(
|
||||||
?string $value = null
|
?string $subtitle = null
|
||||||
): void
|
): void
|
||||||
{
|
{
|
||||||
$this->gtk->set_subtitle(
|
$this->gtk->set_subtitle(
|
||||||
is_null($value) ? $this->_subtitle : trim(
|
is_null($subtitle) ? $this::SUBTITLE : trim(
|
||||||
$value
|
$subtitle
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,8 @@ class Tray
|
||||||
public Tray\Tab $tab;
|
public Tray\Tab $tab;
|
||||||
|
|
||||||
// Defaults
|
// Defaults
|
||||||
protected bool $_actions = true;
|
public const MARGIN = 4;
|
||||||
protected string $_title = 'Yoda';
|
public const SPACING = 8;
|
||||||
protected string $_subtitle = '';
|
|
||||||
protected int $_margin = 8;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Header $header
|
Header $header
|
||||||
|
|
@ -35,15 +33,15 @@ class Tray
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->gtk->set_margin_start(
|
$this->gtk->set_margin_start(
|
||||||
$this->_margin / 2
|
$this::MARGIN
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->gtk->set_margin_end(
|
$this->gtk->set_margin_end(
|
||||||
$this->_margin / 2
|
$this::MARGIN
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->gtk->set_spacing(
|
$this->gtk->set_spacing(
|
||||||
$this->_margin
|
$this::SPACING
|
||||||
);
|
);
|
||||||
|
|
||||||
// Init navigation
|
// Init navigation
|
||||||
|
|
|
||||||
|
|
@ -8,27 +8,26 @@ class Header
|
||||||
{
|
{
|
||||||
public \GtkHeaderBar $gtk;
|
public \GtkHeaderBar $gtk;
|
||||||
|
|
||||||
protected bool $_actions = true;
|
public const ACTIONS = true;
|
||||||
protected string $_title = 'History - Yoda';
|
public const TITLE = 'History - Yoda';
|
||||||
protected string $_subtitle = '';
|
public const SUBTITLE = '';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->gtk = new \GtkHeaderBar;
|
$this->gtk = new \GtkHeaderBar;
|
||||||
|
|
||||||
$this->gtk->set_show_close_button(
|
$this->gtk->set_show_close_button(
|
||||||
$this->_actions
|
$this::ACTIONS
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->gtk->set_title(
|
$this->gtk->set_title(
|
||||||
$this->_title
|
_($this::TITLE)
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->gtk->set_subtitle(
|
$this->gtk->set_subtitle(
|
||||||
$this->_subtitle
|
_($this::SUBTITLE)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Render
|
|
||||||
$this->gtk->show();
|
$this->gtk->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue