From 5b3d22621ae6be0ce4db1bdf3de5d622eb6dde0a Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 22 Jul 2024 13:30:18 +0300 Subject: [PATCH] add image icon --- src/Entity/Browser/Header/Tray/Tab.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Entity/Browser/Header/Tray/Tab.php b/src/Entity/Browser/Header/Tray/Tab.php index c00c62a2..2caab50c 100644 --- a/src/Entity/Browser/Header/Tray/Tab.php +++ b/src/Entity/Browser/Header/Tray/Tab.php @@ -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 // 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) );