From 7c7a755f2d87d672ee8afc7d5656971297539fe3 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 10 Mar 2016 12:12:31 +0100 Subject: Theme plugin with colorpalette --- components/package/contents/ui/FocusComposer.qml | 4 +- framework/theme/CMakeLists.txt | 13 +++++++ framework/theme/colorpalette.cpp | 45 +++++++++++++++++++++++ framework/theme/colorpalette.h | 47 ++++++++++++++++++++++++ framework/theme/qmldir | 3 ++ framework/theme/themeplugin.cpp | 40 ++++++++++++++++++++ framework/theme/themeplugin.h | 31 ++++++++++++++++ 7 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 framework/theme/CMakeLists.txt create mode 100644 framework/theme/colorpalette.cpp create mode 100644 framework/theme/colorpalette.h create mode 100644 framework/theme/qmldir create mode 100644 framework/theme/themeplugin.cpp create mode 100644 framework/theme/themeplugin.h diff --git a/components/package/contents/ui/FocusComposer.qml b/components/package/contents/ui/FocusComposer.qml index 8ec01cc9..5c4d88d7 100644 --- a/components/package/contents/ui/FocusComposer.qml +++ b/components/package/contents/ui/FocusComposer.qml @@ -19,13 +19,15 @@ import QtQuick 2.4 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.1 +import org.kube.framework.theme 1.0 + Rectangle { id: root property variant originalMessage visible: false - color: colorPalette.border + color: ColorPalette.border opacity: 0.9 diff --git a/framework/theme/CMakeLists.txt b/framework/theme/CMakeLists.txt new file mode 100644 index 00000000..4314f662 --- /dev/null +++ b/framework/theme/CMakeLists.txt @@ -0,0 +1,13 @@ +set(themeplugin_SRCS + themeplugin.cpp + colorpalette.cpp +) + +add_library(themeplugin SHARED ${themeplugin_SRCS}) + +qt5_use_modules(themeplugin Core Quick Qml) + +target_link_libraries(themeplugin) + +install(TARGETS themeplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/framework/theme) +install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/framework/theme) diff --git a/framework/theme/colorpalette.cpp b/framework/theme/colorpalette.cpp new file mode 100644 index 00000000..a321a292 --- /dev/null +++ b/framework/theme/colorpalette.cpp @@ -0,0 +1,45 @@ +/* + Copyright (C) 2016 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. +*/ + +#include "colorpalette.h" + +ColorPalette::ColorPalette(QObject *parent) : QObject(parent), m_background("#fcfcfc"), m_selected("#3daee9"), m_read("#232629"), m_border("#232629") +{ + +} + +QString ColorPalette::background() const +{ + return m_background; +} + +QString ColorPalette::read() const +{ + return m_read; +} + +QString ColorPalette::selected() const +{ + return m_selected; +} + +QString ColorPalette::border() const +{ + return m_border; +} + diff --git a/framework/theme/colorpalette.h b/framework/theme/colorpalette.h new file mode 100644 index 00000000..a06783f3 --- /dev/null +++ b/framework/theme/colorpalette.h @@ -0,0 +1,47 @@ +/* + Copyright (C) 2016 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. +*/ + +#include +#include + +class ColorPalette : public QObject +{ + Q_OBJECT + + Q_PROPERTY (QString background READ background NOTIFY themeChanged) + Q_PROPERTY (QString selected READ background NOTIFY themeChanged) + Q_PROPERTY (QString read READ read NOTIFY themeChanged) + Q_PROPERTY (QString border READ border NOTIFY themeChanged) + +public: + explicit ColorPalette(QObject *parent = Q_NULLPTR); + + QString background() const; + QString selected() const; + QString read() const; + QString border() const; + +signals: + void themeChanged(); + +private: + QString m_background; + QString m_selected; + QString m_read; + QString m_border; +}; diff --git a/framework/theme/qmldir b/framework/theme/qmldir new file mode 100644 index 00000000..489a71ca --- /dev/null +++ b/framework/theme/qmldir @@ -0,0 +1,3 @@ +module org.kube.framework.theme + +plugin themeplugin diff --git a/framework/theme/themeplugin.cpp b/framework/theme/themeplugin.cpp new file mode 100644 index 00000000..919205cf --- /dev/null +++ b/framework/theme/themeplugin.cpp @@ -0,0 +1,40 @@ +/* + Copyright (C) 2016 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. +*/ + +#include "themeplugin.h" + +#include "colorpalette.h" + +#include +#include + +static QObject *colorpaletteInstace(QQmlEngine *engine, QJSEngine *scriptEngine) +{ + Q_UNUSED(engine); + Q_UNUSED(scriptEngine); + + return new ColorPalette; +} + +void ThemePlugin::registerTypes (const char *uri) +{ + Q_ASSERT(uri == QLatin1String("org.kube.framework.theme")); + + qmlRegisterSingletonType(uri, 1, 0, "ColorPalette", colorpaletteInstace); + +} diff --git a/framework/theme/themeplugin.h b/framework/theme/themeplugin.h new file mode 100644 index 00000000..d8ae43c1 --- /dev/null +++ b/framework/theme/themeplugin.h @@ -0,0 +1,31 @@ +/* + Copyright (C) 2016 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 once + +#include +#include + +class ThemePlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + virtual void registerTypes(const char *uri); +}; \ No newline at end of file -- cgit v1.2.3 From 581f2d772c3fe7226a56c0c24aa70f8676aa250b Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 10 Mar 2016 12:16:15 +0100 Subject: add themeplugin to cmake --- framework/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt index be137441..d795e992 100644 --- a/framework/CMakeLists.txt +++ b/framework/CMakeLists.txt @@ -40,5 +40,7 @@ add_subdirectory(actions) add_subdirectory(settings) # Domain specific domain logic add_subdirectory(domain) +# Theme specfic things like colors +add_subdirectory(theme) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) -- cgit v1.2.3 From 73b2621624c87528ce776b74555ec98c56115661 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 10 Mar 2016 12:41:52 +0100 Subject: remove Colorpalette.qml and change its use to the theme plugin --- .../package/contents/ui/MaildirAccountSettings.qml | 8 +++---- components/mail/contents/ui/main.qml | 4 ---- components/package/contents/ui/ColorPalette.qml | 26 ---------------------- components/package/contents/ui/FocusComposer.qml | 4 ++-- components/package/contents/ui/MailListView.qml | 1 - components/package/contents/ui/Settings.qml | 5 +++-- components/package/contents/ui/SingleMailView.qml | 3 ++- components/qmldir | 1 - 8 files changed, 10 insertions(+), 42 deletions(-) delete mode 100644 components/package/contents/ui/ColorPalette.qml diff --git a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml index a2564500..99814a06 100644 --- a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml +++ b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml @@ -20,18 +20,16 @@ import QtQuick.Controls 1.4 import QtQuick.Layouts 1.1 import org.kube.framework.settings 1.0 as KubeSettings +import org.kube.framework.theme 1.0 import org.kde.kube.accounts.maildir 1.0 as MaildirAccount -import org.kube.components 1.0 as KubeComponents + Rectangle { id: root property string accountId property string accountName: "Maildir" - KubeComponents.ColorPalette { - id: colorPalette - } - color: colorPalette.background + color: ColorPalette.background GridLayout { id: gridLayout diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml index 8f2d3c52..181174d2 100644 --- a/components/mail/contents/ui/main.qml +++ b/components/mail/contents/ui/main.qml @@ -193,9 +193,5 @@ ApplicationWindow { id: unit property int size: 5 } - - KubeComponents.ColorPalette { - id: colorPalette - } } diff --git a/components/package/contents/ui/ColorPalette.qml b/components/package/contents/ui/ColorPalette.qml deleted file mode 100644 index db85cac6..00000000 --- a/components/package/contents/ui/ColorPalette.qml +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2015 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 3 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, see . - */ - -import QtQuick 2.4 - -//TODO probably expose it from the Cpp side -Item { - property string background: "#fcfcfc" - property string selected: "#3daee9" - property string read: "#232629" - property string border: "#232629" -} \ No newline at end of file diff --git a/components/package/contents/ui/FocusComposer.qml b/components/package/contents/ui/FocusComposer.qml index 5c4d88d7..bc8b3f2d 100644 --- a/components/package/contents/ui/FocusComposer.qml +++ b/components/package/contents/ui/FocusComposer.qml @@ -45,7 +45,7 @@ Rectangle { height: root.height * 0.8 width: root.width * 0.8 - color: colorPalette.background + color: ColorPalette.background MouseArea { anchors.fill: parent @@ -80,4 +80,4 @@ Rectangle { } } } -} \ No newline at end of file +} diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml index 8b612c52..bf5185dc 100644 --- a/components/package/contents/ui/MailListView.qml +++ b/components/package/contents/ui/MailListView.qml @@ -72,7 +72,6 @@ ScrollView { anchors.fill: parent - // color: colorPalette.read color: "steelblue" opacity: 0.1 diff --git a/components/package/contents/ui/Settings.qml b/components/package/contents/ui/Settings.qml index 692ddd0a..fa886f2b 100644 --- a/components/package/contents/ui/Settings.qml +++ b/components/package/contents/ui/Settings.qml @@ -23,13 +23,14 @@ import org.kde.plasma.core 2.0 as PlasmaCore import org.kube.framework.settings 1.0 as KubeSettings import org.kube.framework.domain 1.0 as KubeFramework +import org.kube.framework.theme 1.0 Rectangle { id: root visible: false - color: colorPalette.border + color: ColorPalette.border opacity: 0.9 @@ -47,7 +48,7 @@ Rectangle { height: root.height * 0.8 width: root.width * 0.8 - color: colorPalette.background + color: ColorPalette.background MouseArea { anchors.fill: parent diff --git a/components/package/contents/ui/SingleMailView.qml b/components/package/contents/ui/SingleMailView.qml index ff48a9d3..4b801a89 100644 --- a/components/package/contents/ui/SingleMailView.qml +++ b/components/package/contents/ui/SingleMailView.qml @@ -20,6 +20,7 @@ import QtQuick.Controls 1.3 import QtQuick.Layouts 1.1 import org.kube.framework.domain 1.0 as KubeFramework +import org.kube.framework.theme 1.0 Item { id: root @@ -30,7 +31,7 @@ Item { anchors.fill: parent - color: colorPalette.background + color: ColorPalette.background } Repeater { diff --git a/components/qmldir b/components/qmldir index 204beff8..e9a70bc5 100644 --- a/components/qmldir +++ b/components/qmldir @@ -1,6 +1,5 @@ module org.kube.components -ColorPalette 1.0 ColorPalette.qml FocusComposer 1.0 FocusComposer.qml SingleMailView 1.0 SingleMailView.qml FolderListView 1.0 FolderListView.qml -- cgit v1.2.3 From 181b39ddd0b3c027341b228ab51482ce4413d3bb Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 10 Mar 2016 13:54:07 +0100 Subject: add scaling unit to the theme plugin and use it instaed of the main.qml unit item --- components/mail/contents/ui/main.qml | 19 +++++------- components/package/contents/ui/FocusComposer.qml | 2 +- components/package/contents/ui/FolderListView.qml | 9 +++--- components/package/contents/ui/ListItem.qml | 5 +-- components/package/contents/ui/MailListView.qml | 17 +++++----- components/package/contents/ui/Settings.qml | 2 +- framework/theme/CMakeLists.txt | 1 + framework/theme/themeplugin.cpp | 14 +++++++-- framework/theme/unit.cpp | 29 +++++++++++++++++ framework/theme/unit.h | 38 +++++++++++++++++++++++ 10 files changed, 106 insertions(+), 30 deletions(-) create mode 100644 framework/theme/unit.cpp create mode 100644 framework/theme/unit.h diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml index 181174d2..d864f2fc 100644 --- a/components/mail/contents/ui/main.qml +++ b/components/mail/contents/ui/main.qml @@ -22,6 +22,7 @@ import org.kde.plasma.components 2.0 as PlasmaComponents import org.kube.framework.actions 1.0 as KubeAction import org.kube.framework.settings 1.0 as KubeSettings +import org.kube.framework.theme 1.0 import org.kube.components 1.0 as KubeComponents ApplicationWindow { @@ -154,17 +155,17 @@ ApplicationWindow { KubeComponents.FolderListView { id: folderListView - width: unit.size * 55 - Layout.maximumWidth: unit.size * 150 - Layout.minimumWidth: unit.size * 30 + width: Unit.size * 55 + Layout.maximumWidth: Unit.size * 150 + Layout.minimumWidth: Unit.size * 30 } KubeComponents.MailListView { id: mailListView parentFolder: folderListView.currentFolder - width: unit.size * 80 - Layout.maximumWidth: unit.size * 250 - Layout.minimumWidth: unit.size * 50 + width: Unit.size * 80 + Layout.maximumWidth: Unit.size * 250 + Layout.minimumWidth: Unit.size * 50 focus: true } @@ -187,11 +188,5 @@ ApplicationWindow { anchors.fill: parent } - - //TODO find a better way to scale UI - Item { - id: unit - property int size: 5 - } } diff --git a/components/package/contents/ui/FocusComposer.qml b/components/package/contents/ui/FocusComposer.qml index bc8b3f2d..ab04dbed 100644 --- a/components/package/contents/ui/FocusComposer.qml +++ b/components/package/contents/ui/FocusComposer.qml @@ -55,7 +55,7 @@ Rectangle { anchors { fill: parent - margins: unit.size * 3 + margins: Unit.size * 3 } Composer { diff --git a/components/package/contents/ui/FolderListView.qml b/components/package/contents/ui/FolderListView.qml index d78531a2..fafc1623 100644 --- a/components/package/contents/ui/FolderListView.qml +++ b/components/package/contents/ui/FolderListView.qml @@ -24,6 +24,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.kube.framework.domain 1.0 as KubeFramework +import org.kube.framework.theme 1.0 Item { id: root @@ -34,7 +35,7 @@ Item { id: searchBox width: root.width - height: unit.size * 10 + height: Unit.size * 10 TextField { anchors. centerIn: parent @@ -68,7 +69,7 @@ Item { style: TreeViewStyle { activateItemOnSingleClick: true rowDelegate: Rectangle { - height: unit.size * 10 + height: Unit.size * 10 color: "transparent" } itemDelegate: Rectangle { @@ -81,7 +82,7 @@ Item { anchors { verticalCenter: parent.verticalCenter left: parent.left - leftMargin: unit.size * 3 + leftMargin: Unit.size * 3 } source: model.icon } @@ -89,7 +90,7 @@ Item { anchors { verticalCenter: parent.verticalCenter left: iconItem.right - leftMargin: unit.size * 3 + leftMargin: Unit.size * 3 } renderType: Text.NativeRendering text: styleData.value diff --git a/components/package/contents/ui/ListItem.qml b/components/package/contents/ui/ListItem.qml index 5396645d..bea3c11b 100644 --- a/components/package/contents/ui/ListItem.qml +++ b/components/package/contents/ui/ListItem.qml @@ -16,13 +16,14 @@ */ import QtQuick 2.4 +import org.kube.framework.theme 1.0 Item { id: delegateRoot readonly property bool isCurrentItem: ListView.isCurrentItem - height: unit.width * 25 + height: Unit.width * 25 width: parent.width MouseArea { @@ -60,4 +61,4 @@ Item { opacity: 0.2 } } -} \ No newline at end of file +} diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml index bf5185dc..e7fc634f 100644 --- a/components/package/contents/ui/MailListView.qml +++ b/components/package/contents/ui/MailListView.qml @@ -24,6 +24,7 @@ import QtQml 2.2 import org.kde.plasma.components 2.0 as PlasmaComponents import org.kube.framework.domain 1.0 as KubeFramework +import org.kube.framework.theme 1.0 ScrollView { id: root @@ -47,7 +48,7 @@ ScrollView { delegate: PlasmaComponents.ListItem { width: listView.width - height: unit.size * 12 + height: Unit.size * 12 enabled: true checked: listView.currentIndex == index @@ -84,10 +85,10 @@ ScrollView { anchors { verticalCenter: parent.verticalCenter left: parent.left - leftMargin: unit.size * 2 + leftMargin: Unit.size * 2 } - height: unit.size * 9 + height: Unit.size * 9 width: height name: model.senderName @@ -99,7 +100,7 @@ ScrollView { anchors { top: avatar.top left: avatar.right - leftMargin: unit.size * 3 + leftMargin: Unit.size * 3 } text: model.senderName @@ -114,9 +115,9 @@ ScrollView { // anchors { // top: avatar.top // left: senderName.right - // leftMargin: unit.size + // leftMargin: Unit.size // right: date.left - // rightMargin: unit.size + // rightMargin: Unit.size // } // // text: "(" + model.sender +")" @@ -130,7 +131,7 @@ ScrollView { anchors { top: avatar.top right: parent.right - rightMargin: unit.size * 2 + rightMargin: Unit.size * 2 } text: Qt.formatDateTime(model.date) @@ -144,7 +145,7 @@ ScrollView { anchors { bottom: avatar.bottom left: avatar.right - leftMargin: unit.size * 3 + leftMargin: Unit.size * 3 } text: model.subject diff --git a/components/package/contents/ui/Settings.qml b/components/package/contents/ui/Settings.qml index fa886f2b..bada1140 100644 --- a/components/package/contents/ui/Settings.qml +++ b/components/package/contents/ui/Settings.qml @@ -75,7 +75,7 @@ Rectangle { anchors { verticalCenter: parent.verticalCenter left: parent.left - // leftMargin: unit.size * 3 + // leftMargin: Unit.size * 3 } source: accountFactory.icon } diff --git a/framework/theme/CMakeLists.txt b/framework/theme/CMakeLists.txt index 4314f662..319e3d39 100644 --- a/framework/theme/CMakeLists.txt +++ b/framework/theme/CMakeLists.txt @@ -1,6 +1,7 @@ set(themeplugin_SRCS themeplugin.cpp colorpalette.cpp + unit.cpp ) add_library(themeplugin SHARED ${themeplugin_SRCS}) diff --git a/framework/theme/themeplugin.cpp b/framework/theme/themeplugin.cpp index 919205cf..ad9d0e1b 100644 --- a/framework/theme/themeplugin.cpp +++ b/framework/theme/themeplugin.cpp @@ -18,11 +18,12 @@ #include "themeplugin.h" -#include "colorpalette.h" - #include #include +#include "colorpalette.h" +#include "unit.h" + static QObject *colorpaletteInstace(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine); @@ -31,10 +32,19 @@ static QObject *colorpaletteInstace(QQmlEngine *engine, QJSEngine *scriptEngine) return new ColorPalette; } +static QObject *unitInstace(QQmlEngine *engine, QJSEngine *scriptEngine) +{ + Q_UNUSED(engine); + Q_UNUSED(scriptEngine); + + return new Unit; +} + void ThemePlugin::registerTypes (const char *uri) { Q_ASSERT(uri == QLatin1String("org.kube.framework.theme")); qmlRegisterSingletonType(uri, 1, 0, "ColorPalette", colorpaletteInstace); + qmlRegisterSingletonType(uri, 1, 0, "Unit", unitInstace); } diff --git a/framework/theme/unit.cpp b/framework/theme/unit.cpp new file mode 100644 index 00000000..1f3803cb --- /dev/null +++ b/framework/theme/unit.cpp @@ -0,0 +1,29 @@ +/* + Copyright (C) 2016 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. +*/ + +#include "unit.h" + +Unit::Unit(QObject *parent) : QObject(parent), m_size(5) +{ + +} + +int Unit::size() const +{ + return m_size; +} \ No newline at end of file diff --git a/framework/theme/unit.h b/framework/theme/unit.h new file mode 100644 index 00000000..bd9b58f0 --- /dev/null +++ b/framework/theme/unit.h @@ -0,0 +1,38 @@ +/* + Copyright (C) 2016 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. +*/ + +#include + + +class Unit : public QObject +{ + Q_OBJECT + Q_PROPERTY (int size READ size NOTIFY unitChanged) + + +public: + explicit Unit(QObject *parent = Q_NULLPTR); + + int size() const; + +signals: + void unitChanged(); + +private: + int m_size; +}; -- cgit v1.2.3 From 1f1dbdf5af1af9a83d74113bbdf4132271d6ca51 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 10 Mar 2016 14:20:35 +0100 Subject: remove uses of plasma components where we have a qtquick controlls equivalent --- components/package/contents/ui/Composer.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/package/contents/ui/Composer.qml b/components/package/contents/ui/Composer.qml index 01991b67..c16bf582 100644 --- a/components/package/contents/ui/Composer.qml +++ b/components/package/contents/ui/Composer.qml @@ -97,7 +97,7 @@ Item { } } - PlasmaComponents.Button { + Button { id: ccButton text: "Cc" @@ -108,7 +108,7 @@ Item { } } - PlasmaComponents.Button { + Button { id: bccButton text: "Bcc" @@ -181,7 +181,7 @@ Item { height: subject.height * 1.5 - PlasmaComponents.Button { + Button { anchors { bottom: parent.bottom @@ -194,7 +194,7 @@ Item { } } - PlasmaComponents.Button { + Button { anchors { bottom: parent.bottom @@ -217,7 +217,7 @@ Item { model: composer.attachments - delegate: PlasmaComponents.Label { + delegate: Label { id: name text: modelData -- cgit v1.2.3