From a9ff0e8c2ba57c1ada001ab0d803501a1fd8f7cc Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 21 May 2020 19:44:35 +0200 Subject: [PATCH] Fallnack icon should still work if no dark icon is specified --- nw/gui/icons.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nw/gui/icons.py b/nw/gui/icons.py index fe596fe3..a57f3029 100644 --- a/nw/gui/icons.py +++ b/nw/gui/icons.py @@ -76,6 +76,7 @@ class GuiIcons: "cls_trash" : (QStyle.SP_DriveHDIcon, "drive-harddisk"), "proj_document" : (QStyle.SP_FileIcon, "x-office-document"), "proj_folder" : (QStyle.SP_DirIcon, "folder"), + "proj_nwx" : (None, None), "status_lang" : (None, None), "status_time" : (None, None), "status_stats" : (None, None), @@ -295,8 +296,10 @@ class GuiIcons: # Finally. we check if we have a fallback icon if self.mainConf.guiDark: fbackIcon = path.join(self.mainConf.iconPath, self.fbackName, "%s-dark.svg" % iconKey) - else: - fbackIcon = path.join(self.mainConf.iconPath, self.fbackName, "%s.svg" % iconKey) + if path.isfile(fbackIcon): + logger.verbose("Loading icon '%s' from fallback theme" % iconKey) + return QIcon(fbackIcon) + fbackIcon = path.join(self.mainConf.iconPath, self.fbackName, "%s.svg" % iconKey) if path.isfile(fbackIcon): logger.verbose("Loading icon '%s' from fallback theme" % iconKey) return QIcon(fbackIcon)