From fc9a3909774e8ea012f528f09045a98e8997dc30 Mon Sep 17 00:00:00 2001 From: Marvin Dostal Date: Sun, 17 Jul 2022 13:34:01 +0200 Subject: [PATCH] sni: Use the given pixmap even if there is a name given --- src/modules/sni/item.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index 0295153..b2c41ed 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -319,14 +319,15 @@ void Item::updateImage() { Glib::RefPtr Item::getIconPixbuf() { try { + if (icon_pixmap) { + return icon_pixmap; + } if (!icon_name.empty()) { std::ifstream temp(icon_name); if (temp.is_open()) { return Gdk::Pixbuf::create_from_file(icon_name); } return getIconByName(icon_name, getScaledIconSize()); - } else if (icon_pixmap) { - return icon_pixmap; } } catch (Glib::Error& e) { spdlog::error("Item '{}': {}", id, static_cast(e.what()));