diff --git a/ksplash/ksplashqml/CMakeLists.txt b/ksplash/ksplashqml/CMakeLists.txt index 495106263..dadbec61f 100644 --- a/ksplash/ksplashqml/CMakeLists.txt +++ b/ksplash/ksplashqml/CMakeLists.txt @@ -15,6 +15,7 @@ target_link_libraries(ksplashqml Qt5::Quick Qt5::Widgets Qt5::DBus + KF5::PlasmaQuick ) install(TARGETS ksplashqml ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/ksplash/ksplashqml/SplashWindow.cpp b/ksplash/ksplashqml/SplashWindow.cpp index e96960da5..3c36b046e 100644 --- a/ksplash/ksplashqml/SplashWindow.cpp +++ b/ksplash/ksplashqml/SplashWindow.cpp @@ -27,6 +27,7 @@ #include #include #include +#include SplashWindow::SplashWindow(bool testing, bool window) : QQuickView(), @@ -85,10 +86,10 @@ void SplashWindow::setGeometry(const QRect& rect) QQuickView::setGeometry(rect); if (oldGeometryEmpty) { - QString themePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, - QStringLiteral("ksplash/Themes/") + QApplication::arguments().at(1), - QStandardPaths::LocateDirectory); + ShellPluginLoader::init(); + Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/LookAndFeel"); + pkg.setPath("org.kde.lookandfeel"); - setSource(QUrl(themePath + QStringLiteral("/main.qml"))); + setSource(QUrl::fromLocalFile(pkg.filePath("splashmainscript"))); } } diff --git a/ksplash/ksplashqml/shellpluginloader.h b/ksplash/ksplashqml/shellpluginloader.h new file mode 100644 index 000000000..9c0f62412 --- /dev/null +++ b/ksplash/ksplashqml/shellpluginloader.h @@ -0,0 +1,37 @@ +/* + * Copyright 2013 Marco Martin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef SHELLPLUGINLOADER_H +#define SHELLPLUGINLOADER_H + +#include + +class ShellPluginLoader : public Plasma::PluginLoader +{ +public: + ShellPluginLoader(); + ~ShellPluginLoader(); + + static void init(); + +protected: + Plasma::Package internalLoadPackage(const QString &packageFormat, const QString &specialization); +}; + +#endif diff --git a/ksplash/ksplashqml/themes/Breeze/Theme.rc b/ksplash/ksplashqml/themes/Breeze/Theme.rc deleted file mode 100644 index 5f66aa3d7..000000000 --- a/ksplash/ksplashqml/themes/Breeze/Theme.rc +++ /dev/null @@ -1,9 +0,0 @@ -[KSplash Theme: Breeze] -Name = Breeze splash screen -Description = Swoosh -Version = 1.0 -Author = David Edmundson -Homepage = http://www.kde.org - -# Theme behaviour settings. -Engine = KSplashQML diff --git a/ksplash/ksplashqml/themes/Breeze/main.qml b/ksplash/ksplashqml/themes/Breeze/main.qml deleted file mode 100644 index 456554501..000000000 --- a/ksplash/ksplashqml/themes/Breeze/main.qml +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2014 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, - * or (at your option) any later version, as published by the Free - * Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.1 - - -Image { - id: root - source: "images/background.png" - - property int stage - - onStageChanged: { - if (stage == 1) { - introAnimation.running = true - } - } - - Rectangle { - id: topRect - width: parent.width - height: (root.height / 3) - bottomRect.height - 2 - y: root.height - color: "black" - opacity: 0.3 - Image { - source: "images/kde.svgz" - anchors.centerIn: parent - } - } - - Rectangle { - id: bottomRect - width: parent.width - y: -height - height: 50 - color: "black" - opacity: 0.3 - - Rectangle { - radius: 5 - border.color: "white" - color: "transparent" - anchors { - horizontalCenter: parent.horizontalCenter - top: parent.top - bottom: parent.bottom - margins: 12 - } - width: height * 10 - Rectangle { - radius: 3 - anchors { - left: parent.left - top: parent.top - bottom: parent.bottom - margins: 2 - } - width: ((parent.width - 4) / 5) * (stage - 1) - Behavior on width { - PropertyAnimation { - duration: 250 - easing.type: Easing.InOutQuad - } - } - } - } - } - - SequentialAnimation { - id: introAnimation - running: false - - ParallelAnimation { - PropertyAnimation { - property: "y" - target: topRect - to: root.height / 3 - duration: 1000 - easing.type: Easing.InOutBack - easing.overshoot: 1.0 - } - - PropertyAnimation { - property: "y" - target: bottomRect - to: 2 * (root.height / 3) - bottomRect.height - duration: 1000 - easing.type: Easing.InOutBack - easing.overshoot: 1.0 - } - } - } -} diff --git a/ksplash/ksplashqml/themes/CMakeLists.txt b/ksplash/ksplashqml/themes/CMakeLists.txt index 2107658bf..d089db8b8 100644 --- a/ksplash/ksplashqml/themes/CMakeLists.txt +++ b/ksplash/ksplashqml/themes/CMakeLists.txt @@ -1,3 +1,2 @@ add_subdirectory(Minimalistic) add_subdirectory(Classic) -add_subdirectory(Breeze) diff --git a/ksplash/ksplashqml/themes/Breeze/CMakeLists.txt b/lookandfeel/contents/splash/CMakeLists.txt similarity index 100% rename from ksplash/ksplashqml/themes/Breeze/CMakeLists.txt rename to lookandfeel/contents/splash/CMakeLists.txt diff --git a/lookandfeel/contents/splash/Splash.qml b/lookandfeel/contents/splash/Splash.qml index e69de29bb..456554501 100644 --- a/lookandfeel/contents/splash/Splash.qml +++ b/lookandfeel/contents/splash/Splash.qml @@ -0,0 +1,110 @@ +/* + * Copyright 2014 Marco Martin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * or (at your option) any later version, as published by the Free + * Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.1 + + +Image { + id: root + source: "images/background.png" + + property int stage + + onStageChanged: { + if (stage == 1) { + introAnimation.running = true + } + } + + Rectangle { + id: topRect + width: parent.width + height: (root.height / 3) - bottomRect.height - 2 + y: root.height + color: "black" + opacity: 0.3 + Image { + source: "images/kde.svgz" + anchors.centerIn: parent + } + } + + Rectangle { + id: bottomRect + width: parent.width + y: -height + height: 50 + color: "black" + opacity: 0.3 + + Rectangle { + radius: 5 + border.color: "white" + color: "transparent" + anchors { + horizontalCenter: parent.horizontalCenter + top: parent.top + bottom: parent.bottom + margins: 12 + } + width: height * 10 + Rectangle { + radius: 3 + anchors { + left: parent.left + top: parent.top + bottom: parent.bottom + margins: 2 + } + width: ((parent.width - 4) / 5) * (stage - 1) + Behavior on width { + PropertyAnimation { + duration: 250 + easing.type: Easing.InOutQuad + } + } + } + } + } + + SequentialAnimation { + id: introAnimation + running: false + + ParallelAnimation { + PropertyAnimation { + property: "y" + target: topRect + to: root.height / 3 + duration: 1000 + easing.type: Easing.InOutBack + easing.overshoot: 1.0 + } + + PropertyAnimation { + property: "y" + target: bottomRect + to: 2 * (root.height / 3) - bottomRect.height + duration: 1000 + easing.type: Easing.InOutBack + easing.overshoot: 1.0 + } + } + } +} diff --git a/ksplash/ksplashqml/themes/Breeze/images/background.png b/lookandfeel/contents/splash/images/background.png similarity index 100% rename from ksplash/ksplashqml/themes/Breeze/images/background.png rename to lookandfeel/contents/splash/images/background.png diff --git a/ksplash/ksplashqml/themes/Breeze/images/kde.svgz b/lookandfeel/contents/splash/images/kde.svgz similarity index 100% rename from ksplash/ksplashqml/themes/Breeze/images/kde.svgz rename to lookandfeel/contents/splash/images/kde.svgz