From ea2e4bc3120c8276d16881d9939c9b586ef31061 Mon Sep 17 00:00:00 2001 From: DavidXanatos Date: Sat, 5 Nov 2022 14:53:44 +0100 Subject: [PATCH] 1.5.3 --- CHANGELOG.md | 1 + SandboxiePlus/SandMan/SandMan.cpp | 8 ++++---- SandboxiePlus/SandMan/SandMan.h | 2 +- SandboxiePlus/SandMan/SandManTray.cpp | 10 +++++----- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 893c709d..5eb5e62e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - fixed issue with m_pColorslider changed not applied. [#2433](https://github.com/sandboxie-plus/Sandboxie/pull/2433) - fixed issue with switching snapshots when the file panel is open - fixed issue with file panel when an empty box is sellected [#2419](https://github.com/sandboxie-plus/Sandboxie/issues/2419) +- fixed not all icons being disabled with disable all icons [#2406](https://github.com/sandboxie-plus/Sandboxie/issues/2406) diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index 9bb5652b..4ed0defa 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -316,18 +316,18 @@ void CSandMan::StoreState() if(m_pLogTabs) theConf->SetValue("MainWindow/LogTab", m_pLogTabs->currentIndex()); } -QIcon CSandMan::GetIcon(const QString& Name, bool bAction) +QIcon CSandMan::GetIcon(const QString& Name, int iAction) { int iNoIcons = theConf->GetInt("Options/NoIcons", 2); if (iNoIcons == 2) iNoIcons = theConf->GetInt("Options/ViewMode", 1) == 2 ? 1 : 0; - if(bAction && iNoIcons) + if(iAction && iNoIcons) return QIcon(); QString Path = QApplication::applicationDirPath() + "/Icons/" + Name + ".png"; if(QFile::exists(Path)) return QIcon(Path); - return QIcon((bAction ? ":/Actions/" : ":/") + Name + ".png"); + return QIcon((iAction == 1 ? ":/Actions/" : ":/") + Name + ".png"); } void CSandMan::CreateUI() @@ -437,7 +437,7 @@ void CSandMan::CreateHelpMenu(bool bAdvanced) m_pUpdate = m_pMenuHelp->addAction(tr("Check for Updates"), this, SLOT(CheckForUpdates())); m_pMenuHelp->addSeparator(); m_pAboutQt = m_pMenuHelp->addAction(tr("About the Qt Framework"), this, SLOT(OnAbout())); - m_pAbout = m_pMenuHelp->addAction(CSandMan::GetIcon("IconFull", false), tr("About Sandboxie-Plus"), this, SLOT(OnAbout())); + m_pAbout = m_pMenuHelp->addAction(CSandMan::GetIcon("IconFull", 2), tr("About Sandboxie-Plus"), this, SLOT(OnAbout())); } void CSandMan::CreateMenus(bool bAdvanced) diff --git a/SandboxiePlus/SandMan/SandMan.h b/SandboxiePlus/SandMan/SandMan.h index f28aefde..f767ed6f 100644 --- a/SandboxiePlus/SandMan/SandMan.h +++ b/SandboxiePlus/SandMan/SandMan.h @@ -49,7 +49,7 @@ public: static QString FormatError(const SB_STATUS& Error); static void CheckResults(QList Results); - static QIcon GetIcon(const QString& Name, bool bAction = true); + static QIcon GetIcon(const QString& Name, int iAction = 1); bool IsFullyPortable(); diff --git a/SandboxiePlus/SandMan/SandManTray.cpp b/SandboxiePlus/SandMan/SandManTray.cpp index 2e8a7c7f..4b1fc4ba 100644 --- a/SandboxiePlus/SandMan/SandManTray.cpp +++ b/SandboxiePlus/SandMan/SandManTray.cpp @@ -42,7 +42,7 @@ void CSandMan::CreateTrayIcon() void CSandMan::CreateTrayMenu() { m_pTrayMenu = new QMenu(); - QAction* pShowHide = m_pTrayMenu->addAction(GetIcon("IconFull", false), tr("Show/Hide"), this, SLOT(OnShowHide())); + QAction* pShowHide = m_pTrayMenu->addAction(GetIcon("IconFull", 2), tr("Show/Hide"), this, SLOT(OnShowHide())); QFont f = pShowHide->font(); f.setBold(true); pShowHide->setFont(f); @@ -142,17 +142,17 @@ QIcon CSandMan::GetTrayIcon(bool isConnected) QPixmap result(size); result.fill(Qt::transparent); // force alpha channel QPainter painter(&result); - QPixmap base = GetIcon(IconFile, false).pixmap(size); + QPixmap base = GetIcon(IconFile, 0).pixmap(size); QPixmap overlay; if (m_bIconBusy) { IconFile = "IconBusy"; if (bClassic) { // classic has a different icon instead of an overlay IconFile += "C"; - base = GetIcon(IconFile, false).pixmap(size); + base = GetIcon(IconFile, 0).pixmap(size); } else - overlay = GetIcon(IconFile, false).pixmap(size); + overlay = GetIcon(IconFile, 0).pixmap(size); } painter.drawPixmap(0, 0, base); @@ -161,7 +161,7 @@ QIcon CSandMan::GetTrayIcon(bool isConnected) if (m_bIconDisabled) { IconFile = "IconDFP"; if (bClassic) IconFile += "C"; - overlay = GetIcon(IconFile, false).pixmap(size); + overlay = GetIcon(IconFile, 0).pixmap(size); painter.drawPixmap(0, 0, overlay); }