diff --git a/screenlocker/CMakeLists.txt b/screenlocker/CMakeLists.txt index 46943fa..158105b 100644 --- a/screenlocker/CMakeLists.txt +++ b/screenlocker/CMakeLists.txt @@ -6,7 +6,6 @@ set(PROJECT_SOURCES main.cpp application.cpp authenticator.cpp - wallpaper.cpp kcheckpass-enums.h fixx11h.h qml.qrc @@ -27,4 +26,4 @@ target_link_libraries(cutefish-screenlocker ${X11_LIBRARIES} ) -install(TARGETS cutefish-screenlocker RUNTIME DESTINATION /usr/bin) \ No newline at end of file +install(TARGETS cutefish-screenlocker RUNTIME DESTINATION /usr/bin) diff --git a/screenlocker/application.cpp b/screenlocker/application.cpp index 5199cd5..03260c2 100644 --- a/screenlocker/application.cpp +++ b/screenlocker/application.cpp @@ -1,5 +1,4 @@ #include "application.h" -#include "wallpaper.h" // Qt Core #include @@ -101,7 +100,6 @@ void Application::desktopResized() // engine stuff QQmlContext *context = view->engine()->rootContext(); context->setContextProperty(QStringLiteral("authenticator"), m_authenticator); - context->setContextProperty(QStringLiteral("wallpaper"), new Wallpaper); view->setSource(QUrl("qrc:/qml/LockScreen.qml")); view->setResizeMode(QQuickView::SizeRootObjectToView); diff --git a/screenlocker/qml/LockScreen.qml b/screenlocker/qml/LockScreen.qml index 1b0d296..e3a0cc0 100644 --- a/screenlocker/qml/LockScreen.qml +++ b/screenlocker/qml/LockScreen.qml @@ -24,6 +24,7 @@ import QtQuick.Layouts 1.12 import QtGraphicalEffects 1.0 import Cutefish.Accounts 1.0 as Accounts +import Cutefish.System 1.0 as System import FishUI 1.0 as FishUI Item { @@ -34,6 +35,10 @@ Item { LayoutMirroring.enabled: Qt.locale().textDirection === Qt.RightToLeft LayoutMirroring.childrenInherit: true + System.Wallpaper { + id: wallpaper + } + Image { id: wallpaperImage anchors.fill: parent @@ -158,7 +163,7 @@ Item { id: _mainLayout anchors.fill: parent anchors.margins: FishUI.Units.largeSpacing * 1.5 - spacing: FishUI.Units.smallSpacing + spacing: FishUI.Units.smallSpacing * 1.5 Image { id: userIcon @@ -269,6 +274,20 @@ Item { opacity: text == "" ? 0 : 1 } + DropShadow { + anchors.fill: message + source: message + z: -1 + horizontalOffset: 1 + verticalOffset: 1 + radius: 10 + samples: radius * 4 + spread: 0.35 + color: Qt.rgba(0, 0, 0, 0.8) + opacity: 0.1 + visible: true + } + function tryUnlock() { if (!password.text) { root.notification = qsTr("Please enter your password") diff --git a/screenlocker/wallpaper.cpp b/screenlocker/wallpaper.cpp deleted file mode 100644 index 99d0a63..0000000 --- a/screenlocker/wallpaper.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "wallpaper.h" - -Wallpaper::Wallpaper(QObject *parent) - : QObject(parent) - , m_interface("org.cutefish.Settings", - "/Theme", "org.cutefish.Theme", - QDBusConnection::sessionBus(), this) -{ - if (m_interface.isValid()) { - connect(&m_interface, SIGNAL(wallpaperChanged(QString)), this, SLOT(onPathChanged(QString))); - } -} - -QString Wallpaper::path() const -{ - return m_interface.property("wallpaper").toString(); -} - -void Wallpaper::onPathChanged(QString path) -{ - Q_UNUSED(path); - - emit pathChanged(); -} diff --git a/screenlocker/wallpaper.h b/screenlocker/wallpaper.h deleted file mode 100644 index a5cc372..0000000 --- a/screenlocker/wallpaper.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef WALLPAPER_H -#define WALLPAPER_H - -#include -#include - -class Wallpaper : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString path READ path NOTIFY pathChanged) - -public: - explicit Wallpaper(QObject *parent = nullptr); - - QString path() const; - -signals: - void pathChanged(); - -private slots: - void onPathChanged(QString path); - -private: - QDBusInterface m_interface; - QString m_wallpaper; -}; - -#endif // WALLPAPER_H