From 2dac72ae43f627340694d89db68184cb07e68650 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 9 Mar 2016 15:13:00 +0100 Subject: Moved application to components --- CMakeLists.txt | 3 +- applications/CMakeLists.txt | 4 +- applications/kube-mail/CMakeLists.txt | 33 --- applications/kube-mail/main.cpp | 43 ---- .../kube-mail/package/contents/ui/Avatar.qml | 55 ----- .../kube-mail/package/contents/ui/ColorPalette.qml | 26 --- .../kube-mail/package/contents/ui/Composer.qml | 221 --------------------- .../package/contents/ui/FocusComposer.qml | 81 -------- .../package/contents/ui/FolderListView.qml | 116 ----------- .../kube-mail/package/contents/ui/FolderModel.qml | 36 ---- .../kube-mail/package/contents/ui/ListItem.qml | 63 ------ .../package/contents/ui/MailListModel.qml | 149 -------------- .../kube-mail/package/contents/ui/MailListView.qml | 155 --------------- .../kube-mail/package/contents/ui/MailViewer.qml | 43 ---- .../kube-mail/package/contents/ui/Settings.qml | 74 ------- .../package/contents/ui/SingleMailView.qml | 74 ------- .../kube-mail/package/contents/ui/example.qml | 64 ------ .../kube-mail/package/contents/ui/main.qml | 200 ------------------- applications/kube-mail/package/metadata.desktop | 8 - applications/mail/CMakeLists.txt | 30 +++ applications/mail/main.cpp | 43 ++++ components/CMakeLists.txt | 26 +++ components/package/contents/ui/Avatar.qml | 55 +++++ components/package/contents/ui/ColorPalette.qml | 26 +++ components/package/contents/ui/Composer.qml | 221 +++++++++++++++++++++ components/package/contents/ui/FocusComposer.qml | 81 ++++++++ components/package/contents/ui/FolderListView.qml | 116 +++++++++++ components/package/contents/ui/FolderModel.qml | 36 ++++ components/package/contents/ui/ListItem.qml | 63 ++++++ components/package/contents/ui/MailListModel.qml | 149 ++++++++++++++ components/package/contents/ui/MailListView.qml | 155 +++++++++++++++ components/package/contents/ui/MailViewer.qml | 43 ++++ components/package/contents/ui/Settings.qml | 74 +++++++ components/package/contents/ui/SingleMailView.qml | 74 +++++++ components/package/contents/ui/example.qml | 64 ++++++ components/package/contents/ui/main.qml | 200 +++++++++++++++++++ components/package/metadata.desktop | 8 + 37 files changed, 1468 insertions(+), 1444 deletions(-) delete mode 100644 applications/kube-mail/CMakeLists.txt delete mode 100644 applications/kube-mail/main.cpp delete mode 100644 applications/kube-mail/package/contents/ui/Avatar.qml delete mode 100644 applications/kube-mail/package/contents/ui/ColorPalette.qml delete mode 100644 applications/kube-mail/package/contents/ui/Composer.qml delete mode 100644 applications/kube-mail/package/contents/ui/FocusComposer.qml delete mode 100644 applications/kube-mail/package/contents/ui/FolderListView.qml delete mode 100644 applications/kube-mail/package/contents/ui/FolderModel.qml delete mode 100644 applications/kube-mail/package/contents/ui/ListItem.qml delete mode 100644 applications/kube-mail/package/contents/ui/MailListModel.qml delete mode 100644 applications/kube-mail/package/contents/ui/MailListView.qml delete mode 100644 applications/kube-mail/package/contents/ui/MailViewer.qml delete mode 100644 applications/kube-mail/package/contents/ui/Settings.qml delete mode 100644 applications/kube-mail/package/contents/ui/SingleMailView.qml delete mode 100644 applications/kube-mail/package/contents/ui/example.qml delete mode 100644 applications/kube-mail/package/contents/ui/main.qml delete mode 100644 applications/kube-mail/package/metadata.desktop create mode 100644 applications/mail/CMakeLists.txt create mode 100644 applications/mail/main.cpp create mode 100644 components/CMakeLists.txt create mode 100644 components/package/contents/ui/Avatar.qml create mode 100644 components/package/contents/ui/ColorPalette.qml create mode 100644 components/package/contents/ui/Composer.qml create mode 100644 components/package/contents/ui/FocusComposer.qml create mode 100644 components/package/contents/ui/FolderListView.qml create mode 100644 components/package/contents/ui/FolderModel.qml create mode 100644 components/package/contents/ui/ListItem.qml create mode 100644 components/package/contents/ui/MailListModel.qml create mode 100644 components/package/contents/ui/MailListView.qml create mode 100644 components/package/contents/ui/MailViewer.qml create mode 100644 components/package/contents/ui/Settings.qml create mode 100644 components/package/contents/ui/SingleMailView.qml create mode 100644 components/package/contents/ui/example.qml create mode 100644 components/package/contents/ui/main.qml create mode 100644 components/package/metadata.desktop diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d896eb0..901e1c83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,8 @@ project(kube) cmake_minimum_required(VERSION 2.8.10.1) -add_subdirectory(applications) add_subdirectory(framework) +add_subdirectory(components) add_subdirectory(accounts) add_subdirectory(icons) +add_subdirectory(applications) diff --git a/applications/CMakeLists.txt b/applications/CMakeLists.txt index dd65a3e8..df78d62a 100644 --- a/applications/CMakeLists.txt +++ b/applications/CMakeLists.txt @@ -1,2 +1,2 @@ -add_subdirectory(kube-mail) -add_subdirectory(kube-accounts) +add_subdirectory(mail) +#add_subdirectory(kube-accounts) diff --git a/applications/kube-mail/CMakeLists.txt b/applications/kube-mail/CMakeLists.txt deleted file mode 100644 index 1b1767ed..00000000 --- a/applications/kube-mail/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -project(kube-mail) - -cmake_minimum_required(VERSION 2.8.10.1) - -include(CPack) -include(FeatureSummary) -find_package(PkgConfig) - -################# set KDE specific information ################# - -find_package(ECM 0.0.8 REQUIRED NO_MODULE) - -# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) - -include(KDEInstallDirs) -include(KDECMakeSettings) -include(KDECompilerSettings) - -find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Widgets) - -set (QT_MIN_VERSION "5.4.0") -find_package(KF5 REQUIRED COMPONENTS Package) - -# install UI package -kpackage_install_package(package org.kde.kube.mail "genericqml") - -# install executable -add_executable(${PROJECT_NAME} main.cpp) -qt5_use_modules(${PROJECT_NAME} Gui Quick Widgets) -target_link_libraries(${PROJECT_NAME} KF5::Package) - -install(TARGETS ${PROJECT_NAME} DESTINATION bin) diff --git a/applications/kube-mail/main.cpp b/applications/kube-mail/main.cpp deleted file mode 100644 index 1ff4effb..00000000 --- a/applications/kube-mail/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include - -#include -#include -#include -#include - -#include - -class KubeImageProvider : public QQuickImageProvider -{ -public: - KubeImageProvider() - : QQuickImageProvider(QQuickImageProvider::Pixmap) - { - } - - QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) Q_DECL_OVERRIDE - { - const auto icon = QIcon::fromTheme(id); - auto expectedSize = requestedSize; - if (!icon.availableSizes().contains(requestedSize) && !icon.availableSizes().isEmpty()) { - expectedSize = icon.availableSizes().first(); - } - const auto pixmap = icon.pixmap(expectedSize); - if (size) { - *size = pixmap.size(); - } - return pixmap; - } -}; - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - auto package = KPackage::PackageLoader::self()->loadPackage("KPackage/GenericQML", "org.kde.kube.mail"); - Q_ASSERT(package.isValid()); - QQmlApplicationEngine engine; - engine.addImageProvider(QLatin1String("kube"), new KubeImageProvider); - engine.load(QUrl::fromLocalFile(package.filePath("mainscript"))); - return app.exec(); -} diff --git a/applications/kube-mail/package/contents/ui/Avatar.qml b/applications/kube-mail/package/contents/ui/Avatar.qml deleted file mode 100644 index 33d6733c..00000000 --- a/applications/kube-mail/package/contents/ui/Avatar.qml +++ /dev/null @@ -1,55 +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 -import QtQuick.Controls 1.3 -import QtQuick.Layouts 1.1 - - -Rectangle { - - property string name; - - //colors taken from https://techbase.kde.org/Projects/Usability/HIG/Color - function calcColor(x) - { - switch (x % 5) { - case 0: - return "#16a085" - case 1: - return "#27ae60" - case 2: - return "#2980b9" - case 3: - return "#8e44ad" - case 4: - return "#c0392b" - } - } - - radius: 2 - - color: calcColor(name.length) - - Text { - anchors.centerIn: parent - - text: name.charAt(0) - - color: "#ecf0f1" - } -} diff --git a/applications/kube-mail/package/contents/ui/ColorPalette.qml b/applications/kube-mail/package/contents/ui/ColorPalette.qml deleted file mode 100644 index db85cac6..00000000 --- a/applications/kube-mail/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/applications/kube-mail/package/contents/ui/Composer.qml b/applications/kube-mail/package/contents/ui/Composer.qml deleted file mode 100644 index 1a6a4cc4..00000000 --- a/applications/kube-mail/package/contents/ui/Composer.qml +++ /dev/null @@ -1,221 +0,0 @@ -/* - * 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 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 -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.1 -import org.kde.plasma.components 2.0 as PlasmaComponents - -import org.kde.kube.mail 1.0 as Mail - - -Item { - id: root - property variant originalMessage - - function send() { - composer.send() - } - - function saveAsDraft() { - composer.saveAsDraft() - } - - function clear() { - composer.clear(); - } - - Mail.Retriever { - id: retriever - propertyName: "mimeMessage" - model: Mail.MailListModel { - id: mailListModel - mail: root.originalMessage - } - } - - Mail.Composer { - id: composer - originalMessage: retriever.value - } - - ColumnLayout { - - anchors.fill: parent - - GridLayout { - - columns: 2 - - Label { - text: "From" - } - - ComboBox { - model: composer.identityModel - - Layout.fillWidth: true - - currentIndex: composer.fromIndex - - onCurrentIndexChanged: { - composer.fromIndex = currentIndex - } - } - - Label { - text: "To" - } - - RowLayout { - Layout.fillWidth: true - - TextField { - id: to - - Layout.fillWidth: true - - text: composer.to - - onTextChanged: { - composer.to = text; - } - } - - PlasmaComponents.Button { - id: ccButton - - text: "Cc" - - onClicked: { - cc.visible = true - ccButton.visible = false - } - } - - PlasmaComponents.Button { - id: bccButton - - text: "Bcc" - - onClicked: { - bcc.visible = true - bccButton.visible = false - } - } - } - - Label { - text: "Cc" - - visible: cc.visible - } - - TextField { - id: cc - - Layout.fillWidth: true - - visible: false - - text: composer.cc - - onTextChanged: { - composer.cc = text; - } - } - - Label { - text: "Bcc" - - visible: bcc.visible - } - - TextField { - id: bcc - - Layout.fillWidth: true - - visible : false - - text: composer.bcc - - onTextChanged: { - composer.bcc = text; - } - } - } - - TextField { - id: subject - - Layout.fillWidth: true - - placeholderText: "Enter Subject" - - text: composer.subject - - onTextChanged: { - composer.subject = text; - } - } - - Item { - - Layout.fillWidth: true - - height: subject.height * 1.5 - - PlasmaComponents.Button { - - anchors { - bottom: parent.bottom - } - - text: "Save as Draft" - - onClicked: { - composer.saveAsDraft() - } - } - - PlasmaComponents.Button { - - anchors { - bottom: parent.bottom - right: parent.right - } - - text: "Attach" - } - } - - TextArea { - id: content - - text: composer.body - - onTextChanged: { - composer.body = text; - } - - Layout.fillWidth: true - Layout.fillHeight: true - - } - } -} diff --git a/applications/kube-mail/package/contents/ui/FocusComposer.qml b/applications/kube-mail/package/contents/ui/FocusComposer.qml deleted file mode 100644 index 8ec01cc9..00000000 --- a/applications/kube-mail/package/contents/ui/FocusComposer.qml +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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 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 -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.1 - -Rectangle { - id: root - property variant originalMessage - - visible: false - - color: colorPalette.border - - opacity: 0.9 - - MouseArea { - anchors.fill: parent - - onClicked: { - root.visible = false - } - } - - Rectangle { - anchors.centerIn: parent - - height: root.height * 0.8 - width: root.width * 0.8 - - color: colorPalette.background - - MouseArea { - anchors.fill: parent - } - - ColumnLayout { - - anchors { - fill: parent - margins: unit.size * 3 - } - - Composer { - id: composer - - Layout.fillWidth: true - Layout.fillHeight: true - originalMessage: root.originalMessage - } - - RowLayout { - Layout.alignment: Qt.AlignRight - - Button { - text: "Send" - - onClicked: { - composer.send() - root.visible = false - } - } - } - } - } -} \ No newline at end of file diff --git a/applications/kube-mail/package/contents/ui/FolderListView.qml b/applications/kube-mail/package/contents/ui/FolderListView.qml deleted file mode 100644 index 1934932c..00000000 --- a/applications/kube-mail/package/contents/ui/FolderListView.qml +++ /dev/null @@ -1,116 +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 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 -import QtQuick.Layouts 1.1 - -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents - -import org.kde.kube.mail 1.0 as Mail - -Item { - id: root - property variant currentFolder - SystemPalette { id: colorPalette; colorGroup: SystemPalette.Active } - - Item { - id: searchBox - - width: root.width - height: unit.size * 10 - - TextField { - anchors. centerIn: parent - - width: parent.width * 0.9 - - placeholderText: "Search all email..." - } - } - - TreeView { - id: treeView - anchors { - top: searchBox.bottom - left: parent.left - right: parent.right - bottom: parent.bottom - } - TableViewColumn { - title: "Name" - role: "name" - width: treeView.width - 5 - } - model: Mail.FolderListModel { id: folderListModel } - onCurrentIndexChanged: { - model.fetchMore(currentIndex) - root.currentFolder = model.data(currentIndex, Mail.FolderListModel.DomainObject) - } - backgroundVisible: false - headerVisible: false - style: TreeViewStyle { - activateItemOnSingleClick: true - rowDelegate: Rectangle { - height: unit.size * 10 - color: "transparent" - } - itemDelegate: Rectangle { - radius: 5 - border.width: 1 - border.color: "lightgrey" - color: styleData.selected ? colorPalette.highlight : colorPalette.button - PlasmaCore.IconItem { - id: iconItem - anchors { - verticalCenter: parent.verticalCenter - left: parent.left - leftMargin: unit.size * 3 - } - source: model.icon - } - Label { - anchors { - verticalCenter: parent.verticalCenter - left: iconItem.right - leftMargin: unit.size * 3 - } - renderType: Text.NativeRendering - text: styleData.value - font.pixelSize: 16 - font.bold: true - color: styleData.selected ? colorPalette.highlightedText : colorPalette.text - } - } - branchDelegate: Item { - width: 16 - height: 16 - Text { - visible: styleData.column === 0 && styleData.hasChildren - text: styleData.isExpanded ? "\u25bc" : "\u25b6" - color: !control.activeFocus || styleData.selected ? styleData.textColor : "#666" - font.pointSize: 10 - renderType: Text.NativeRendering - anchors.centerIn: parent - anchors.verticalCenterOffset: styleData.isExpanded ? 2 : 0 - } - } - } - } -} diff --git a/applications/kube-mail/package/contents/ui/FolderModel.qml b/applications/kube-mail/package/contents/ui/FolderModel.qml deleted file mode 100644 index b20a1606..00000000 --- a/applications/kube-mail/package/contents/ui/FolderModel.qml +++ /dev/null @@ -1,36 +0,0 @@ -import QtQuick 2.4 - -ListModel { - ListElement { - icon: "mail-folder-inbox" - name: "Inbox" - } - ListElement { - icon: "mail-folder-sent" - name: "Sent" - } - ListElement { - icon: "user-trash" - name: "Trash" - } - ListElement { - icon: "document-edit" - name: "Drafts" - } - ListElement { - icon: "folder" - name: "cats" - } - ListElement { - icon: "folder" - name: "dogs" - } - ListElement { - icon: "folder" - name: "dragons" - } - ListElement { - icon: "folder" - name: "long tailed dragons" - } -} \ No newline at end of file diff --git a/applications/kube-mail/package/contents/ui/ListItem.qml b/applications/kube-mail/package/contents/ui/ListItem.qml deleted file mode 100644 index 5396645d..00000000 --- a/applications/kube-mail/package/contents/ui/ListItem.qml +++ /dev/null @@ -1,63 +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 - -Item { - id: delegateRoot - - readonly property bool isCurrentItem: ListView.isCurrentItem - - height: unit.width * 25 - width: parent.width - - MouseArea { - id: mouseArea - - anchors.fill: parent - } - - Rectangle { - anchors.fill: parent - - color: colorPalette.background - - //clickColor - Rectangle { - id: clickColor - - anchors.fill: parent - - color: colorPalette.selected - opacity: 0.4 - - visible: mouseArea.pressed - } - - //border - Rectangle { - - anchors.bottom: parent.bottom - - height: 1 - width: parent.width - - color: colorPalette.border - opacity: 0.2 - } - } -} \ No newline at end of file diff --git a/applications/kube-mail/package/contents/ui/MailListModel.qml b/applications/kube-mail/package/contents/ui/MailListModel.qml deleted file mode 100644 index bf0f70a2..00000000 --- a/applications/kube-mail/package/contents/ui/MailListModel.qml +++ /dev/null @@ -1,149 +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 - -ListModel { - ListElement { - sender: "mighty@mail.com" - senderName: "Mighty Monkey" - subject: "I feel weak without my bananas" - date: "19:21" - unread: true - } - ListElement { - sender: "benni@bandana.org" - senderName: "Ben Bandana" - subject: "Check this out" - date: "16:01" - unread: true - } - ListElement { - sender: "alice@mail.com" - senderName: "Alice Cheng" - subject: "Re: We need more food" - date: "12:55" - unread: false - } - ListElement { - sender: "bob@bandana.org" - senderName: "Bob Ross" - subject: "KDE Rocks" - date: "Sat" - unread: true - } - ListElement { - sender: "tiny@mail.com" - senderName: "Tiny" - subject: "Huge success!!" - date: "Sat" - unread: false - } - ListElement { - sender: "bob@bandana.org" - senderName: "Bob Ross" - subject: "KDE Rocks" - date: "Fr" - unread: false - } - ListElement { - sender: "Laura@mail.com" - senderName: "Laura B" - subject: ":)" - date: "Thu" - unread: false - } - ListElement { - sender: "Andreas@stars.org" - senderName: "Andreas Rockstar" - subject: "KDE Rocks" - date: "Wed" - unread: false - } - ListElement { - sender: "alice@mail.com" - senderName: "Alice Cheng" - subject: "Re: We need more food" - date: "Wed" - } - ListElement { - sender: "bob@bandana.org" - senderName: "Bob Ross" - subject: "KDE Rocks" - date: "Mon" - } - ListElement { - sender: "mighty@mail.com" - senderName: "Mighty Monkey" - subject: "I feel weak without my bananas" - date: "Nov 20" - } - ListElement { - sender: "benni@bandana.org" - senderName: "Ben Bandana" - subject: "Check this out" - date: "Nov 15" - } - ListElement { - sender: "alice@mail.com" - senderName: "Alice Cheng" - subject: "Re: We need more food" - date: "Sep 29" - } - ListElement { - sender: "bob@bandana.org" - senderName: "Bob Ross" - subject: "KDE Rocks" - date: "Sep 14" - } - ListElement { - sender: "tiny@mail.com" - senderName: "Tiny" - subject: "Huge success!!" - date: "Sep 14" - } - ListElement { - sender: "bob@bandana.org" - senderName: "Bob Ross" - subject: "KDE Rocks" - date: "Sep 5" - } - ListElement { - sender: "Laura@mail.com" - senderName: "Laura B" - subject: ":)" - date: "Sep 4" - } - ListElement { - sender: "Andreas@stars.org" - senderName: "Andreas Rockstar" - subject: "KDE Rocks" - date: "May 25" - } - ListElement { - sender: "alice@mail.com" - senderName: "Alice Cheng" - subject: "Re: We need more food" - date: "May 3" - } - ListElement { - sender: "bob@bandana.org" - senderName: "Bob Ross" - subject: "Board Task: Write draft email to people with KDE accounts commiting to Qt repositories" - date: "Dec 2014" - } -} \ No newline at end of file diff --git a/applications/kube-mail/package/contents/ui/MailListView.qml b/applications/kube-mail/package/contents/ui/MailListView.qml deleted file mode 100644 index ff773e0e..00000000 --- a/applications/kube-mail/package/contents/ui/MailListView.qml +++ /dev/null @@ -1,155 +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 -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.1 - -import QtQml 2.2 - -import org.kde.plasma.components 2.0 as PlasmaComponents - -import org.kde.kube.mail 1.0 as Mail - -ScrollView { - id: root - property variant parentFolder - property variant currentMail - - ListView { - id: listView - - model: Mail.MailListModel { - parentFolder: root.parentFolder - } - - Keys.onDownPressed: { - incrementCurrentIndex() - } - Keys.onUpPressed: { - decrementCurrentIndex() - } - focus: true - - delegate: PlasmaComponents.ListItem { - width: listView.width - height: unit.size * 12 - - enabled: true - checked: listView.currentIndex == index - - Binding { - target: root - property: "currentMail" - when: listView.currentIndex == index - value: model.domainObject - } - - MouseArea { - anchors.fill: parent - - onClicked: { - listView.currentIndex = model.index - } - } - - Rectangle { - id: unread - - anchors.fill: parent - - // color: colorPalette.read - color: "steelblue" - opacity: 0.1 - - visible: model.unread - } - - Avatar { - id: avatar - - anchors { - verticalCenter: parent.verticalCenter - left: parent.left - leftMargin: unit.size * 2 - } - - height: unit.size * 9 - width: height - - name: model.senderName - } - - Label { - id: senderName - - anchors { - top: avatar.top - left: avatar.right - leftMargin: unit.size * 3 - } - - text: model.senderName - - font.weight: Font.DemiBold - } - - //The name currently contains both name and address - // Label { - // id: sender - // - // anchors { - // top: avatar.top - // left: senderName.right - // leftMargin: unit.size - // right: date.left - // rightMargin: unit.size - // } - // - // text: "(" + model.sender +")" - // - // clip: true - // } - - Label { - id: date - - anchors { - top: avatar.top - right: parent.right - rightMargin: unit.size * 2 - } - - text: Qt.formatDateTime(model.date) - - font.weight: Font.Light - } - - Label { - id: subject - - anchors { - bottom: avatar.bottom - left: avatar.right - leftMargin: unit.size * 3 - } - - text: model.subject - } - } - } -} diff --git a/applications/kube-mail/package/contents/ui/MailViewer.qml b/applications/kube-mail/package/contents/ui/MailViewer.qml deleted file mode 100644 index 1d305297..00000000 --- a/applications/kube-mail/package/contents/ui/MailViewer.qml +++ /dev/null @@ -1,43 +0,0 @@ -import QtQuick 2.4 -import QtQuick.Controls 1.3 -import QtQuick.Layouts 1.1 -import QtWebKit 3.0 - -import org.kde.kube.mail 1.0 as Mail - -Item { - id: root - property variant message; - property string html; - - WebView { - id: webview - anchors.fill: parent - onNavigationRequested: { - // detect URL scheme prefix, most likely an external link - var schemaRE = /^\w+:/; - if (schemaRE.test(request.url)) { - request.action = WebView.AcceptRequest; - } else { - request.action = WebView.IgnoreRequest; - // delegate request.url here - } - } - onLoadingChanged: { - console.warn("Error is ", loadRequest.errorString); - console.warn("Status is ", loadRequest.status); - } - } - - onHtmlChanged: { - // console.warn("HTML is ", html); - // The file:/// argument is necessary so local icons are found - webview.loadHtml(html, "file:///"); - } - - Mail.MessageParser { - id: messageParser - message: root.message - } - html: messageParser.html -} diff --git a/applications/kube-mail/package/contents/ui/Settings.qml b/applications/kube-mail/package/contents/ui/Settings.qml deleted file mode 100644 index da44d331..00000000 --- a/applications/kube-mail/package/contents/ui/Settings.qml +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 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 -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.1 - -import org.kde.kube.settings 1.0 as KubeSettings -import org.kde.kube.accounts.maildir 1.0 as Maildir - -Rectangle { - id: root - - visible: false - - color: colorPalette.border - - opacity: 0.9 - - MouseArea { - anchors.fill: parent - - onClicked: { - root.visible = false - } - } - - Rectangle { - anchors.centerIn: parent - - height: root.height * 0.8 - width: root.width * 0.8 - - color: colorPalette.background - - MouseArea { - anchors.fill: parent - } - - KubeSettings.Settings { - id: contextSettings - identifier: "applicationcontext" - property string currentAccountId: "current" - property var availableAccountTypes: ["maildir"] - property var accounts: ["current"] - } - - Column { - spacing: 5 - Repeater { - model: contextSettings.accounts - delegate: Maildir.AccountSettings { //This should be retrieved from the accounts plugin: KubeAccounts { identifier: modelData }.settingsUi - accountId: modelData - } - } - } - - //TODO: Add possibility to add more accounts - } -} diff --git a/applications/kube-mail/package/contents/ui/SingleMailView.qml b/applications/kube-mail/package/contents/ui/SingleMailView.qml deleted file mode 100644 index d6ae4bfa..00000000 --- a/applications/kube-mail/package/contents/ui/SingleMailView.qml +++ /dev/null @@ -1,74 +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 -import QtQuick.Controls 1.3 -import QtQuick.Layouts 1.1 - -import org.kde.kube.mail 1.0 as Mail - -Item { - id: root - property variant mail; - - Rectangle { - id: background - - anchors.fill: parent - - color: colorPalette.background - } - - Repeater { - anchors.fill: parent - - model: Mail.MailListModel { - mail: root.mail - } - - delegate: Item { - anchors.fill: parent - - ColumnLayout { - anchors.fill: parent - - Label { - text: model.id - } - - Label { - text: model.sender - } - - Label { - text: model.senderName - } - - Label { - text: model.subject - } - - MailViewer { - message: model.mimeMessage - Layout.fillHeight: true - Layout.fillWidth: true - } - - } - } - } -} diff --git a/applications/kube-mail/package/contents/ui/example.qml b/applications/kube-mail/package/contents/ui/example.qml deleted file mode 100644 index e0c0a077..00000000 --- a/applications/kube-mail/package/contents/ui/example.qml +++ /dev/null @@ -1,64 +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 -import QtQuick.Controls 1.3 -import QtQuick.Layouts 1.1 - -import org.kde.sink.mail 1.0 - -Item { - id: root - - MailList { - id: mailList - - query: "Some Query" - - } - - Button { - id: button - - anchors { - top: parent.top - right: parent.right - left: parent.left - } - - text: "add mail" - - onClicked: mailList.addMail("test test test"); - } - - ListView { - - anchors { - top: button.bottom - left: parent.left - right: parent.right - bottom: parent.bottom - } - - model: mailList.model - - delegate: Label { - - text: model.subject - } - } -} \ No newline at end of file diff --git a/applications/kube-mail/package/contents/ui/main.qml b/applications/kube-mail/package/contents/ui/main.qml deleted file mode 100644 index cf983dee..00000000 --- a/applications/kube-mail/package/contents/ui/main.qml +++ /dev/null @@ -1,200 +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 -import QtQuick.Controls 1.3 -import QtQuick.Layouts 1.1 -import org.kde.plasma.components 2.0 as PlasmaComponents - -import org.kde.kube.actions 1.0 as KubeAction -import org.kde.kube.settings 1.0 as KubeSettings - -ApplicationWindow { - id: app - - //FIXME remove fixed pixel hight - //for now just convinience during testing - height: 1080 * 0.7 - width: 1920 * 0.7 - - visible: true - - // Action.ActionHandler { - // actionId: "org.kde.kube.actions.mark-as-read" - // function isReady(context) { - // return context.mail ? true : false; - // } - // - // function handler(context) { - // console.warn("Got message:", context.mail) - // } - // } - - KubeAction.Context { - id: maillistcontext - property variant mail - mail: mailListView.currentMail - } - - KubeAction.Action { - id: markAsReadAction - actionId: "org.kde.kube.actions.mark-as-read" - context: maillistcontext - } - - KubeAction.Action { - id: deleteAction - actionId: "org.kde.kube.actions.delete" - context: maillistcontext - } - - //UI - toolBar: ToolBar { - - Row { - anchors.fill: parent - - PlasmaComponents.ToolButton { - height: parent.height - text: "Settings" - onClicked: { - settings.visible = true - } - } - - PlasmaComponents.ToolButton { - height: parent.height - iconName: "mail-message-new" - text: "Compose" - onClicked: { - composer.visible = true - } - } - - PlasmaComponents.ToolButton { - height: parent.height - iconName: "mail-message-reply" - text: "Reply" - onClicked: { - composer.originalMessage = mailListView.currentMail - composer.visible = true - } - } - - PlasmaComponents.ToolButton { - height: parent.height - iconName: "mail-mark-unread" - text: "Mark As Read" - enabled: markAsReadAction.ready - onClicked: { - markAsReadAction.execute() - } - } - - PlasmaComponents.ToolButton { - height: parent.height - iconName: "mail-mark-important" - text: "Mark Important" - enabled: false - onClicked: { - } - } - - PlasmaComponents.ToolButton { - height: parent.height - iconName: "edit-delete" - text: "Delete Mail" - enabled: deleteAction.ready - onClicked: { - deleteAction.execute() - } - } - - - } - Rectangle { - anchors { - right: parent.right - } - height: parent.height - color: "transparent" - Image { - id: img - height: parent.height - fillMode: Image.PreserveAspectCrop - anchors { - verticalCenter: parent.verticalCenter - left: parent.left - leftMargin: -20 - } - source: "image://kube/kube_logo" - sourceSize.height: parent.height * 2.5 - } - width: img.width * 0.7 - } - } - - SplitView { - anchors.fill: parent - - FolderListView { - id: folderListView - width: unit.size * 55 - Layout.maximumWidth: unit.size * 150 - Layout.minimumWidth: unit.size * 30 - } - - MailListView { - id: mailListView - parentFolder: folderListView.currentFolder - width: unit.size * 80 - Layout.maximumWidth: unit.size * 250 - Layout.minimumWidth: unit.size * 50 - focus: true - } - - SingleMailView { - id: mailView - mail: mailListView.currentMail - Layout.fillWidth: true - } - - } - - Settings { - id: settings - - anchors.fill: parent - } - - FocusComposer { - id: composer - - anchors.fill: parent - } - - //TODO find a better way to scale UI - Item { - id: unit - property int size: 5 - } - - ColorPalette { - id: colorPalette - } -} - diff --git a/applications/kube-mail/package/metadata.desktop b/applications/kube-mail/package/metadata.desktop deleted file mode 100644 index 630cc133..00000000 --- a/applications/kube-mail/package/metadata.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Name=Kube Mail -X-KDE-PluginInfo-Name=org.kde.kube.mail -Exec=kpackagelauncherqml -a org.kde.kube.mail -X-Plasma-MainScript=ui/main.qml -X-KDE-ServiceTypes=KPackage/GenericQML -Icon=kmail2 -Type=Service diff --git a/applications/mail/CMakeLists.txt b/applications/mail/CMakeLists.txt new file mode 100644 index 00000000..706be8aa --- /dev/null +++ b/applications/mail/CMakeLists.txt @@ -0,0 +1,30 @@ +project(kube-mail) + +cmake_minimum_required(VERSION 2.8.10.1) + +include(CPack) +include(FeatureSummary) +find_package(PkgConfig) + +################# set KDE specific information ################# + +find_package(ECM 0.0.8 REQUIRED NO_MODULE) + +# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) + +include(KDEInstallDirs) +include(KDECMakeSettings) +include(KDECompilerSettings) + +find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Widgets) + +set (QT_MIN_VERSION "5.4.0") +find_package(KF5 REQUIRED COMPONENTS Package) + +# install executable +add_executable(${PROJECT_NAME} main.cpp) +qt5_use_modules(${PROJECT_NAME} Gui Quick Widgets) +target_link_libraries(${PROJECT_NAME} KF5::Package) + +install(TARGETS ${PROJECT_NAME} DESTINATION bin) diff --git a/applications/mail/main.cpp b/applications/mail/main.cpp new file mode 100644 index 00000000..1ff4effb --- /dev/null +++ b/applications/mail/main.cpp @@ -0,0 +1,43 @@ +#include +#include + +#include +#include +#include +#include + +#include + +class KubeImageProvider : public QQuickImageProvider +{ +public: + KubeImageProvider() + : QQuickImageProvider(QQuickImageProvider::Pixmap) + { + } + + QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) Q_DECL_OVERRIDE + { + const auto icon = QIcon::fromTheme(id); + auto expectedSize = requestedSize; + if (!icon.availableSizes().contains(requestedSize) && !icon.availableSizes().isEmpty()) { + expectedSize = icon.availableSizes().first(); + } + const auto pixmap = icon.pixmap(expectedSize); + if (size) { + *size = pixmap.size(); + } + return pixmap; + } +}; + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + auto package = KPackage::PackageLoader::self()->loadPackage("KPackage/GenericQML", "org.kde.kube.mail"); + Q_ASSERT(package.isValid()); + QQmlApplicationEngine engine; + engine.addImageProvider(QLatin1String("kube"), new KubeImageProvider); + engine.load(QUrl::fromLocalFile(package.filePath("mainscript"))); + return app.exec(); +} diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt new file mode 100644 index 00000000..2227e170 --- /dev/null +++ b/components/CMakeLists.txt @@ -0,0 +1,26 @@ +project(kube-components) + +cmake_minimum_required(VERSION 2.8.10.1) + +include(CPack) +include(FeatureSummary) +find_package(PkgConfig) + +################# set KDE specific information ################# + +find_package(ECM 0.0.8 REQUIRED NO_MODULE) + +# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) + +include(KDEInstallDirs) +include(KDECMakeSettings) +include(KDECompilerSettings) + +find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Widgets) + +set (QT_MIN_VERSION "5.4.0") +find_package(KF5 REQUIRED COMPONENTS Package) + +# install UI package +kpackage_install_package(package org.kde.kube.mail "genericqml") diff --git a/components/package/contents/ui/Avatar.qml b/components/package/contents/ui/Avatar.qml new file mode 100644 index 00000000..33d6733c --- /dev/null +++ b/components/package/contents/ui/Avatar.qml @@ -0,0 +1,55 @@ +/* + * 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 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + + +Rectangle { + + property string name; + + //colors taken from https://techbase.kde.org/Projects/Usability/HIG/Color + function calcColor(x) + { + switch (x % 5) { + case 0: + return "#16a085" + case 1: + return "#27ae60" + case 2: + return "#2980b9" + case 3: + return "#8e44ad" + case 4: + return "#c0392b" + } + } + + radius: 2 + + color: calcColor(name.length) + + Text { + anchors.centerIn: parent + + text: name.charAt(0) + + color: "#ecf0f1" + } +} diff --git a/components/package/contents/ui/ColorPalette.qml b/components/package/contents/ui/ColorPalette.qml new file mode 100644 index 00000000..db85cac6 --- /dev/null +++ b/components/package/contents/ui/ColorPalette.qml @@ -0,0 +1,26 @@ +/* + * 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/Composer.qml b/components/package/contents/ui/Composer.qml new file mode 100644 index 00000000..1a6a4cc4 --- /dev/null +++ b/components/package/contents/ui/Composer.qml @@ -0,0 +1,221 @@ +/* + * 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 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 +import QtQuick.Controls 1.4 +import QtQuick.Layouts 1.1 +import org.kde.plasma.components 2.0 as PlasmaComponents + +import org.kde.kube.mail 1.0 as Mail + + +Item { + id: root + property variant originalMessage + + function send() { + composer.send() + } + + function saveAsDraft() { + composer.saveAsDraft() + } + + function clear() { + composer.clear(); + } + + Mail.Retriever { + id: retriever + propertyName: "mimeMessage" + model: Mail.MailListModel { + id: mailListModel + mail: root.originalMessage + } + } + + Mail.Composer { + id: composer + originalMessage: retriever.value + } + + ColumnLayout { + + anchors.fill: parent + + GridLayout { + + columns: 2 + + Label { + text: "From" + } + + ComboBox { + model: composer.identityModel + + Layout.fillWidth: true + + currentIndex: composer.fromIndex + + onCurrentIndexChanged: { + composer.fromIndex = currentIndex + } + } + + Label { + text: "To" + } + + RowLayout { + Layout.fillWidth: true + + TextField { + id: to + + Layout.fillWidth: true + + text: composer.to + + onTextChanged: { + composer.to = text; + } + } + + PlasmaComponents.Button { + id: ccButton + + text: "Cc" + + onClicked: { + cc.visible = true + ccButton.visible = false + } + } + + PlasmaComponents.Button { + id: bccButton + + text: "Bcc" + + onClicked: { + bcc.visible = true + bccButton.visible = false + } + } + } + + Label { + text: "Cc" + + visible: cc.visible + } + + TextField { + id: cc + + Layout.fillWidth: true + + visible: false + + text: composer.cc + + onTextChanged: { + composer.cc = text; + } + } + + Label { + text: "Bcc" + + visible: bcc.visible + } + + TextField { + id: bcc + + Layout.fillWidth: true + + visible : false + + text: composer.bcc + + onTextChanged: { + composer.bcc = text; + } + } + } + + TextField { + id: subject + + Layout.fillWidth: true + + placeholderText: "Enter Subject" + + text: composer.subject + + onTextChanged: { + composer.subject = text; + } + } + + Item { + + Layout.fillWidth: true + + height: subject.height * 1.5 + + PlasmaComponents.Button { + + anchors { + bottom: parent.bottom + } + + text: "Save as Draft" + + onClicked: { + composer.saveAsDraft() + } + } + + PlasmaComponents.Button { + + anchors { + bottom: parent.bottom + right: parent.right + } + + text: "Attach" + } + } + + TextArea { + id: content + + text: composer.body + + onTextChanged: { + composer.body = text; + } + + Layout.fillWidth: true + Layout.fillHeight: true + + } + } +} diff --git a/components/package/contents/ui/FocusComposer.qml b/components/package/contents/ui/FocusComposer.qml new file mode 100644 index 00000000..8ec01cc9 --- /dev/null +++ b/components/package/contents/ui/FocusComposer.qml @@ -0,0 +1,81 @@ +/* + * 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 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 +import QtQuick.Controls 1.4 +import QtQuick.Layouts 1.1 + +Rectangle { + id: root + property variant originalMessage + + visible: false + + color: colorPalette.border + + opacity: 0.9 + + MouseArea { + anchors.fill: parent + + onClicked: { + root.visible = false + } + } + + Rectangle { + anchors.centerIn: parent + + height: root.height * 0.8 + width: root.width * 0.8 + + color: colorPalette.background + + MouseArea { + anchors.fill: parent + } + + ColumnLayout { + + anchors { + fill: parent + margins: unit.size * 3 + } + + Composer { + id: composer + + Layout.fillWidth: true + Layout.fillHeight: true + originalMessage: root.originalMessage + } + + RowLayout { + Layout.alignment: Qt.AlignRight + + Button { + text: "Send" + + onClicked: { + composer.send() + root.visible = false + } + } + } + } + } +} \ No newline at end of file diff --git a/components/package/contents/ui/FolderListView.qml b/components/package/contents/ui/FolderListView.qml new file mode 100644 index 00000000..1934932c --- /dev/null +++ b/components/package/contents/ui/FolderListView.qml @@ -0,0 +1,116 @@ +/* + * 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 +import QtQuick.Controls 1.4 +import QtQuick.Controls.Styles 1.4 +import QtQuick.Layouts 1.1 + +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.components 2.0 as PlasmaComponents + +import org.kde.kube.mail 1.0 as Mail + +Item { + id: root + property variant currentFolder + SystemPalette { id: colorPalette; colorGroup: SystemPalette.Active } + + Item { + id: searchBox + + width: root.width + height: unit.size * 10 + + TextField { + anchors. centerIn: parent + + width: parent.width * 0.9 + + placeholderText: "Search all email..." + } + } + + TreeView { + id: treeView + anchors { + top: searchBox.bottom + left: parent.left + right: parent.right + bottom: parent.bottom + } + TableViewColumn { + title: "Name" + role: "name" + width: treeView.width - 5 + } + model: Mail.FolderListModel { id: folderListModel } + onCurrentIndexChanged: { + model.fetchMore(currentIndex) + root.currentFolder = model.data(currentIndex, Mail.FolderListModel.DomainObject) + } + backgroundVisible: false + headerVisible: false + style: TreeViewStyle { + activateItemOnSingleClick: true + rowDelegate: Rectangle { + height: unit.size * 10 + color: "transparent" + } + itemDelegate: Rectangle { + radius: 5 + border.width: 1 + border.color: "lightgrey" + color: styleData.selected ? colorPalette.highlight : colorPalette.button + PlasmaCore.IconItem { + id: iconItem + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + leftMargin: unit.size * 3 + } + source: model.icon + } + Label { + anchors { + verticalCenter: parent.verticalCenter + left: iconItem.right + leftMargin: unit.size * 3 + } + renderType: Text.NativeRendering + text: styleData.value + font.pixelSize: 16 + font.bold: true + color: styleData.selected ? colorPalette.highlightedText : colorPalette.text + } + } + branchDelegate: Item { + width: 16 + height: 16 + Text { + visible: styleData.column === 0 && styleData.hasChildren + text: styleData.isExpanded ? "\u25bc" : "\u25b6" + color: !control.activeFocus || styleData.selected ? styleData.textColor : "#666" + font.pointSize: 10 + renderType: Text.NativeRendering + anchors.centerIn: parent + anchors.verticalCenterOffset: styleData.isExpanded ? 2 : 0 + } + } + } + } +} diff --git a/components/package/contents/ui/FolderModel.qml b/components/package/contents/ui/FolderModel.qml new file mode 100644 index 00000000..b20a1606 --- /dev/null +++ b/components/package/contents/ui/FolderModel.qml @@ -0,0 +1,36 @@ +import QtQuick 2.4 + +ListModel { + ListElement { + icon: "mail-folder-inbox" + name: "Inbox" + } + ListElement { + icon: "mail-folder-sent" + name: "Sent" + } + ListElement { + icon: "user-trash" + name: "Trash" + } + ListElement { + icon: "document-edit" + name: "Drafts" + } + ListElement { + icon: "folder" + name: "cats" + } + ListElement { + icon: "folder" + name: "dogs" + } + ListElement { + icon: "folder" + name: "dragons" + } + ListElement { + icon: "folder" + name: "long tailed dragons" + } +} \ No newline at end of file diff --git a/components/package/contents/ui/ListItem.qml b/components/package/contents/ui/ListItem.qml new file mode 100644 index 00000000..5396645d --- /dev/null +++ b/components/package/contents/ui/ListItem.qml @@ -0,0 +1,63 @@ +/* + * 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 + +Item { + id: delegateRoot + + readonly property bool isCurrentItem: ListView.isCurrentItem + + height: unit.width * 25 + width: parent.width + + MouseArea { + id: mouseArea + + anchors.fill: parent + } + + Rectangle { + anchors.fill: parent + + color: colorPalette.background + + //clickColor + Rectangle { + id: clickColor + + anchors.fill: parent + + color: colorPalette.selected + opacity: 0.4 + + visible: mouseArea.pressed + } + + //border + Rectangle { + + anchors.bottom: parent.bottom + + height: 1 + width: parent.width + + color: colorPalette.border + opacity: 0.2 + } + } +} \ No newline at end of file diff --git a/components/package/contents/ui/MailListModel.qml b/components/package/contents/ui/MailListModel.qml new file mode 100644 index 00000000..bf0f70a2 --- /dev/null +++ b/components/package/contents/ui/MailListModel.qml @@ -0,0 +1,149 @@ +/* + * 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 + +ListModel { + ListElement { + sender: "mighty@mail.com" + senderName: "Mighty Monkey" + subject: "I feel weak without my bananas" + date: "19:21" + unread: true + } + ListElement { + sender: "benni@bandana.org" + senderName: "Ben Bandana" + subject: "Check this out" + date: "16:01" + unread: true + } + ListElement { + sender: "alice@mail.com" + senderName: "Alice Cheng" + subject: "Re: We need more food" + date: "12:55" + unread: false + } + ListElement { + sender: "bob@bandana.org" + senderName: "Bob Ross" + subject: "KDE Rocks" + date: "Sat" + unread: true + } + ListElement { + sender: "tiny@mail.com" + senderName: "Tiny" + subject: "Huge success!!" + date: "Sat" + unread: false + } + ListElement { + sender: "bob@bandana.org" + senderName: "Bob Ross" + subject: "KDE Rocks" + date: "Fr" + unread: false + } + ListElement { + sender: "Laura@mail.com" + senderName: "Laura B" + subject: ":)" + date: "Thu" + unread: false + } + ListElement { + sender: "Andreas@stars.org" + senderName: "Andreas Rockstar" + subject: "KDE Rocks" + date: "Wed" + unread: false + } + ListElement { + sender: "alice@mail.com" + senderName: "Alice Cheng" + subject: "Re: We need more food" + date: "Wed" + } + ListElement { + sender: "bob@bandana.org" + senderName: "Bob Ross" + subject: "KDE Rocks" + date: "Mon" + } + ListElement { + sender: "mighty@mail.com" + senderName: "Mighty Monkey" + subject: "I feel weak without my bananas" + date: "Nov 20" + } + ListElement { + sender: "benni@bandana.org" + senderName: "Ben Bandana" + subject: "Check this out" + date: "Nov 15" + } + ListElement { + sender: "alice@mail.com" + senderName: "Alice Cheng" + subject: "Re: We need more food" + date: "Sep 29" + } + ListElement { + sender: "bob@bandana.org" + senderName: "Bob Ross" + subject: "KDE Rocks" + date: "Sep 14" + } + ListElement { + sender: "tiny@mail.com" + senderName: "Tiny" + subject: "Huge success!!" + date: "Sep 14" + } + ListElement { + sender: "bob@bandana.org" + senderName: "Bob Ross" + subject: "KDE Rocks" + date: "Sep 5" + } + ListElement { + sender: "Laura@mail.com" + senderName: "Laura B" + subject: ":)" + date: "Sep 4" + } + ListElement { + sender: "Andreas@stars.org" + senderName: "Andreas Rockstar" + subject: "KDE Rocks" + date: "May 25" + } + ListElement { + sender: "alice@mail.com" + senderName: "Alice Cheng" + subject: "Re: We need more food" + date: "May 3" + } + ListElement { + sender: "bob@bandana.org" + senderName: "Bob Ross" + subject: "Board Task: Write draft email to people with KDE accounts commiting to Qt repositories" + date: "Dec 2014" + } +} \ No newline at end of file diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml new file mode 100644 index 00000000..ff773e0e --- /dev/null +++ b/components/package/contents/ui/MailListView.qml @@ -0,0 +1,155 @@ +/* + * 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 +import QtQuick.Controls 1.4 +import QtQuick.Layouts 1.1 + +import QtQml 2.2 + +import org.kde.plasma.components 2.0 as PlasmaComponents + +import org.kde.kube.mail 1.0 as Mail + +ScrollView { + id: root + property variant parentFolder + property variant currentMail + + ListView { + id: listView + + model: Mail.MailListModel { + parentFolder: root.parentFolder + } + + Keys.onDownPressed: { + incrementCurrentIndex() + } + Keys.onUpPressed: { + decrementCurrentIndex() + } + focus: true + + delegate: PlasmaComponents.ListItem { + width: listView.width + height: unit.size * 12 + + enabled: true + checked: listView.currentIndex == index + + Binding { + target: root + property: "currentMail" + when: listView.currentIndex == index + value: model.domainObject + } + + MouseArea { + anchors.fill: parent + + onClicked: { + listView.currentIndex = model.index + } + } + + Rectangle { + id: unread + + anchors.fill: parent + + // color: colorPalette.read + color: "steelblue" + opacity: 0.1 + + visible: model.unread + } + + Avatar { + id: avatar + + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + leftMargin: unit.size * 2 + } + + height: unit.size * 9 + width: height + + name: model.senderName + } + + Label { + id: senderName + + anchors { + top: avatar.top + left: avatar.right + leftMargin: unit.size * 3 + } + + text: model.senderName + + font.weight: Font.DemiBold + } + + //The name currently contains both name and address + // Label { + // id: sender + // + // anchors { + // top: avatar.top + // left: senderName.right + // leftMargin: unit.size + // right: date.left + // rightMargin: unit.size + // } + // + // text: "(" + model.sender +")" + // + // clip: true + // } + + Label { + id: date + + anchors { + top: avatar.top + right: parent.right + rightMargin: unit.size * 2 + } + + text: Qt.formatDateTime(model.date) + + font.weight: Font.Light + } + + Label { + id: subject + + anchors { + bottom: avatar.bottom + left: avatar.right + leftMargin: unit.size * 3 + } + + text: model.subject + } + } + } +} diff --git a/components/package/contents/ui/MailViewer.qml b/components/package/contents/ui/MailViewer.qml new file mode 100644 index 00000000..1d305297 --- /dev/null +++ b/components/package/contents/ui/MailViewer.qml @@ -0,0 +1,43 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 +import QtWebKit 3.0 + +import org.kde.kube.mail 1.0 as Mail + +Item { + id: root + property variant message; + property string html; + + WebView { + id: webview + anchors.fill: parent + onNavigationRequested: { + // detect URL scheme prefix, most likely an external link + var schemaRE = /^\w+:/; + if (schemaRE.test(request.url)) { + request.action = WebView.AcceptRequest; + } else { + request.action = WebView.IgnoreRequest; + // delegate request.url here + } + } + onLoadingChanged: { + console.warn("Error is ", loadRequest.errorString); + console.warn("Status is ", loadRequest.status); + } + } + + onHtmlChanged: { + // console.warn("HTML is ", html); + // The file:/// argument is necessary so local icons are found + webview.loadHtml(html, "file:///"); + } + + Mail.MessageParser { + id: messageParser + message: root.message + } + html: messageParser.html +} diff --git a/components/package/contents/ui/Settings.qml b/components/package/contents/ui/Settings.qml new file mode 100644 index 00000000..da44d331 --- /dev/null +++ b/components/package/contents/ui/Settings.qml @@ -0,0 +1,74 @@ +/* + * 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 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 +import QtQuick.Controls 1.4 +import QtQuick.Layouts 1.1 + +import org.kde.kube.settings 1.0 as KubeSettings +import org.kde.kube.accounts.maildir 1.0 as Maildir + +Rectangle { + id: root + + visible: false + + color: colorPalette.border + + opacity: 0.9 + + MouseArea { + anchors.fill: parent + + onClicked: { + root.visible = false + } + } + + Rectangle { + anchors.centerIn: parent + + height: root.height * 0.8 + width: root.width * 0.8 + + color: colorPalette.background + + MouseArea { + anchors.fill: parent + } + + KubeSettings.Settings { + id: contextSettings + identifier: "applicationcontext" + property string currentAccountId: "current" + property var availableAccountTypes: ["maildir"] + property var accounts: ["current"] + } + + Column { + spacing: 5 + Repeater { + model: contextSettings.accounts + delegate: Maildir.AccountSettings { //This should be retrieved from the accounts plugin: KubeAccounts { identifier: modelData }.settingsUi + accountId: modelData + } + } + } + + //TODO: Add possibility to add more accounts + } +} diff --git a/components/package/contents/ui/SingleMailView.qml b/components/package/contents/ui/SingleMailView.qml new file mode 100644 index 00000000..d6ae4bfa --- /dev/null +++ b/components/package/contents/ui/SingleMailView.qml @@ -0,0 +1,74 @@ +/* + * 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 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +import org.kde.kube.mail 1.0 as Mail + +Item { + id: root + property variant mail; + + Rectangle { + id: background + + anchors.fill: parent + + color: colorPalette.background + } + + Repeater { + anchors.fill: parent + + model: Mail.MailListModel { + mail: root.mail + } + + delegate: Item { + anchors.fill: parent + + ColumnLayout { + anchors.fill: parent + + Label { + text: model.id + } + + Label { + text: model.sender + } + + Label { + text: model.senderName + } + + Label { + text: model.subject + } + + MailViewer { + message: model.mimeMessage + Layout.fillHeight: true + Layout.fillWidth: true + } + + } + } + } +} diff --git a/components/package/contents/ui/example.qml b/components/package/contents/ui/example.qml new file mode 100644 index 00000000..e0c0a077 --- /dev/null +++ b/components/package/contents/ui/example.qml @@ -0,0 +1,64 @@ +/* + * 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 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +import org.kde.sink.mail 1.0 + +Item { + id: root + + MailList { + id: mailList + + query: "Some Query" + + } + + Button { + id: button + + anchors { + top: parent.top + right: parent.right + left: parent.left + } + + text: "add mail" + + onClicked: mailList.addMail("test test test"); + } + + ListView { + + anchors { + top: button.bottom + left: parent.left + right: parent.right + bottom: parent.bottom + } + + model: mailList.model + + delegate: Label { + + text: model.subject + } + } +} \ No newline at end of file diff --git a/components/package/contents/ui/main.qml b/components/package/contents/ui/main.qml new file mode 100644 index 00000000..cf983dee --- /dev/null +++ b/components/package/contents/ui/main.qml @@ -0,0 +1,200 @@ +/* + * 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 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 +import org.kde.plasma.components 2.0 as PlasmaComponents + +import org.kde.kube.actions 1.0 as KubeAction +import org.kde.kube.settings 1.0 as KubeSettings + +ApplicationWindow { + id: app + + //FIXME remove fixed pixel hight + //for now just convinience during testing + height: 1080 * 0.7 + width: 1920 * 0.7 + + visible: true + + // Action.ActionHandler { + // actionId: "org.kde.kube.actions.mark-as-read" + // function isReady(context) { + // return context.mail ? true : false; + // } + // + // function handler(context) { + // console.warn("Got message:", context.mail) + // } + // } + + KubeAction.Context { + id: maillistcontext + property variant mail + mail: mailListView.currentMail + } + + KubeAction.Action { + id: markAsReadAction + actionId: "org.kde.kube.actions.mark-as-read" + context: maillistcontext + } + + KubeAction.Action { + id: deleteAction + actionId: "org.kde.kube.actions.delete" + context: maillistcontext + } + + //UI + toolBar: ToolBar { + + Row { + anchors.fill: parent + + PlasmaComponents.ToolButton { + height: parent.height + text: "Settings" + onClicked: { + settings.visible = true + } + } + + PlasmaComponents.ToolButton { + height: parent.height + iconName: "mail-message-new" + text: "Compose" + onClicked: { + composer.visible = true + } + } + + PlasmaComponents.ToolButton { + height: parent.height + iconName: "mail-message-reply" + text: "Reply" + onClicked: { + composer.originalMessage = mailListView.currentMail + composer.visible = true + } + } + + PlasmaComponents.ToolButton { + height: parent.height + iconName: "mail-mark-unread" + text: "Mark As Read" + enabled: markAsReadAction.ready + onClicked: { + markAsReadAction.execute() + } + } + + PlasmaComponents.ToolButton { + height: parent.height + iconName: "mail-mark-important" + text: "Mark Important" + enabled: false + onClicked: { + } + } + + PlasmaComponents.ToolButton { + height: parent.height + iconName: "edit-delete" + text: "Delete Mail" + enabled: deleteAction.ready + onClicked: { + deleteAction.execute() + } + } + + + } + Rectangle { + anchors { + right: parent.right + } + height: parent.height + color: "transparent" + Image { + id: img + height: parent.height + fillMode: Image.PreserveAspectCrop + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + leftMargin: -20 + } + source: "image://kube/kube_logo" + sourceSize.height: parent.height * 2.5 + } + width: img.width * 0.7 + } + } + + SplitView { + anchors.fill: parent + + FolderListView { + id: folderListView + width: unit.size * 55 + Layout.maximumWidth: unit.size * 150 + Layout.minimumWidth: unit.size * 30 + } + + MailListView { + id: mailListView + parentFolder: folderListView.currentFolder + width: unit.size * 80 + Layout.maximumWidth: unit.size * 250 + Layout.minimumWidth: unit.size * 50 + focus: true + } + + SingleMailView { + id: mailView + mail: mailListView.currentMail + Layout.fillWidth: true + } + + } + + Settings { + id: settings + + anchors.fill: parent + } + + FocusComposer { + id: composer + + anchors.fill: parent + } + + //TODO find a better way to scale UI + Item { + id: unit + property int size: 5 + } + + ColorPalette { + id: colorPalette + } +} + diff --git a/components/package/metadata.desktop b/components/package/metadata.desktop new file mode 100644 index 00000000..630cc133 --- /dev/null +++ b/components/package/metadata.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Kube Mail +X-KDE-PluginInfo-Name=org.kde.kube.mail +Exec=kpackagelauncherqml -a org.kde.kube.mail +X-Plasma-MainScript=ui/main.qml +X-KDE-ServiceTypes=KPackage/GenericQML +Icon=kmail2 +Type=Service -- cgit v1.2.3