diff --git a/desktop/desktopsettings.cpp b/desktop/desktopsettings.cpp index 3b560ff..59e27d1 100644 --- a/desktop/desktopsettings.cpp +++ b/desktop/desktopsettings.cpp @@ -41,6 +41,11 @@ QString DesktopSettings::wallpaper() const return m_wallpaper; } +bool DesktopSettings::backgroundVisible() const +{ + return m_interface.property("backgroundVisible").toBool(); +} + bool DesktopSettings::dimsWallpaper() const { return m_interface.property("darkModeDimsWallpaer").toBool(); @@ -71,7 +76,7 @@ void DesktopSettings::init() connect(&m_interface, SIGNAL(darkModeDimsWallpaerChanged()), this, SIGNAL(dimsWallpaperChanged())); connect(&m_interface, SIGNAL(backgroundTypeChanged()), this, SIGNAL(backgroundTypeChanged())); connect(&m_interface, SIGNAL(backgroundColorChanged()), this, SIGNAL(backgroundColorChanged())); - + connect(&m_interface, SIGNAL(backgroundVisibleChanged()), this, SIGNAL(backgroundVisibleChanged())); m_wallpaper = m_interface.property("wallpaper").toString(); emit wallpaperChanged(); } diff --git a/desktop/desktopsettings.h b/desktop/desktopsettings.h index e7f3d10..7859515 100644 --- a/desktop/desktopsettings.h +++ b/desktop/desktopsettings.h @@ -28,7 +28,7 @@ class DesktopSettings : public QObject Q_OBJECT Q_PROPERTY(QString wallpaper READ wallpaper NOTIFY wallpaperChanged) Q_PROPERTY(bool dimsWallpaper READ dimsWallpaper NOTIFY dimsWallpaperChanged) - + Q_PROPERTY(bool backgroundVisible READ backgroundVisible NOTIFY backgroundVisibleChanged) Q_PROPERTY(int backgroundType READ backgroundType NOTIFY backgroundTypeChanged) Q_PROPERTY(QString backgroundColor READ backgroundColor NOTIFY backgroundColorChanged) @@ -37,7 +37,7 @@ public: QString wallpaper() const; bool dimsWallpaper() const; - + bool backgroundVisible() const; int backgroundType() const; QString backgroundColor() const; @@ -48,7 +48,8 @@ signals: void dimsWallpaperChanged(); void backgroundColorChanged(); void backgroundTypeChanged(); - + void backgroundVisibleChanged(); + private slots: void init(); void onWallpaperChanged(QString); diff --git a/desktop/desktopview.cpp b/desktop/desktopview.cpp index 83a1456..e1791b1 100644 --- a/desktop/desktopview.cpp +++ b/desktop/desktopview.cpp @@ -35,12 +35,14 @@ DesktopView::DesktopView(QScreen *screen, QQuickView *parent) , m_screen(screen) { m_screenRect = m_screen->geometry(); - + this->setFlag(Qt::FramelessWindowHint); + this->setColor(QColor(Qt::transparent)); KWindowSystem::setType(winId(), NET::Desktop); KWindowSystem::setState(winId(), NET::KeepBelow); engine()->rootContext()->setContextProperty("desktopView", this); engine()->rootContext()->setContextProperty("Dock", DockDBusInterface::self()); + QWindow::fromWinId(winId())->setOpacity(0.99); engine()->addImageProvider("thumbnailer", new ThumbnailProvider()); setTitle(tr("Desktop")); diff --git a/qml/Desktop/Wallpaper.qml b/qml/Desktop/Wallpaper.qml index ad9b21e..182c59b 100644 --- a/qml/Desktop/Wallpaper.qml +++ b/qml/Desktop/Wallpaper.qml @@ -26,6 +26,7 @@ Item { Rectangle { anchors.fill: parent + visible: settings.backgroundVisible color: settings.backgroundColor } } @@ -39,6 +40,7 @@ Item { height * Screen.devicePixelRatio) fillMode: Image.PreserveAspectCrop clip: true + visible: settings.backgroundVisible cache: false // Clear cache