添加桌面壁纸透明后端,为动态壁纸铺路

main
柚子 3 years ago committed by GitHub
parent c6ebea7d9e
commit cf36c93f06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,6 +7,9 @@
<method name="setDarkModeDimsWallpaer">
<arg name="darkModeDimsWallpaer" type="b" direction="in"/>
</method>
<method name="setBackgroundVisible">
<arg name="BackgroundVisible" type="b" direction="in"/>
</method>
<method name="setSystemFont">
<arg name="fontFamily" type="s" direction="in"/>
</method>
@ -46,6 +49,7 @@
<property name="isDarkMode" type="b" access="read"/>
<property name="darkModeDimsWallpaer" type="b" access="read"/>
<property name="backgroundVisible" type="b" access="read"/>
<property name="systemFont" type="s" access="read"/>
<property name="systemFixedFont" type="s" access="read"/>
<property name="systemFontPointSize" type="d" access="read"/>
@ -66,6 +70,8 @@
</signal>
<signal name="darkModeDimsWallpaerChanged">
</signal>
<signal name="backgroundVisibleChanged">
</signal>
<signal name="accentColorChanged">
<arg type="i"/>
</signal>

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

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

Loading…
Cancel
Save