Skip to content

Commit

Permalink
chore: update the file
Browse files Browse the repository at this point in the history
  • Loading branch information
x-tools-author committed Sep 29, 2024
1 parent f03acc3 commit 8b24eba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/App/StyleSheetManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

namespace xTools {

bool StyleSheetManager::m_enableStylesheet = false;
StyleSheetManager::StyleSheetManager(QObject* parent)
: acss::QtAdvancedStylesheet(parent)
{
Expand Down Expand Up @@ -111,6 +112,11 @@ QMenu* StyleSheetManager::themeMenu() const
return m_themeMenu;
}

void StyleSheetManager::setEnableStyleSheetDefaultValue(bool enabled)
{
m_enableStylesheet = enabled;
}

QString StyleSheetManager::themeName()
{
QString ret = xTools::Settings::instance()->value("themeName").toString();
Expand Down Expand Up @@ -187,7 +193,7 @@ void StyleSheetManager::updateActionIcon(QAction* action, const QString& color)
bool StyleSheetManager::enableStylesheet()
{
auto settings = xTools::Settings::instance();
return settings->value("enableStylesheet", false).toBool();
return settings->value("enableStylesheet", m_enableStylesheet).toBool();
}

void StyleSheetManager::setEnableStylesheet(bool enable)
Expand Down
2 changes: 2 additions & 0 deletions Source/App/StyleSheetManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ class StyleSheetManager : public acss::QtAdvancedStylesheet

static StyleSheetManager& singleton();
QMenu* themeMenu() const;
static void setEnableStyleSheetDefaultValue(bool enabled);

private:
QMenu* m_themeMenu;
QActionGroup* m_themeActionGroup;
QMap<QString, QString> m_nameFriendlyNameMap;
QMap<QString, QString> m_primaryColorMap;
static bool m_enableStylesheet;

private:
QString themeName();
Expand Down

0 comments on commit 8b24eba

Please sign in to comment.