From 21cae62c4c7040088d4c9808cd338342babfd339 Mon Sep 17 00:00:00 2001 From: trigg Date: Fri, 5 Apr 2024 08:34:26 +0100 Subject: [PATCH 01/14] - Check for and load absolute path icons --- src/panel/widgets/launchers.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/panel/widgets/launchers.cpp b/src/panel/widgets/launchers.cpp index 406787fb..7d8574e3 100644 --- a/src/panel/widgets/launchers.cpp +++ b/src/panel/widgets/launchers.cpp @@ -34,8 +34,13 @@ struct DesktopLauncherInfo : public LauncherInfo Glib::RefPtr get_pixbuf(int32_t size) { - auto icon = app_info->get_icon()->to_string(); - auto theme = Gtk::IconTheme::get_default(); + auto icon = app_info->get_icon()->to_string(); + auto theme = Gtk::IconTheme::get_default(); + std::string absolute_path = "/"; + if (!icon.compare(0, absolute_path.size(), absolute_path)) + { + return Gdk::Pixbuf::create_from_file(icon, size, size); + } if (!theme->lookup_icon(icon, size)) { From 0e2334efb189b983b51f695207ffff1364e74ec9 Mon Sep 17 00:00:00 2001 From: trigg Date: Fri, 5 Apr 2024 09:07:42 +0100 Subject: [PATCH 02/14] - Moved theme value after first potential return - Cleaned up some style --- src/panel/widgets/launchers.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/panel/widgets/launchers.cpp b/src/panel/widgets/launchers.cpp index 7d8574e3..63063f3d 100644 --- a/src/panel/widgets/launchers.cpp +++ b/src/panel/widgets/launchers.cpp @@ -34,14 +34,15 @@ struct DesktopLauncherInfo : public LauncherInfo Glib::RefPtr get_pixbuf(int32_t size) { - auto icon = app_info->get_icon()->to_string(); - auto theme = Gtk::IconTheme::get_default(); + auto icon = app_info->get_icon()->to_string(); std::string absolute_path = "/"; - if (!icon.compare(0, absolute_path.size(), absolute_path)) + if (!icon.compare(0, absolute_path.size(), absolute_path)) { return Gdk::Pixbuf::create_from_file(icon, size, size); } + auto theme = Gtk::IconTheme::get_default(); + if (!theme->lookup_icon(icon, size)) { std::cerr << "Failed to load icon \"" << icon << "\"" << std::endl; From 3ea04e7bd089f0c702ae6f9d06cc5589ab9bff45 Mon Sep 17 00:00:00 2001 From: trigg Date: Wed, 10 Apr 2024 18:14:10 +0100 Subject: [PATCH 03/14] Add Categories to panel --- metadata/panel.xml | 6 ++ src/panel/widgets/menu.cpp | 173 +++++++++++++++++++++++++++++++++++-- src/panel/widgets/menu.hpp | 47 +++++++++- 3 files changed, 214 insertions(+), 12 deletions(-) diff --git a/metadata/panel.xml b/metadata/panel.xml index d5e98976..5d950bb7 100644 --- a/metadata/panel.xml +++ b/metadata/panel.xml @@ -181,6 +181,12 @@ file + + +