From cf36c93f06cc18cbd0ca6cc548191d870e0663fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9F=9A=E5=AD=90?=
<40852301+uiYzzi@users.noreply.github.com>
Date: Sun, 15 Jan 2023 21:10:32 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A1=8C=E9=9D=A2=E5=A3=81?=
=?UTF-8?q?=E7=BA=B8=E9=80=8F=E6=98=8E=E5=90=8E=E7=AB=AF=EF=BC=8C=E4=B8=BA?=
=?UTF-8?q?=E5=8A=A8=E6=80=81=E5=A3=81=E7=BA=B8=E9=93=BA=E8=B7=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
settings-daemon/theme/com.cutefish.Theme.xml | 6 ++++++
settings-daemon/theme/thememanager.cpp | 15 +++++++++++++++
settings-daemon/theme/thememanager.h | 5 +++++
3 files changed, 26 insertions(+)
diff --git a/settings-daemon/theme/com.cutefish.Theme.xml b/settings-daemon/theme/com.cutefish.Theme.xml
index 72449a3..b6b6eb4 100644
--- a/settings-daemon/theme/com.cutefish.Theme.xml
+++ b/settings-daemon/theme/com.cutefish.Theme.xml
@@ -7,6 +7,9 @@
+
+
+
@@ -46,6 +49,7 @@
+
@@ -66,6 +70,8 @@
+
+
diff --git a/settings-daemon/theme/thememanager.cpp b/settings-daemon/theme/thememanager.cpp
index 062ae5e..96eddd7 100644
--- a/settings-daemon/theme/thememanager.cpp
+++ b/settings-daemon/theme/thememanager.cpp
@@ -68,6 +68,7 @@ ThemeManager::ThemeManager(QObject *parent)
// init value
m_isDarkMode = m_settings->value("DarkMode", false).toBool();
m_darkModeDimsWallpaer = m_settings->value("DarkModeDimsWallpaer", false).toBool();
+ m_backgroundVisible = true;
m_wallpaperPath = m_settings->value("Wallpaper", "/usr/share/backgrounds/cutefishos/default.jpg").toString();
m_accentColor = m_settings->value("AccentColor", 0).toInt();
m_backgroundType = m_settings->value("BackgroundType", 0).toInt();
@@ -144,6 +145,20 @@ void ThemeManager::setDarkModeDimsWallpaer(bool value)
emit darkModeDimsWallpaerChanged();
}
+bool ThemeManager::backgroundVisible() const
+{
+ return m_backgroundVisible;
+}
+
+void ThemeManager::setBackgroundVisible(bool value)
+{
+ if (m_backgroundVisible == value)
+ return;
+
+ m_backgroundVisible = value;
+ emit backgroundVisibleChanged();
+}
+
int ThemeManager::accentColor()
{
return m_settings->value("AccentColor", 0).toInt();
diff --git a/settings-daemon/theme/thememanager.h b/settings-daemon/theme/thememanager.h
index 9b768aa..f5176bc 100644
--- a/settings-daemon/theme/thememanager.h
+++ b/settings-daemon/theme/thememanager.h
@@ -28,6 +28,7 @@ class ThemeManager : public QObject
Q_OBJECT
Q_PROPERTY(bool isDarkMode READ isDarkMode WRITE setDarkMode NOTIFY darkModeChanged)
Q_PROPERTY(bool darkModeDimsWallpaer READ darkModeDimsWallpaer WRITE setDarkModeDimsWallpaer NOTIFY darkModeDimsWallpaerChanged)
+ Q_PROPERTY(bool backgroundVisible READ backgroundVisible WRITE setBackgroundVisible NOTIFY backgroundVisibleChanged)
Q_PROPERTY(QString systemFont READ systemFont WRITE setSystemFont NOTIFY systemFontChanged)
Q_PROPERTY(QString systemFixedFont READ systemFixedFont WRITE setSystemFixedFont)
Q_PROPERTY(qreal systemFontPointSize READ systemFontPointSize WRITE setSystemFontPointSize NOTIFY systemFontPointSizeChanged)
@@ -52,6 +53,8 @@ public:
void setDarkModeDimsWallpaer(bool value);
QString systemFont();
+ bool backgroundVisible() const;
+ void setBackgroundVisible(bool value);
void setSystemFont(const QString &fontFamily);
QString systemFixedFont();
@@ -96,6 +99,7 @@ signals:
void wallpaperChanged(QString path);
void darkModeDimsWallpaerChanged();
void accentColorChanged(int accentColor);
+ void backgroundVisibleChanged();
void backgroundTypeChanged();
void backgroundColorChanged();
void cursorThemeChanged();
@@ -110,6 +114,7 @@ private:
bool m_isDarkMode;
bool m_darkModeDimsWallpaer;
QString m_wallpaperPath;
+ bool m_backgroundVisible;
int m_backgroundType;
QString m_backgroundColor;
int m_accentColor;