mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
add image icon
This commit is contained in:
parent
db4b3d0df0
commit
5b3d22621a
1 changed files with 11 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ class Tab
|
||||||
|
|
||||||
// Defaults
|
// Defaults
|
||||||
public const LABEL = '+';
|
public const LABEL = '+';
|
||||||
|
public const IMAGE = 'tab-new';
|
||||||
public const TOOLTIP = 'New tab';
|
public const TOOLTIP = 'New tab';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
|
@ -26,6 +27,16 @@ class Tab
|
||||||
// Init GTK
|
// Init GTK
|
||||||
$this->gtk = new \GtkButton;
|
$this->gtk = new \GtkButton;
|
||||||
|
|
||||||
|
if (\GtkIconTheme::get_default()->has_icon($this::IMAGE))
|
||||||
|
{
|
||||||
|
$this->gtk->set_image(
|
||||||
|
\GtkImage::new_from_icon_name(
|
||||||
|
$this::IMAGE,
|
||||||
|
\GtkIconSize::BUTTON
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$this->gtk->set_label(
|
$this->gtk->set_label(
|
||||||
_($this::LABEL)
|
_($this::LABEL)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue