This commit is contained in:
DavidXanatos 2022-11-05 14:53:44 +01:00
parent af15b01001
commit ea2e4bc312
4 changed files with 11 additions and 10 deletions

View File

@ -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)

View File

@ -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)

View File

@ -49,7 +49,7 @@ public:
static QString FormatError(const SB_STATUS& Error);
static void CheckResults(QList<SB_STATUS> Results);
static QIcon GetIcon(const QString& Name, bool bAction = true);
static QIcon GetIcon(const QString& Name, int iAction = 1);
bool IsFullyPortable();

View File

@ -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);
}