use const for default values, use namespace

This commit is contained in:
yggverse 2024-07-21 19:35:41 +03:00
parent 8a622ec335
commit c985cf20af
20 changed files with 157 additions and 130 deletions

View file

@ -18,7 +18,7 @@ class Navigation
public Menu $menu;
// Defaults
private string $_tooltip = 'Navigation';
public const TOOLTIP = 'Navigation';
public function __construct(
Tray $tray
@ -30,7 +30,7 @@ class Navigation
$this->gtk = new \GtkMenuButton;
$this->gtk->set_tooltip_text(
_($this->_tooltip)
_($this::TOOLTIP)
);
// Init menu

View file

@ -14,8 +14,8 @@ class Tab
public Tray $tray;
// Defaults
protected string $_label = '+';
private string $_tooltip = 'New tab';
public const LABEL = '+';
public const TOOLTIP = 'New tab';
public function __construct(
Tray $tray
@ -27,11 +27,11 @@ class Tab
$this->gtk = new \GtkButton;
$this->gtk->set_label(
_($this->_label)
_($this::LABEL)
);
$this->gtk->set_tooltip_text(
_($this->_tooltip)
_($this::TOOLTIP)
);
// Render