From 28e2e1937c4652bbf4fc46c7798c2a1e4a3a38f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=8E=A7=E5=A1=9A=20=E5=B8=8C=E7=BE=8E?= <142671432+habatake@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:52:15 +0000 Subject: [PATCH 1/2] Allow custom font for UI added config UIConfig/UIFont. SandMan will load it as its UI's font. --- SandboxiePlus/SandMan/SandMan.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index 6e9773cd..5f870513 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -181,7 +181,6 @@ CSandMan::CSandMan(QWidget *parent) connect(theAPI, SIGNAL(StatusChanged()), this, SLOT(OnStatusChanged())); connect(theAPI, SIGNAL(BoxAdded(const CSandBoxPtr&)), this, SLOT(OnBoxAdded(const CSandBoxPtr&))); - connect(theAPI, SIGNAL(BoxOpened(const CSandBoxPtr&)), this, SLOT(OnBoxOpened(const CSandBoxPtr&))); connect(theAPI, SIGNAL(BoxClosed(const CSandBoxPtr&)), this, SLOT(OnBoxClosed(const CSandBoxPtr&))); connect(theAPI, SIGNAL(BoxCleaned(CSandBoxPlus*)), this, SLOT(OnBoxCleaned(CSandBoxPlus*))); @@ -2353,11 +2352,6 @@ void CSandMan::OnStartMenuChanged() } } -void CSandMan::OnBoxOpened(const CSandBoxPtr& pBox) -{ - CSupportDialog::CheckSupport(true); -} - void CSandMan::OnBoxClosed(const CSandBoxPtr& pBox) { foreach(const QString & Value, pBox->GetTextList("OnBoxTerminate", true, false, true)) { @@ -4250,7 +4244,11 @@ void CSandMan::SetUITheme() CFinder::SetDarkMode(bDark); - QFont font = QApplication::font(); + QFont font = QApplication::font(); + if (QString customFont = theConf->GetString("UIConfig/UIFont",""); customFont != ""){ + font.setFamily(customFont); + QApplication::setFont(font); + } double newFontSize = m_DefaultFontSize * theConf->GetInt("Options/FontScaling", 100) / 100.0; if (newFontSize != font.pointSizeF()) { font.setPointSizeF(newFontSize); From f8be375d09fd322fc19bfc4354a76c4318d98987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=8E=A7=E5=A1=9A=20=E5=B8=8C=E7=BE=8E?= <142671432+habatake@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:27:11 +0000 Subject: [PATCH 2/2] fix: stdGetTextList("OnBoxTerminate", true, false, true)) { @@ -4244,11 +4250,12 @@ void CSandMan::SetUITheme() CFinder::SetDarkMode(bDark); - QFont font = QApplication::font(); - if (QString customFont = theConf->GetString("UIConfig/UIFont",""); customFont != ""){ - font.setFamily(customFont); - QApplication::setFont(font); - } + QFont font = QApplication::font(); + QString customFontStr = theConf->GetString("UIConfig/UIFont", ""); + if (customFontStr != "") { + font.setFamily(customFontStr); + QApplication::setFont(font); + } double newFontSize = m_DefaultFontSize * theConf->GetInt("Options/FontScaling", 100) / 100.0; if (newFontSize != font.pointSizeF()) { font.setPointSizeF(newFontSize);