From 125bf42d84c269ee90a88257e088e2c71f310b36 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Wed, 29 Mar 2017 08:58:16 +0200 Subject: initial theme component --- components/CMakeLists.txt | 1 + components/theme/contents/ui/Colors.qml | 34 +++++++++++++++++++++++++++++++++ components/theme/contents/ui/main.qml | 23 ++++++++++++++++++++++ components/theme/metadata.desktop | 8 ++++++++ components/theme/qmldir | 3 +++ 5 files changed, 69 insertions(+) create mode 100644 components/theme/contents/ui/Colors.qml create mode 100644 components/theme/contents/ui/main.qml create mode 100644 components/theme/metadata.desktop create mode 100644 components/theme/qmldir diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 882d25b0..4db24fc8 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -35,6 +35,7 @@ install(DIRECTORY package/contents/ui/ DESTINATION ${QML_INSTALL_DIR}/org/kube/c install_component(mail) install_component(accounts) install_component(mailviewer) +install_component(theme) include(${CMAKE_SOURCE_DIR}/KF5KirigamiMacros.cmake) kirigami_package_breeze_icons(ICONS applications-graphics view-list-icons folder-sync view-list-details configure document-edit dialog-cancel document-decrypt mail-reply-sender bookmarks folder) diff --git a/components/theme/contents/ui/Colors.qml b/components/theme/contents/ui/Colors.qml new file mode 100644 index 00000000..8191c9a8 --- /dev/null +++ b/components/theme/contents/ui/Colors.qml @@ -0,0 +1,34 @@ +/* + Copyright (C) 2017 Michael Bohlender, + + 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 of the License, 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. +*/ + +pragma Singleton + +import QtQuick 2.7 + +Item { + property string textColor: "#31363b" + property string disabledTextColor: "#7f8c8d" + property string backgroundColor: "#eff0f1" + property string viewBackgroundColor: "#fcfcfc" + property string highlightColor: "#3daee9" + +// property string positveColor: "" +// property string warningColor: "" +// property string negativeColor: "" +} + diff --git a/components/theme/contents/ui/main.qml b/components/theme/contents/ui/main.qml new file mode 100644 index 00000000..c3c7ac8f --- /dev/null +++ b/components/theme/contents/ui/main.qml @@ -0,0 +1,23 @@ + +import QtQuick 2.7 +import QtQuick.Layouts 1.2 + +import org.kube.components.theme 1.0 as KubeTheme + +Item { + height: 200 + width: 200 + + RowLayout { + + anchors.fill: parent + + Rectangle { + + height: 50 + width: 50 + + color: KubeTheme.Colors.text + } + } +} diff --git a/components/theme/metadata.desktop b/components/theme/metadata.desktop new file mode 100644 index 00000000..359990d1 --- /dev/null +++ b/components/theme/metadata.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Kube Theme +X-KDE-PluginInfo-Name=org.kube.components.theme +Exec=kpackagelauncherqml -a org.kube.components.theme +X-Plasma-MainScript=ui/main.qml +X-KDE-ServiceTypes=KPackage/GenericQML +Icon=kmail2 +Type=Service diff --git a/components/theme/qmldir b/components/theme/qmldir new file mode 100644 index 00000000..29cb06d9 --- /dev/null +++ b/components/theme/qmldir @@ -0,0 +1,3 @@ +module org.kube.components.theme + +singleton Colors 1.0 Colors.qml -- cgit v1.2.3