Browse Source

add image icon

PHP-GTK3
yggverse 4 months ago
parent
commit
5b3d22621a
  1. 11
      src/Entity/Browser/Header/Tray/Tab.php

11
src/Entity/Browser/Header/Tray/Tab.php

@ -15,6 +15,7 @@ class Tab @@ -15,6 +15,7 @@ class Tab
// Defaults
public const LABEL = '+';
public const IMAGE = 'tab-new';
public const TOOLTIP = 'New tab';
public function __construct(
@ -26,6 +27,16 @@ class Tab @@ -26,6 +27,16 @@ class Tab
// Init GTK
$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::LABEL)
);

Loading…
Cancel
Save