From 5755ad47145d2985ba74354961b4127d82c516f6 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 5 Apr 2017 13:00:21 +0200 Subject: A single framework plugin --- framework/CMakeLists.txt | 61 +++++++++++-- framework/accounts/accountsplugin.cpp | 1 - framework/actions/actionplugin.cpp | 1 - framework/domain/CMakeLists.txt | 2 +- framework/domain/actions/tests/CMakeLists.txt | 2 +- framework/domain/mailplugin.cpp | 2 - framework/frameworkplugin.cpp | 72 +++++++++++++++ framework/frameworkplugin.h | 33 +++++++ framework/notifications/notificationplugin.cpp | 1 - framework/qml/AccountSwitcher.qml | 25 +++--- framework/qml/AttachmentDelegate.qml | 7 +- framework/qml/AutocompleteLineEdit.qml | 7 +- framework/qml/Button.qml | 5 +- framework/qml/ConversationView.qml | 116 ++++++++++++------------- framework/qml/EditAccount.qml | 9 +- framework/qml/EditAccountDialog.qml | 4 +- framework/qml/FocusComposer.qml | 4 +- framework/qml/FolderListView.qml | 44 +++++----- framework/qml/MailListView.qml | 67 +++++++------- framework/qml/MailViewer.qml | 4 +- framework/qml/Notification.qml | 83 ------------------ framework/qml/NotificationPopup.qml | 82 +++++++++++++++++ framework/qml/Outbox.qml | 33 ++++--- framework/qml/OverlayDialog.qml | 5 +- framework/qml/People.qml | 112 ++++++++++++------------ framework/qml/PositiveButton.qml | 11 ++- framework/qmldir | 8 +- framework/settings/settingsplugin.cpp | 1 - 28 files changed, 462 insertions(+), 340 deletions(-) create mode 100644 framework/frameworkplugin.cpp create mode 100644 framework/frameworkplugin.h delete mode 100644 framework/qml/Notification.qml create mode 100644 framework/qml/NotificationPopup.qml (limited to 'framework') diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt index ebe308c6..fda9b0a2 100644 --- a/framework/CMakeLists.txt +++ b/framework/CMakeLists.txt @@ -22,6 +22,7 @@ find_package(Sink CONFIG REQUIRED) find_package(KAsync CONFIG REQUIRED) find_package(QGpgme CONFIG REQUIRED) find_package(KF5Codecs CONFIG REQUIRED) +find_package(KF5Package CONFIG REQUIRED) set(CMAKE_AUTOMOC ON) add_definitions("-Wall -std=c++0x -g") @@ -34,18 +35,66 @@ enable_testing() set(SINK_RESOURCE_PLUGINS_PATH ${QT_PLUGIN_INSTALL_DIR}/sink/resources) set(FRAMEWORK_INSTALL_DIR ${QML_INSTALL_DIR}/org/kube/framework) -install(DIRECTORY qml DESTINATION ${FRAMEWORK_INSTALL_DIR}) +install(DIRECTORY qml/ DESTINATION ${FRAMEWORK_INSTALL_DIR}) install(FILES qmldir DESTINATION ${FRAMEWORK_INSTALL_DIR}) +set(SRCS + frameworkplugin.cpp + actions/action.cpp + actions/actionhandler.cpp + actions/actionbroker.cpp + actions/actionresult.cpp + actions/context.cpp + settings/settings.cpp + domain/attachmentmodel.cpp + domain/maillistmodel.cpp + domain/folderlistmodel.cpp + domain/actions/sinkactions.cpp + domain/objecttreesource.cpp + domain/stringhtmlwriter.cpp + domain/composercontroller.cpp + domain/messageparser.cpp + domain/messageparser_new.cpp + domain/messageparser_old.cpp + domain/mailtemplates.cpp + domain/modeltest.cpp + domain/retriever.cpp + domain/outboxmodel.cpp + domain/identitiesmodel.cpp + domain/recepientautocompletionmodel.cpp + domain/settings/accountsettings.cpp + domain/selector.cpp + domain/completer.cpp + domain/controller.cpp + domain/outboxcontroller.cpp + domain/mailcontroller.cpp + domain/foldercontroller.cpp + domain/mouseproxy.cpp + domain/contactcontroller.cpp + domain/peoplemodel.cpp + accounts/accountfactory.cpp + accounts/accountsmodel.cpp + notifications/notificationhandler.cpp +) + +add_library(frameworkplugin SHARED ${SRCS}) + +qt5_use_modules(frameworkplugin Core Quick Qml WebKitWidgets Test) +target_link_libraries(frameworkplugin sink mimetreeparser KF5::MimeTreeParser KF5::Codecs KF5::Package KAsync) + +install(TARGETS frameworkplugin DESTINATION ${FRAMEWORK_INSTALL_DIR}) + # The actions framework -add_subdirectory(actions) +#add_subdirectory(actions) # The settings framework -add_subdirectory(settings) +#add_subdirectory(settings) # Domain specific domain logic -add_subdirectory(domain) +#add_subdirectory(domain) # The accounts framework -add_subdirectory(accounts) +#add_subdirectory(accounts) # The notifications framework -add_subdirectory(notifications) +#add_subdirectory(notifications) +add_subdirectory(domain/actions/tests) +add_subdirectory(domain/mimetreeparser) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/framework/accounts/accountsplugin.cpp b/framework/accounts/accountsplugin.cpp index e980d5f3..211898d9 100644 --- a/framework/accounts/accountsplugin.cpp +++ b/framework/accounts/accountsplugin.cpp @@ -25,7 +25,6 @@ void AccountsPlugin::registerTypes (const char *uri) { - Q_ASSERT(uri == QLatin1String("org.kube.framework.accounts")); qmlRegisterType(uri, 1, 0, "AccountFactory"); qmlRegisterType(uri, 1, 0, "AccountsModel"); } diff --git a/framework/actions/actionplugin.cpp b/framework/actions/actionplugin.cpp index 05852d2e..b55504fc 100644 --- a/framework/actions/actionplugin.cpp +++ b/framework/actions/actionplugin.cpp @@ -9,7 +9,6 @@ void KubePlugin::registerTypes (const char *uri) { - Q_ASSERT(uri == QLatin1String("org.kube.framework.actions")); qmlRegisterType(uri, 1, 0, "Context"); qmlRegisterType(uri, 1, 0, "Action"); qmlRegisterType(uri, 1, 0, "ActionHandler"); diff --git a/framework/domain/CMakeLists.txt b/framework/domain/CMakeLists.txt index 38e0eb12..e1482301 100644 --- a/framework/domain/CMakeLists.txt +++ b/framework/domain/CMakeLists.txt @@ -34,8 +34,8 @@ add_library(mailplugin SHARED ${mailplugin_SRCS}) qt5_use_modules(mailplugin Core Quick Qml WebKitWidgets Test) target_link_libraries(mailplugin actionplugin settingsplugin sink mimetreeparser KF5::MimeTreeParser KF5::Codecs KF5::Package KAsync) -add_subdirectory(actions/tests) install(TARGETS mailplugin DESTINATION ${FRAMEWORK_INSTALL_DIR}) +add_subdirectory(actions/tests) add_subdirectory(mimetreeparser) diff --git a/framework/domain/actions/tests/CMakeLists.txt b/framework/domain/actions/tests/CMakeLists.txt index dc9d01b1..2c34d628 100644 --- a/framework/domain/actions/tests/CMakeLists.txt +++ b/framework/domain/actions/tests/CMakeLists.txt @@ -3,4 +3,4 @@ cmake_policy(SET CMP0063 NEW) add_executable(sinkactiontest sinkactiontest.cpp) add_test(sinkactiontest sinkactiontest) qt5_use_modules(sinkactiontest Core Test Concurrent) -target_link_libraries(sinkactiontest sink actionplugin KF5::Mime mailplugin) +target_link_libraries(sinkactiontest sink frameworkplugin KF5::Mime) diff --git a/framework/domain/mailplugin.cpp b/framework/domain/mailplugin.cpp index 12b9a7ce..b32832e0 100644 --- a/framework/domain/mailplugin.cpp +++ b/framework/domain/mailplugin.cpp @@ -37,8 +37,6 @@ void MailPlugin::registerTypes (const char *uri) { - Q_ASSERT(uri == QLatin1String("org.kube.framework.domain")); - qmlRegisterType(uri, 1, 0, "FolderListModel"); qmlRegisterType(uri, 1, 0, "MailListModel"); qmlRegisterType(uri, 1, 0, "ComposerController"); diff --git a/framework/frameworkplugin.cpp b/framework/frameworkplugin.cpp new file mode 100644 index 00000000..f491bae7 --- /dev/null +++ b/framework/frameworkplugin.cpp @@ -0,0 +1,72 @@ +/* + Copyright (c) 2016 Michael Bohlender + Copyright (c) 2016 Christian Mollekopf + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + This library 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 Library General Public + License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. +*/ + +#include "frameworkplugin.h" + +#include "domain/maillistmodel.h" +#include "domain/folderlistmodel.h" +#include "domain/composercontroller.h" +#include "domain/messageparser.h" +#include "domain/retriever.h" +#include "domain/outboxmodel.h" +#include "domain/outboxcontroller.h" +#include "domain/mailcontroller.h" +#include "domain/foldercontroller.h" +#include "domain/mouseproxy.h" +#include "domain/contactcontroller.h" +#include "domain/peoplemodel.h" +#include "accounts/accountsmodel.h" +#include "accounts/accountfactory.h" +#include "settings/settings.h" +#include "notifications/notificationhandler.h" +#include "actions/action.h" +#include "actions/context.h" +#include "actions/actionhandler.h" +#include "actions/actionresult.h" + +#include + +void FrameworkPlugin::registerTypes (const char *uri) +{ + qmlRegisterType(uri, 1, 0, "FolderListModel"); + qmlRegisterType(uri, 1, 0, "MailListModel"); + qmlRegisterType(uri, 1, 0, "ComposerController"); + qmlRegisterType(uri, 1, 0, "MessageParser"); + qmlRegisterType(uri, 1, 0, "Retriever"); + qmlRegisterType(uri, 1, 0, "OutboxController"); + qmlRegisterType(uri, 1, 0, "OutboxModel"); + qmlRegisterType(uri, 1, 0, "MailController"); + qmlRegisterType(uri, 1, 0, "FolderController"); + qmlRegisterType(uri, 1, 0, "MouseProxy"); + qmlRegisterType(uri, 1, 0,"ContactController"); + qmlRegisterType(uri, 1, 0,"PeopleModel"); + + qmlRegisterType(uri, 1, 0, "AccountFactory"); + qmlRegisterType(uri, 1, 0, "AccountsModel"); + + qmlRegisterType(uri, 1, 0, "Settings"); + qmlRegisterType(uri, 1, 0, "NotificationHandler"); + qmlRegisterType(uri, 1, 0, "Notification"); + + qmlRegisterType(uri, 1, 0, "Context"); + qmlRegisterType(uri, 1, 0, "Action"); + qmlRegisterType(uri, 1, 0, "ActionHandler"); + qmlRegisterType(uri, 1, 0, "ActionResult"); +} diff --git a/framework/frameworkplugin.h b/framework/frameworkplugin.h new file mode 100644 index 00000000..519e0ba9 --- /dev/null +++ b/framework/frameworkplugin.h @@ -0,0 +1,33 @@ +/* + Copyright (c) 2016 Michael Bohlender + Copyright (c) 2016 Christian Mollekopf + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + This library 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 Library General Public + License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. +*/ + +#pragma once + +#include +#include + +class FrameworkPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + virtual void registerTypes(const char *uri); +}; diff --git a/framework/notifications/notificationplugin.cpp b/framework/notifications/notificationplugin.cpp index a7a9aa5b..54548464 100644 --- a/framework/notifications/notificationplugin.cpp +++ b/framework/notifications/notificationplugin.cpp @@ -24,7 +24,6 @@ void NotificationPlugin::registerTypes (const char *uri) { - Q_ASSERT(uri == QLatin1String("org.kube.framework.notifications")); qmlRegisterType(uri, 1, 0, "NotificationHandler"); qmlRegisterType(uri, 1, 0, "Notification"); } diff --git a/framework/qml/AccountSwitcher.qml b/framework/qml/AccountSwitcher.qml index 0cd91adc..dd33c940 100644 --- a/framework/qml/AccountSwitcher.qml +++ b/framework/qml/AccountSwitcher.qml @@ -24,11 +24,8 @@ import QtQuick.Controls 1.4 as Controls import QtQml 2.2 as QtQml import org.kde.kirigami 1.0 as Kirigami +import org.kube.framework 1.0 as Kube -import org.kube.framework.domain 1.0 as KubeFramework -import org.kube.framework.accounts 1.0 as KubeAccounts -import org.kube.components 1.0 as KubeComponents -import org.kube.components.theme 1.0 as KubeTheme Controls.ToolButton { id: accountSwitcher @@ -38,12 +35,12 @@ Controls.ToolButton { width: parent.width - KubeFramework.FolderController { + Kube.FolderController { id: folderController accountId: accountId } - KubeAccounts.AccountsModel { + Kube.AccountsModel { id: accountsModel } @@ -88,7 +85,7 @@ Controls.ToolButton { } } - KubeComponents.PositiveButton { + Kube.PositiveButton { id: newAccountButton anchors { @@ -170,16 +167,16 @@ Controls.ToolButton { enabled: false states: [ State { - name: "busy"; when: model.status == KubeAccountsFramework.AccountsModel.BusyStatus - PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.busy; visible: true } + name: "busy"; when: model.status == Kube.AccountsModel.BusyStatus + PropertyChanges { target: statusIcon; iconName: Kube.Icons.busy; visible: true } }, State { - name: "error"; when: model.status == KubeAccountsFramework.AccountsModel.ErrorStatus - PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.error; visible: true } + name: "error"; when: model.status == Kube.AccountsModel.ErrorStatus + PropertyChanges { target: statusIcon; iconName: Kube.Icons.error; visible: true } }, State { - name: "checkmark"; when: model.status == KubeAccountsFramework.AccountsModel.ConnectedStatus - PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.connected; visible: true } + name: "checkmark"; when: model.status == Kube.AccountsModel.ConnectedStatus + PropertyChanges { target: statusIcon; iconName: Kube.Icons.connected; visible: true } } ] } @@ -203,7 +200,7 @@ Controls.ToolButton { Component { id: editAccountComponent - KubeComponents.EditAccountDialog { + Kube.EditAccountDialog { anchors.fill: parent } } diff --git a/framework/qml/AttachmentDelegate.qml b/framework/qml/AttachmentDelegate.qml index a589c9f3..9241efac 100644 --- a/framework/qml/AttachmentDelegate.qml +++ b/framework/qml/AttachmentDelegate.qml @@ -19,7 +19,6 @@ import QtQuick 2.7 import QtQuick.Layouts 1.1 import org.kde.kirigami 1.0 as Kirigami -import org.kube.components.theme 1.0 as KubeTheme Item { id: root @@ -34,7 +33,7 @@ Item { anchors.fill: parent id: background - color: KubeTheme.Colors.disabledTextColor + color: Kube.Colors.disabledTextColor } RowLayout { @@ -50,7 +49,7 @@ Item { height: Kirigami.Units.gridUnit width: Kirigami.Units.gridUnit - color: KubeTheme.Colors.backgroundColor + color: Kube.Colors.backgroundColor Kirigami.Icon { height: parent.height @@ -62,7 +61,7 @@ Item { Text { text: root.name - color: KubeTheme.Colors.backgroundColor + color: Kube.Colors.backgroundColor } } } diff --git a/framework/qml/AutocompleteLineEdit.qml b/framework/qml/AutocompleteLineEdit.qml index 64e5940f..c9b8e708 100644 --- a/framework/qml/AutocompleteLineEdit.qml +++ b/framework/qml/AutocompleteLineEdit.qml @@ -21,7 +21,6 @@ import QtQuick.Controls 2.0 as Controls2 import QtQuick.Layouts 1.1 import org.kde.kirigami 1.0 as Kirigami -import org.kube.components.theme 1.0 as KubeTheme Controls2.TextField { id: textField @@ -93,8 +92,8 @@ Controls2.TextField { height: listView.contentHeight width: textField.width - border.color: KubeTheme.Colors.textColor - color: KubeTheme.Colors.backgroundColor + border.color: Kube.Colors.textColor + color: Kube.Colors.backgroundColor radius: 5 ListView { @@ -132,7 +131,7 @@ Controls2.TextField { Text{ text: model.text - color: listDelegate.checked ? KubeTheme.Colors.highlightedTextColor : KubeTheme.Colors.textColor + color: listDelegate.checked ? Kube.Colors.highlightedTextColor : Kube.Colors.textColor } } } diff --git a/framework/qml/Button.qml b/framework/qml/Button.qml index 948312b0..4df1492a 100644 --- a/framework/qml/Button.qml +++ b/framework/qml/Button.qml @@ -17,14 +17,13 @@ */ import QtQuick 2.7 -import org.kube.components.theme 1.0 as KubeTheme Rectangle { id: root signal clicked() property alias text: text.text - property color textColor: KubeTheme.Colors.highlightedTextColor + property color textColor: Kube.Colors.highlightedTextColor property string iconName: "" property alias implicitHeight: content.implicitHeight property alias implicitWidth: content.implicitWidth @@ -36,7 +35,7 @@ Rectangle { Row { id: content anchors.centerIn: parent - spacing: KubeTheme.Units.smallSpacing + spacing: Kube.Units.smallSpacing Text { id: text anchors.verticalCenter: parent.verticalCenter diff --git a/framework/qml/ConversationView.qml b/framework/qml/ConversationView.qml index 4196ebbd..fc940e39 100644 --- a/framework/qml/ConversationView.qml +++ b/framework/qml/ConversationView.qml @@ -21,13 +21,11 @@ import QtQuick.Controls 1.3 as Controls1 import QtQuick.Controls 2 import QtQuick.Layouts 1.1 import org.kde.kirigami 1.0 as Kirigami +import org.kube.framework 1.0 as Kube import QtQml 2.2 as QtQml -import org.kube.framework.domain 1.0 as KubeFramework -import org.kube.framework.actions 1.0 as KubeAction -import org.kube.components.theme 1.0 as KubeTheme Rectangle { id: root @@ -44,7 +42,7 @@ Rectangle { currentMail = null; } - color: KubeTheme.Colors.backgroundColor + color: Kube.Colors.backgroundColor ListView { id: listView @@ -79,18 +77,18 @@ Rectangle { clip: true - model: KubeFramework.MailListModel { + model: Kube.MailListModel { mail: root.mail } header: Item { - height: KubeTheme.Units.gridUnit * 0.5 + height: Kube.Units.gridUnit * 0.5 width: parent.width } footer: Item { - height: KubeTheme.Units.gridUnit + height: Kube.Units.gridUnit width: parent.width } @@ -144,7 +142,7 @@ Rectangle { //which will break lot's of things. cacheBuffer: 100000 - KubeFramework.MailController { + Kube.MailController { id: mailController Binding on mail { //!! checks for the availability of the type @@ -167,7 +165,7 @@ Rectangle { //Intercept all scroll events, //necessary due to the webengineview - KubeFramework.MouseProxy { + Kube.MouseProxy { anchors.fill: parent target: listView forwardWheelEvents: true @@ -185,14 +183,14 @@ Rectangle { } } - height: sheet.height + KubeTheme.Units.gridUnit + height: sheet.height + Kube.Units.gridUnit width: parent.width Rectangle { id: sheet anchors.centerIn: parent - implicitHeight: header.height + attachments.height + body.height + incompleteBody.height + footer.height + KubeTheme.Units.largeSpacing - width: parent.width - KubeTheme.Units.gridUnit * 2 + implicitHeight: header.height + attachments.height + body.height + incompleteBody.height + footer.height + Kube.Units.largeSpacing + width: parent.width - Kube.Units.gridUnit * 2 //Overlay for non-active mails Rectangle { @@ -203,7 +201,7 @@ Rectangle { opacity: 0.2 } - color: KubeTheme.Colors.viewBackgroundColor + color: Kube.Colors.viewBackgroundColor //BEGIN header Item { @@ -213,10 +211,10 @@ Rectangle { top: parent.top left: parent.left right: parent.right - margins: KubeTheme.Units.largeSpacing + margins: Kube.Units.largeSpacing } - height: headerContent.height + KubeTheme.Units.smallSpacing + height: headerContent.height + Kube.Units.smallSpacing states: [ State { @@ -250,7 +248,7 @@ Rectangle { text: Qt.formatDateTime(model.date, "dd MMM yyyy hh:mm") font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.7 - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor opacity: 0.75 } @@ -262,7 +260,7 @@ Rectangle { horizontalCenter: parent.horizontalCenter } - //spacing: KubeTheme.Units.smallSpacing + //spacing: Kube.Units.smallSpacing width: parent.width @@ -271,7 +269,7 @@ Rectangle { width: parent.width - spacing: KubeTheme.Units.smallSpacing + spacing: Kube.Units.smallSpacing clip: true Text { @@ -280,7 +278,7 @@ Rectangle { text: model.senderName font.weight: Font.DemiBold - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor opacity: 0.75 } @@ -288,10 +286,10 @@ Rectangle { text: model.sender - width: parent.width - senderName.width - date_label.width - KubeTheme.Units.largeSpacing + width: parent.width - senderName.width - date_label.width - Kube.Units.largeSpacing elide: Text.ElideRight - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor opacity: 0.75 clip: true @@ -307,7 +305,7 @@ Rectangle { elide: Text.ElideRight - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor opacity: 0.75 font.italic: true } @@ -315,49 +313,49 @@ Rectangle { Text { id: recipients - width: parent.width - goDown.width - KubeTheme.Units.smallSpacing + width: parent.width - goDown.width - Kube.Units.smallSpacing text:"to: "+ model.to + " " + model.cc + " " + model.bcc elide: Text.ElideRight - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor opacity: 0.75 } Text { id: to - width: parent.width - goDown.width - KubeTheme.Units.smallSpacing + width: parent.width - goDown.width - Kube.Units.smallSpacing text:"to: " + model.to wrapMode: Text.WordWrap - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor opacity: 0.75 } Text { id: cc - width: parent.width - goDown.width - KubeTheme.Units.smallSpacing + width: parent.width - goDown.width - Kube.Units.smallSpacing text:"cc: " + model.cc wrapMode: Text.WordWrap - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor opacity: 0.75 } Text { id: bcc - width: parent.width - goDown.width - KubeTheme.Units.smallSpacing + width: parent.width - goDown.width - Kube.Units.smallSpacing text:"bcc: " + model.bcc wrapMode: Text.WordWrap - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor opacity: 0.75 } @@ -369,15 +367,15 @@ Rectangle { right: seperator.right } - height: KubeTheme.Units.gridUnit + height: Kube.Units.gridUnit width: height - color: KubeTheme.Colors.backgroundColor + color: Kube.Colors.backgroundColor Controls1.ToolButton { anchors.fill: parent - iconName: KubeTheme.Icons.goDown + iconName: Kube.Icons.goDown } } @@ -387,15 +385,15 @@ Rectangle { right: seperator.right } - height: KubeTheme.Units.gridUnit + height: Kube.Units.gridUnit width: height - color: KubeTheme.Colors.backgroundColor + color: Kube.Colors.backgroundColor Controls1.ToolButton { anchors.fill: parent - iconName: header.state === "details" ? KubeTheme.Icons.goUp : KubeTheme.Icons.goDown + iconName: header.state === "details" ? Kube.Icons.goUp : Kube.Icons.goDown onClicked: { header.state === "details" ? header.state = "small" : header.state = "details" @@ -414,7 +412,7 @@ Rectangle { height: 1 - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor opacity: 0.5 } } @@ -425,14 +423,14 @@ Rectangle { anchors { top: header.bottom - topMargin: KubeTheme.Units.smallSpacing + topMargin: Kube.Units.smallSpacing right: header.right } - width: header.width - KubeTheme.Units.largeSpacing + width: header.width - Kube.Units.largeSpacing layoutDirection: Qt.RightToLeft - spacing: KubeTheme.Units.smallSpacing + spacing: Kube.Units.smallSpacing clip: true Repeater { @@ -456,12 +454,12 @@ Rectangle { top: header.bottom left: header.left right: header.right - leftMargin: KubeTheme.Units.largeSpacing - rightMargin: KubeTheme.Units.largeSpacing - topMargin: Math.max(attachments.height, KubeTheme.Units.largeSpacing) + leftMargin: Kube.Units.largeSpacing + rightMargin: Kube.Units.largeSpacing + topMargin: Math.max(attachments.height, Kube.Units.largeSpacing) } - width: header.width - KubeTheme.Units.largeSpacing * 2 + width: header.width - Kube.Units.largeSpacing * 2 height: desiredHeight message: model.mimeMessage @@ -474,21 +472,21 @@ Rectangle { top: header.bottom left: header.left right: header.right - leftMargin: KubeTheme.Units.largeSpacing - rightMargin: KubeTheme.Units.largeSpacing - topMargin: Math.max(attachments.height, KubeTheme.Units.largeSpacing) + leftMargin: Kube.Units.largeSpacing + rightMargin: Kube.Units.largeSpacing + topMargin: Math.max(attachments.height, Kube.Units.largeSpacing) } visible: model.incomplete text: "Incomplete body..." - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor enabled: false states: [ State { - name: "inprogress"; when: model.status == KubeFramework.MailListModel.InProgressStatus + name: "inprogress"; when: model.status == Kube.MailListModel.InProgressStatus PropertyChanges { target: incompleteBody; text: "Downloading message..." } }, State { - name: "error"; when: model.status == KubeFramework.MailListModel.ErrorStatus + name: "error"; when: model.status == Kube.MailListModel.ErrorStatus PropertyChanges { target: incompleteBody; text: "Failed to download message..." } } ] @@ -498,23 +496,23 @@ Rectangle { anchors.bottom: parent.bottom - height: KubeTheme.Units.gridUnit * 2 + height: Kube.Units.gridUnit * 2 width: parent.width Text { anchors{ verticalCenter: parent.verticalCenter left: parent.left - leftMargin: KubeTheme.Units.largeSpacing + leftMargin: Kube.Units.largeSpacing } - KubeFramework.MailController { + Kube.MailController { id: mailController mail: model.mail } text: model.trash ? qsTr("Delete Mail") : qsTr("Move to trash") - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor opacity: 0.5 enabled: model.trash ? mailController.removeAction.enabled : mailController.moveToTrashAction.enabled MouseArea { @@ -535,10 +533,10 @@ Rectangle { anchors{ verticalCenter: parent.verticalCenter right: parent.right - rightMargin: KubeTheme.Units.largeSpacing + rightMargin: Kube.Units.largeSpacing } - KubeAction.Context { + Kube.Context { id: mailcontext property variant mail property bool isDraft @@ -546,19 +544,19 @@ Rectangle { isDraft: model.draft } - KubeAction.Action { + Kube.Action { id: replyAction actionId: "org.kde.kube.actions.reply" context: maillistcontext } - KubeAction.Action { + Kube.Action { id: editAction actionId: "org.kde.kube.actions.edit" context: maillistcontext } - iconName: model.draft ? KubeTheme.Icons.edit : KubeTheme.Icons.replyToSender + iconName: model.draft ? Kube.Icons.edit : Kube.Icons.replyToSender onClicked: { if (model.draft) { editAction.execute() diff --git a/framework/qml/EditAccount.qml b/framework/qml/EditAccount.qml index 8618ec91..a9a8c1ad 100644 --- a/framework/qml/EditAccount.qml +++ b/framework/qml/EditAccount.qml @@ -22,15 +22,14 @@ import QtQuick.Layouts 1.1 import QtQuick.Controls 1.4 as Controls import QtQuick.Controls 2.0 as Controls2 import org.kde.kirigami 1.0 as Kirigami +import org.kube.framework 1.0 as Kube -import org.kube.framework.accounts 1.0 as KubeAccounts -import org.kube.components.theme 1.0 as KubeTheme Item { id: root property string accountId - KubeAccounts.AccountFactory { + Kube.AccountFactory { id: accountFactory accountId: root.accountId } @@ -45,7 +44,7 @@ Item { Kirigami.Heading { id: heading text: loader.item.heading - color: KubeTheme.Colors.highlightColor + color: Kube.Colors.highlightColor } Kirigami.Label { @@ -58,7 +57,7 @@ Item { width: parent.width text: loader.item.subheadline - color: KubeTheme.Colors.disabledTextColor + color: Kube.Colors.disabledTextColor wrapMode: Text.Wrap } diff --git a/framework/qml/EditAccountDialog.qml b/framework/qml/EditAccountDialog.qml index a7461640..ab256839 100644 --- a/framework/qml/EditAccountDialog.qml +++ b/framework/qml/EditAccountDialog.qml @@ -20,10 +20,10 @@ import QtQuick 2.4 import QtQuick.Layouts 1.1 import org.kde.kirigami 1.0 as Kirigami +import org.kube.framework 1.0 as Kube -import org.kube.components 1.0 as KubeComponents -KubeComponents.OverlayDialog { +Kube.OverlayDialog { id: dialog property variant accountId diff --git a/framework/qml/FocusComposer.qml b/framework/qml/FocusComposer.qml index 902309a8..823ed32f 100644 --- a/framework/qml/FocusComposer.qml +++ b/framework/qml/FocusComposer.qml @@ -21,14 +21,14 @@ import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 as Controls2 import org.kde.kirigami 1.0 as Kirigami +import org.kube.framework 1.0 as Kube -import org.kube.framework.domain 1.0 as KubeFramework Controls2.Popup { id: root //Controller - KubeFramework.ComposerController { + Kube.ComposerController { id: composerController onDone: { clear(); diff --git a/framework/qml/FolderListView.qml b/framework/qml/FolderListView.qml index b35b52ed..39cc8ba4 100644 --- a/framework/qml/FolderListView.qml +++ b/framework/qml/FolderListView.qml @@ -22,9 +22,7 @@ import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.1 import org.kde.kirigami 1.0 as Kirigami -import org.kube.components 1.0 as KubeComponents -import org.kube.components.theme 1.0 as KubeTheme -import org.kube.framework.domain 1.0 as KubeFramework +import org.kube.framework 1.0 as Kube Rectangle { id: root @@ -32,9 +30,9 @@ Rectangle { property variant currentFolder: null property variant accountId - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor - KubeFramework.FolderController { + Kube.FolderController { id: folderController Binding on folder { //!! checks for the availability of the type @@ -71,14 +69,14 @@ Rectangle { role: "name" } - model: KubeFramework.FolderListModel { + model: Kube.FolderListModel { id: folderListModel accountId: root.accountId } onCurrentIndexChanged: { model.fetchMore(currentIndex) - root.currentFolder = model.data(currentIndex, KubeFramework.FolderListModel.DomainObject) + root.currentFolder = model.data(currentIndex, Kube.FolderListModel.DomainObject) } alternatingRowColors: false @@ -90,7 +88,7 @@ Rectangle { onClicked: { var index = parent.indexAt(mouse.x, mouse.y) if (index.valid) { - folderController.folder = treeView.model.data(index, KubeFramework.FolderListModel.DomainObject) + folderController.folder = treeView.model.data(index, Kube.FolderListModel.DomainObject) contextMenu.popup() } } @@ -99,7 +97,7 @@ Rectangle { style: TreeViewStyle { rowDelegate: Rectangle { - color: styleData.selected ? KubeTheme.Colors.highlightColor : KubeTheme.Colors.textColor + color: styleData.selected ? Kube.Colors.highlightColor : Kube.Colors.textColor height: Kirigami.Units.gridUnit * 1.5 width: 20 @@ -107,7 +105,7 @@ Rectangle { } frame: Rectangle { - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor } branchDelegate: Item { @@ -118,7 +116,7 @@ Rectangle { anchors.centerIn: parent - color: KubeTheme.Colors.viewBackgroundColor + color: Kube.Colors.viewBackgroundColor text: styleData.isExpanded ? "-" : "+" } @@ -127,14 +125,14 @@ Rectangle { itemDelegate: Rectangle { - color: styleData.selected ? KubeTheme.Colors.highlightColor : KubeTheme.Colors.textColor + color: styleData.selected ? Kube.Colors.highlightColor : Kube.Colors.textColor DropArea { anchors.fill: parent Rectangle { anchors.fill: parent - color: KubeTheme.Colors.viewBackgroundColor + color: Kube.Colors.viewBackgroundColor opacity: 0.3 @@ -162,34 +160,34 @@ Rectangle { text: styleData.value - color: KubeTheme.Colors.viewBackgroundColor + color: Kube.Colors.viewBackgroundColor } - KubeComponents.Icon { + Kube.Icon { id: statusIcon visible: false iconName: "" states: [ State { - name: "busy"; when: model.status == KubeFramework.FolderListModel.InProgressStatus - PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.busy ; visible: styleData.selected } + name: "busy"; when: model.status == Kube.FolderListModel.InProgressStatus + PropertyChanges { target: statusIcon; iconName: Kube.Icons.busy ; visible: styleData.selected } }, State { - name: "error"; when: model.status == KubeFramework.FolderListModel.ErrorStatus + name: "error"; when: model.status == Kube.FolderListModel.ErrorStatus //The error status should only be visible for a moment, otherwise we'll eventually always show errors everywhere. - PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.error; visible: styleData.selected } + PropertyChanges { target: statusIcon; iconName: Kube.Icons.error; visible: styleData.selected } }, State { - name: "checkmark"; when: model.status == KubeFramework.FolderListModel.SuccessStatus + name: "checkmark"; when: model.status == Kube.FolderListModel.SuccessStatus //The success status should only be visible for a moment, otherwise we'll eventually always show checkmarks everywhere. - PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.success; visible: styleData.selected } + PropertyChanges { target: statusIcon; iconName: Kube.Icons.success; visible: styleData.selected } } ] } } } - backgroundColor: KubeTheme.Colors.textColor - highlightedTextColor: KubeTheme.Colors.highlightedTextColor + backgroundColor: Kube.Colors.textColor + highlightedTextColor: Kube.Colors.highlightedTextColor } } } diff --git a/framework/qml/MailListView.qml b/framework/qml/MailListView.qml index 2d5d6601..28386442 100644 --- a/framework/qml/MailListView.qml +++ b/framework/qml/MailListView.qml @@ -21,8 +21,7 @@ import QtQuick.Controls 2.0 import QtQuick.Controls 1.4 as Controls import QtQuick.Layouts 1.1 -import org.kube.components.theme 1.0 as KubeTheme -import org.kube.framework.domain 1.0 as KubeFramework +import org.kube.framework 1.0 as Kube Item { id: root @@ -44,10 +43,10 @@ Item { Row { anchors.centerIn: parent - spacing: KubeTheme.Units.smallSpacing + spacing: Kube.Units.smallSpacing Controls.ToolButton { - iconName: KubeTheme.Icons.markAsRead + iconName: Kube.Icons.markAsRead text: qsTr("Mark As Read") enabled: mailController.markAsReadAction.enabled tooltip: qsTr("mark mail as read") @@ -57,7 +56,7 @@ Item { } Controls.ToolButton { - iconName: KubeTheme.Icons.markImportant + iconName: Kube.Icons.markImportant text: qsTr("Mark Important") enabled: mailController.markAsImportantAction.enabled tooltip: qsTr("mark mail as important") @@ -67,7 +66,7 @@ Item { } Controls.ToolButton { - iconName: KubeTheme.Icons.moveToTrash + iconName: Kube.Icons.moveToTrash text: qsTr("Delete Mail") enabled: mailController.moveToTrashAction.enabled tooltip: qsTr("delete email") @@ -77,7 +76,7 @@ Item { } Controls.ToolButton { - iconName: KubeTheme.Icons.undo + iconName: Kube.Icons.undo text: qsTr("Restore Mail") enabled: mailController.restoreFromTrashAction.enabled tooltip: qsTr("restore email") @@ -132,7 +131,7 @@ Item { root.isDraft = currentItem.currentData.draft; } - model: KubeFramework.MailListModel { + model: Kube.MailListModel { parentFolder: root.parentFolder filter: root.filterString } @@ -151,7 +150,7 @@ Item { property variant mail : model.domainObject width: scrollbar.visible ? listView.width - scrollbar.width : listView.width - height: KubeTheme.Units.gridUnit * 5 + height: Kube.Units.gridUnit * 5 states: [ State { @@ -163,31 +162,31 @@ Item { PropertyChanges {target: delegateRoot; parent: root} PropertyChanges {target: delegateRoot; opacity: 0.7} - PropertyChanges {target: background; color: KubeTheme.Colors.highlightColor} - PropertyChanges {target: subject; color: KubeTheme.Colors.highlightedTextColor} - PropertyChanges {target: sender; color: KubeTheme.Colors.highlightedTextColor} - PropertyChanges {target: date; color: KubeTheme.Colors.highlightedTextColor} - PropertyChanges {target: threadCounter; color: KubeTheme.Colors.highlightedTextColor} + PropertyChanges {target: background; color: Kube.Colors.highlightColor} + PropertyChanges {target: subject; color: Kube.Colors.highlightedTextColor} + PropertyChanges {target: sender; color: Kube.Colors.highlightedTextColor} + PropertyChanges {target: date; color: Kube.Colors.highlightedTextColor} + PropertyChanges {target: threadCounter; color: Kube.Colors.highlightedTextColor} }, State { name: "selected" when: listView.currentIndex == index && !mouseArea.drag.active - PropertyChanges {target: background; color: KubeTheme.Colors.highlightColor} - PropertyChanges {target: subject; color: KubeTheme.Colors.highlightedTextColor} - PropertyChanges {target: sender; color: KubeTheme.Colors.highlightedTextColor} - PropertyChanges {target: date; color: KubeTheme.Colors.highlightedTextColor} - PropertyChanges {target: threadCounter; color: KubeTheme.Colors.highlightedTextColor} + PropertyChanges {target: background; color: Kube.Colors.highlightColor} + PropertyChanges {target: subject; color: Kube.Colors.highlightedTextColor} + PropertyChanges {target: sender; color: Kube.Colors.highlightedTextColor} + PropertyChanges {target: date; color: Kube.Colors.highlightedTextColor} + PropertyChanges {target: threadCounter; color: Kube.Colors.highlightedTextColor} }, State { name: "hovered" when: mouseArea.containsMouse && !mouseArea.drag.active - PropertyChanges {target: background; color: KubeTheme.Colors.highlightColor; opacity: 0.7} - PropertyChanges {target: subject; color: KubeTheme.Colors.highlightedTextColor} - PropertyChanges {target: sender; color: KubeTheme.Colors.highlightedTextColor} - PropertyChanges {target: date; color: KubeTheme.Colors.highlightedTextColor} - PropertyChanges {target: threadCounter; color: KubeTheme.Colors.highlightedTextColor} + PropertyChanges {target: background; color: Kube.Colors.highlightColor; opacity: 0.7} + PropertyChanges {target: subject; color: Kube.Colors.highlightedTextColor} + PropertyChanges {target: sender; color: Kube.Colors.highlightedTextColor} + PropertyChanges {target: date; color: Kube.Colors.highlightedTextColor} + PropertyChanges {target: threadCounter; color: Kube.Colors.highlightedTextColor} } ] @@ -215,9 +214,9 @@ Item { anchors.fill: parent - color: KubeTheme.Colors.viewBackgroundColor + color: Kube.Colors.viewBackgroundColor - border.color: KubeTheme.Colors.backgroundColor + border.color: Kube.Colors.backgroundColor border.width: 1 } @@ -229,24 +228,24 @@ Item { bottom: parent.bottom left: parent.left right: parent.right - margins: KubeTheme.Units.smallSpacing + margins: Kube.Units.smallSpacing } Column { anchors { verticalCenter: parent.verticalCenter left: parent.left - leftMargin: KubeTheme.Units.largeSpacing + leftMargin: Kube.Units.largeSpacing } Text{ id: subject text: model.subject - color: model.unread ? KubeTheme.Colors.highlightColor : KubeTheme.Colors.textColor + color: model.unread ? Kube.Colors.highlightColor : Kube.Colors.textColor maximumLineCount: 2 - width: content.width - KubeTheme.Units.gridUnit * 3 + width: content.width - Kube.Units.gridUnit * 3 wrapMode: Text.WrapAnywhere elide: Text.ElideRight } @@ -256,8 +255,8 @@ Item { text: model.senderName font.italic: true - color: KubeTheme.Colors.textColor - width: delegateRoot.width - KubeTheme.Units.gridUnit * 3 + color: Kube.Colors.textColor + width: delegateRoot.width - Kube.Units.gridUnit * 3 elide: Text.ElideRight } } @@ -271,7 +270,7 @@ Item { } text: Qt.formatDateTime(model.date, "dd MMM yyyy") font.italic: true - color: KubeTheme.Colors.disabledTextColor + color: Kube.Colors.disabledTextColor font.pointSize: 9 } @@ -282,7 +281,7 @@ Item { right: parent.right } text: model.threadSize - color: model.unread ? KubeTheme.Colors.highlightColor : KubeTheme.Colors.disabledTextColor + color: model.unread ? Kube.Colors.highlightColor : Kube.Colors.disabledTextColor visible: model.threadSize > 1 } } diff --git a/framework/qml/MailViewer.qml b/framework/qml/MailViewer.qml index 4ee170bd..487da576 100644 --- a/framework/qml/MailViewer.qml +++ b/framework/qml/MailViewer.qml @@ -20,8 +20,8 @@ import QtQuick 2.4 import QtQuick.Controls 1.4 as Controls1 import QtQuick.Layouts 1.1 -import org.kube.framework.domain 1.0 as KubeFramework import org.kube.components.mailviewer 1.0 as MV +import org.kube.framework 1.0 as Kube Item { id: root @@ -67,7 +67,7 @@ Item { model: messageParser.newTree } - KubeFramework.MessageParser { + Kube.MessageParser { id: messageParser message: root.message } diff --git a/framework/qml/Notification.qml b/framework/qml/Notification.qml deleted file mode 100644 index 15291c43..00000000 --- a/framework/qml/Notification.qml +++ /dev/null @@ -1,83 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.0 - -import org.kde.kirigami 1.0 as Kirigami -import org.kube.components.theme 1.0 as KubeTheme - - -MouseArea { - id: popup - - property alias title: message.text - property alias timeout: hideTimer.interval - property alias background: bg.color - - function hide() { - if (hideTimer.running) - hideTimer.stop() - popup.opacity = 0.0 - } - - function show() { - console.warn("Trying to show the notification", title); - popup.opacity = 1.0 - hideTimer.restart() - } - - function notify(text) { - popup.title = text - bg.color = KubeTheme.Colors.textColor - show() - } - - Timer { - id: hideTimer - triggeredOnStart: false - repeat: false - interval: 5000 - onTriggered: popup.hide() - } - - width: Math.max(300, message.contentWidth + (Kirigami.Units.largeSpacing * 2)) - height: Math.max(50, message.contentHeight + (Kirigami.Units.largeSpacing * 2)) - - visible: opacity > 0 - opacity: 0.0 - - Behavior on opacity { - NumberAnimation { - duration: 200 - easing.type: Easing.InOutQuad - property: "opacity" - } - } - - Rectangle { - id: bg - - anchors.fill: parent - - opacity: 0.6 - } - - Label { - id: message - - anchors { - verticalCenter: popup.verticalCenter - left: parent.left - leftMargin: Kirigami.Units.largeSpacing - right: parent.right - rightMargin: Kirigami.Units.largeSpacing - } - - font.pixelSize: 16 - - color: KubeTheme.Colors.highlightedTextColor - horizontalAlignment: Text.AlignHCenter - elide: Text.ElideRight - wrapMode: Text.Wrap - } - - onClicked: hide() -} diff --git a/framework/qml/NotificationPopup.qml b/framework/qml/NotificationPopup.qml new file mode 100644 index 00000000..2a336f36 --- /dev/null +++ b/framework/qml/NotificationPopup.qml @@ -0,0 +1,82 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.0 + +import org.kde.kirigami 1.0 as Kirigami + + +MouseArea { + id: popup + + property alias title: message.text + property alias timeout: hideTimer.interval + property alias background: bg.color + + function hide() { + if (hideTimer.running) + hideTimer.stop() + popup.opacity = 0.0 + } + + function show() { + console.warn("Trying to show the notification", title); + popup.opacity = 1.0 + hideTimer.restart() + } + + function notify(text) { + popup.title = text + bg.color = Kube.Colors.textColor + show() + } + + Timer { + id: hideTimer + triggeredOnStart: false + repeat: false + interval: 5000 + onTriggered: popup.hide() + } + + width: Math.max(300, message.contentWidth + (Kirigami.Units.largeSpacing * 2)) + height: Math.max(50, message.contentHeight + (Kirigami.Units.largeSpacing * 2)) + + visible: opacity > 0 + opacity: 0.0 + + Behavior on opacity { + NumberAnimation { + duration: 200 + easing.type: Easing.InOutQuad + property: "opacity" + } + } + + Rectangle { + id: bg + + anchors.fill: parent + + opacity: 0.6 + } + + Label { + id: message + + anchors { + verticalCenter: popup.verticalCenter + left: parent.left + leftMargin: Kirigami.Units.largeSpacing + right: parent.right + rightMargin: Kirigami.Units.largeSpacing + } + + font.pixelSize: 16 + + color: Kube.Colors.highlightedTextColor + horizontalAlignment: Text.AlignHCenter + elide: Text.ElideRight + wrapMode: Text.Wrap + } + + onClicked: hide() +} diff --git a/framework/qml/Outbox.qml b/framework/qml/Outbox.qml index 19646459..6b0a1650 100644 --- a/framework/qml/Outbox.qml +++ b/framework/qml/Outbox.qml @@ -22,27 +22,24 @@ import QtQuick.Controls 2.0 import QtQuick.Controls 1.3 as Controls import org.kde.kirigami 1.0 as Kirigami +import org.kube.framework 1.0 as Kube -import org.kube.framework.actions 1.0 as KubeAction -import org.kube.framework.domain 1.0 as KubeFramework -import org.kube.components 1.0 as KubeComponents -import org.kube.components.theme 1.0 as KubeTheme -KubeComponents.Button { +Kube.Button { id: root text: outboxModel.count > 0 ? "Outbox (" + outboxModel.count + ")" : "Outbox" color: "transparent" - textColor: KubeTheme.Colors.highlightedTextColor + textColor: Kube.Colors.highlightedTextColor iconName: "" states: [ State { - name: "busy"; when: outboxModel.status == KubeFramework.OutboxModel.InProgressStatus - PropertyChanges { target: root; iconName: KubeTheme.Icons.busy } + name: "busy"; when: outboxModel.status == Kube.OutboxModel.InProgressStatus + PropertyChanges { target: root; iconName: Kube.Icons.busy } }, State { - name: "error"; when: outboxModel.status == KubeFramework.OutboxModel.ErrorStatus - PropertyChanges { target: root; iconName: KubeTheme.Icons.error } + name: "error"; when: outboxModel.status == Kube.OutboxModel.ErrorStatus + PropertyChanges { target: root; iconName: Kube.Icons.error } } ] @@ -50,11 +47,11 @@ KubeComponents.Button { dialog.visible = dialog.visible ? false : true } - KubeFramework.OutboxController { + Kube.OutboxController { id: outboxController } - KubeFramework.OutboxModel { + Kube.OutboxModel { id: outboxModel } @@ -91,8 +88,8 @@ KubeComponents.Button { height: Kirigami.Units.gridUnit * 3 width: listView.width - color: KubeTheme.Colors.viewBackgroundColor - border.color: KubeTheme.Colors.backgroundColor + color: Kube.Colors.viewBackgroundColor + border.color: Kube.Colors.backgroundColor border.width: 1 Label { @@ -104,16 +101,16 @@ KubeComponents.Button { } text: model.subject - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor opacity: 1 states: [ State { - name: "inprogress"; when: model.status == KubeFramework.OutboxModel.InProgressStatus + name: "inprogress"; when: model.status == Kube.OutboxModel.InProgressStatus PropertyChanges { target: subjectLabel; text: "Sending: " + model.subject } }, State { - name: "error"; when: model.status == KubeFramework.OutboxModel.ErrorStatus - PropertyChanges { target: subjectLabel; color: KubeTheme.Colors.warningColor } + name: "error"; when: model.status == Kube.OutboxModel.ErrorStatus + PropertyChanges { target: subjectLabel; color: Kube.Colors.warningColor } } ] } diff --git a/framework/qml/OverlayDialog.qml b/framework/qml/OverlayDialog.qml index 760fb12e..10004f8d 100644 --- a/framework/qml/OverlayDialog.qml +++ b/framework/qml/OverlayDialog.qml @@ -22,9 +22,6 @@ import QtQuick.Layouts 1.1 import org.kde.kirigami 1.0 as Kirigami -import org.kube.framework.settings 1.0 as KubeSettings -import org.kube.framework.domain 1.0 as KubeFramework -import org.kube.components.theme 1.0 as KubeTheme Item { id: root @@ -55,7 +52,7 @@ Item { height: root.height * 0.8 width: root.width * 0.8 - color: KubeTheme.Colors.backgroundColor + color: Kube.Colors.backgroundColor MouseArea { anchors.fill: parent diff --git a/framework/qml/People.qml b/framework/qml/People.qml index 182cce94..8ccd174d 100644 --- a/framework/qml/People.qml +++ b/framework/qml/People.qml @@ -23,9 +23,7 @@ import QtQuick.Controls 1.4 as Controls import QtQuick.Layouts 1.1 import org.kde.kirigami 1.0 as Kirigami -import org.kube.components.theme 1.0 as KubeTheme -import org.kube.framework.domain 1.0 as KubeFramework - +import org.kube.framework 1.0 as Kube Popup { @@ -49,7 +47,7 @@ Popup { anchors.verticalCenter: parent.verticalCenter - iconName: KubeTheme.Icons.goBack + iconName: Kube.Icons.goBack onClicked: stack.pop() @@ -69,11 +67,11 @@ Popup { anchors { right: parent.right - rightMargin: KubeTheme.Units.smallSpacing + rightMargin: Kube.Units.smallSpacing verticalCenter: parent.verticalCenter } - iconName: KubeTheme.Icons.addNew + iconName: Kube.Icons.addNew } } @@ -98,7 +96,7 @@ Popup { Rectangle { id: peoplePageRoot - color: KubeTheme.Colors.viewBackgroundColor + color: Kube.Colors.viewBackgroundColor Flickable { @@ -117,25 +115,25 @@ Popup { anchors { top: parent.top - topMargin: KubeTheme.Units.largeSpacing + topMargin: Kube.Units.largeSpacing left: parent.left - leftMargin: KubeTheme.Units.largeSpacing + leftMargin: Kube.Units.largeSpacing } - spacing: KubeTheme.Units.largeSpacing - width: peoplePageRoot.width - KubeTheme.Units.largeSpacing * 2 + spacing: Kube.Units.largeSpacing + width: peoplePageRoot.width - Kube.Units.largeSpacing * 2 Repeater { - model: KubeFramework.PeopleModel { + model: Kube.PeopleModel { filter: searchBar.text } delegate: Rectangle { id: delegateRoot - height: KubeTheme.Units.gridUnit * 3 - width: KubeTheme.Units.gridUnit * 10 + height: Kube.Units.gridUnit * 3 + width: Kube.Units.gridUnit * 10 border.width: 1 border.color: "lightgrey" @@ -164,24 +162,24 @@ Popup { anchors { left: avatarPlaceholder.right - margins: KubeTheme.Units.smallSpacing + margins: Kube.Units.smallSpacing verticalCenter: parent.verticalCenter } Text { - width: delegateRoot.width - avatarPlaceholder.width - KubeTheme.Units.smallSpacing * 2 + width: delegateRoot.width - avatarPlaceholder.width - Kube.Units.smallSpacing * 2 text: model.firstName elide: Text.ElideRight - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor } Text { - width: delegateRoot.width - avatarPlaceholder.width - KubeTheme.Units.smallSpacing * 2 + width: delegateRoot.width - avatarPlaceholder.width - Kube.Units.smallSpacing * 2 text: model.lastName elide: Text.ElideRight - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor } } } @@ -198,19 +196,19 @@ Popup { Rectangle { id: personPageRoot - KubeFramework.ContactController { + Kube.ContactController { id: contactController contact: popup.currentContact } - color: KubeTheme.Colors.viewBackgroundColor + color: Kube.Colors.viewBackgroundColor Item { anchors { top: parent.top left: parent.left - leftMargin: KubeTheme.Units.largeSpacing + leftMargin: Kube.Units.largeSpacing } width: parent.width @@ -231,17 +229,17 @@ Popup { width: personPageRoot.width - spacing: KubeTheme.Units.largeSpacing + spacing: Kube.Units.largeSpacing Item { width: parent.width - height: KubeTheme.Units.smallSpacing + height: Kube.Units.smallSpacing } Item { - height: KubeTheme.Units.gridUnit * 8 - width: personPageRoot.width - KubeTheme.Units.largeSpacing + height: Kube.Units.gridUnit * 8 + width: personPageRoot.width - Kube.Units.largeSpacing Rectangle { id: avatar @@ -258,7 +256,7 @@ Popup { anchors { top: avatar.top left: avatar.right - leftMargin: KubeTheme.Units.largeSpacing + leftMargin: Kube.Units.largeSpacing } text: contactController.name //"Michael Tester" @@ -270,7 +268,7 @@ Popup { anchors { top: nameLabel.bottom left: avatar.right - leftMargin: KubeTheme.Units.largeSpacing + leftMargin: Kube.Units.largeSpacing } text: "CIO" @@ -282,11 +280,11 @@ Popup { anchors { bottom: avatar.bottom left: avatar.right - leftMargin: KubeTheme.Units.largeSpacing + leftMargin: Kube.Units.largeSpacing } - height: KubeTheme.Units.gridUnit * 3 - width: KubeTheme.Units.gridUnit * 10 + height: Kube.Units.gridUnit * 3 + width: Kube.Units.gridUnit * 10 border.width: 1 border.color: "lightgrey" @@ -304,12 +302,12 @@ Popup { anchors { verticalCenter: av.verticalCenter left: av.right - leftMargin: KubeTheme.Units.smallSpacing + leftMargin: Kube.Units.smallSpacing } text: "Sauerkraut AG" - color: KubeTheme.Colors.textColor + color: Kube.Colors.textColor } } } @@ -317,65 +315,65 @@ Popup { Flow { id: emails - width: personPageRoot.width - KubeTheme.Units.largeSpacing + width: personPageRoot.width - Kube.Units.largeSpacing Repeater { model: contactController.emails Row { - spacing: KubeTheme.Units.smallSpacing + spacing: Kube.Units.smallSpacing Text { text: "(main)" } - Text { text: modelData ; color: KubeTheme.Colors.highlightColor } - Item { width: KubeTheme.Units.smallSpacing; height: 1 } + Text { text: modelData ; color: Kube.Colors.highlightColor } + Item { width: Kube.Units.smallSpacing; height: 1 } } } Row { - spacing: KubeTheme.Units.smallSpacing + spacing: Kube.Units.smallSpacing Text { text: "(alias)"} - Text { text: "test.testerson@gmail.com"; color: KubeTheme.Colors.highlightColor } - Item { width: KubeTheme.Units.smallSpacing; height: 1 } + Text { text: "test.testerson@gmail.com"; color: Kube.Colors.highlightColor } + Item { width: Kube.Units.smallSpacing; height: 1 } } Row { - spacing: KubeTheme.Units.smallSpacing + spacing: Kube.Units.smallSpacing Text { text: "(private)"} - Text { text: "test@gmail.com"; color: KubeTheme.Colors.highlightColor } - Item { width: KubeTheme.Units.smallSpacing; height: 1 } + Text { text: "test@gmail.com"; color: Kube.Colors.highlightColor } + Item { width: Kube.Units.smallSpacing; height: 1 } } } Flow { id: phone - width: personPageRoot.width - KubeTheme.Units.largeSpacing - spacing: KubeTheme.Units.smallSpacing + width: personPageRoot.width - Kube.Units.largeSpacing + spacing: Kube.Units.smallSpacing Row { - spacing: KubeTheme.Units.smallSpacing + spacing: Kube.Units.smallSpacing Text { text: "(inhouse)"} Text { text: "+49812324932"; opacity: 0.6 } - Item { width: KubeTheme.Units.smallSpacing; height: 1 } + Item { width: Kube.Units.smallSpacing; height: 1 } } Row { - spacing: KubeTheme.Units.smallSpacing + spacing: Kube.Units.smallSpacing Text { text: "(mobile)"} Text { text: "+49812324932"; opacity: 0.6 } - Item { width: KubeTheme.Units.smallSpacing; height: 1 } + Item { width: Kube.Units.smallSpacing; height: 1 } } Row { - spacing: KubeTheme.Units.smallSpacing + spacing: Kube.Units.smallSpacing Text { text: "(private)"} Text { text: "+49812324932"; opacity: 0.6 } - Item { width: KubeTheme.Units.smallSpacing; height: 1 } + Item { width: Kube.Units.smallSpacing; height: 1 } } } Column { id: address - width: personPageRoot.width - KubeTheme.Units.largeSpacing + width: personPageRoot.width - Kube.Units.largeSpacing Text { text: "Albertstrasse 35a"} Text { text: "81767 Teststadt"} @@ -386,7 +384,7 @@ Popup { // // width: parent.width // -// spacing: KubeTheme.Units.smallSpacing +// spacing: Kube.Units.smallSpacing // // Text { // @@ -396,7 +394,7 @@ Popup { // GroupGrid { // id: groups // -// width: root.width - KubeTheme.Units.largeSpacing +// width: root.width - Kube.Units.largeSpacing // // model: GroupModel1 {} // } @@ -406,7 +404,7 @@ Popup { // // width: parent.width // -// spacing: KubeTheme.Units.smallSpacing +// spacing: Kube.Units.smallSpacing // // Text { // id: commonPeopleLabel @@ -417,7 +415,7 @@ Popup { // PeopleGrid { // id: commonPeople // -// width: root.width - KubeTheme.Units.largeSpacing +// width: root.width - Kube.Units.largeSpacing // // model: PeopleModel2 {} // } @@ -425,7 +423,7 @@ Popup { Item { width: parent.width - height: KubeTheme.Units.largeSpacing + height: Kube.Units.largeSpacing } } } diff --git a/framework/qml/PositiveButton.qml b/framework/qml/PositiveButton.qml index 83063668..37ddae51 100644 --- a/framework/qml/PositiveButton.qml +++ b/framework/qml/PositiveButton.qml @@ -17,14 +17,13 @@ */ import QtQuick 2.7 -import QtQuick.Controls 2.1 as Controls -import org.kube.components.theme 1.0 as KubeTheme +import QtQuick.Controls 2.0 as Controls Controls.AbstractButton { id: root - width: mainText.implicitWidth + KubeTheme.Units.largeSpacing * 2 - height: mainText.implicitHeight + KubeTheme.Units.smallSpacing * 2 + width: mainText.implicitWidth + Kube.Units.largeSpacing * 2 + height: mainText.implicitHeight + Kube.Units.smallSpacing * 2 clip: true @@ -33,7 +32,7 @@ Controls.AbstractButton { anchors.fill: parent - color: KubeTheme.Colors.positveColor + color: Kube.Colors.positveColor } Text { @@ -41,7 +40,7 @@ Controls.AbstractButton { anchors.centerIn: parent - color: KubeTheme.Colors.highlightedTextColor + color: Kube.Colors.highlightedTextColor text: root.text } } diff --git a/framework/qmldir b/framework/qmldir index ad148543..b09567b6 100644 --- a/framework/qmldir +++ b/framework/qmldir @@ -11,7 +11,7 @@ EditAccountDialog 1.0 EditAccountDialog.qml OverlayDialog 1.0 OverlayDialog.qml Outbox 1.0 Outbox.qml People 1.0 People.qml -Notification 1.0 Notification.qml +NotificationPopup 1.0 Notification.qml Icon 1.0 Icon.qml Button 1.0 Button.qml PositiveButton 1.0 PositiveButton.qml @@ -19,8 +19,4 @@ singleton Colors 1.0 Colors.qml singleton Icons 1.0 Icons.qml singleton Units 1.0 Units.qml -plugin mailplugin -plugin actionplugin -plugin notificationplugin -plugin settingsplugin -plugin accountsplugin +plugin frameworkplugin diff --git a/framework/settings/settingsplugin.cpp b/framework/settings/settingsplugin.cpp index 3a582d1f..c081b213 100644 --- a/framework/settings/settingsplugin.cpp +++ b/framework/settings/settingsplugin.cpp @@ -9,7 +9,6 @@ void SettingsPlugin::registerTypes (const char *uri) { - Q_ASSERT(uri == QLatin1String("org.kube.framework.settings")); // qmlRegisterType(); // qmlRegisterType(uri, 1, 0, "Resources"); -- cgit v1.2.3