diff --git a/framework/qml/Icons.qml b/framework/qml/Icons.qml index f40ff9b0..31cfb58b 100644 --- a/framework/qml/Icons.qml +++ b/framework/qml/Icons.qml @@ -1,85 +1,92 @@ /* Copyright (C) 2017 Michael Bohlender, Copyright (C) 2017 Christian Mollekopf, This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ pragma Singleton import QtQuick 2.7 Item { + function iconName(name, invert) { + if (invert) { + return name + "-inverted" + } + return name + } + property string error: "error" property string info_inverted: "documentinfo-inverted" property string error_inverted: "error-inverted" property string busy: "view-refresh" property string busy_inverted: "view-refresh-inverted" property string noNetworkConnection_inverted: "network-disconnect-inverted" property string connected: "dialog-ok" property string connected_inverted: "dialog-ok-inverted" property string success: "dialog-ok" property string success_inverted: "dialog-ok-inverted" property string markAsRead: "mail-mark-read" property string markAsUnread: "mail-mark-unread-new" property string markImportant: "kubeimportant" property string markUnimportant: "kubeunimportant" property string isImportant: "kubeimportant" property string undo: "edit-undo-inverted" property string moveToTrash: "kubetrash" property string edit: "document-edit" property string edit_inverted: "document-edit-inverted" property string replyToSender: "mail-reply-sender" property string forward: "mail-forward" property string outbox: "mail-folder-outbox" property string outbox_inverted: "mail-folder-outbox-inverted" property string copy: "edit-copy" property string menu_inverted: "application-menu-inverted" property string group: "group" property string user: "im-user" property string user_inverted: "im-user-inverted" property string search_inverted: "edit-find-inverted" property string mail_inverted: "mail-message-inverted" property string goBack: "go-previous" property string goBack_inverted: "go-previous-inverted" property string goNext: "go-next" property string goNext_inverted: "go-next-inverted" property string goDown: "go-down" property string goDown_inverted: "go-down-inverted" property string goUp: "go-up" property string checkbox: "checkbox" property string checkbox_inverted: "checkbox-inverted" property string password_show: "password-show-on" property string password_hide: "password-show-off" property string secure: "document-encrypt" property string insecure: "document-decrypt" property string signed: "document-sign" property string key_import_inverted: "view-certificate-import-inverted" property string addNew: "list-add" property string listRemove: "list-remove" property string remove: "kube-list-remove-inverted" property string folder: "folder" property string save_inverted: "document-save-inverted" property string bold: "format-text-bold-symbolic" property string italic: "format-text-italic-symbolic" property string underline: "format-text-underline-symbolic" property string help: "question-inverted" } diff --git a/views/calendar/qml/DateSelector.qml b/views/calendar/qml/DateSelector.qml index 77138ee0..5b842d1b 100644 --- a/views/calendar/qml/DateSelector.qml +++ b/views/calendar/qml/DateSelector.qml @@ -1,114 +1,117 @@ /* * Copyright (C) 2018 Christian Mollekopf, * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.4 import QtQuick.Controls 2.2 import Qt.labs.calendar 1.0 import org.kube.framework 1.0 as Kube Column { id: root property date selectedDate - spacing: Kube.Units.smallSpacing + property color backgroundColor: Kube.Colors.darkBackgroundColor + property color textColor: Kube.Colors.highlightedTextColor + property bool invertIcons: true + spacing: Kube.Units.smallSpacing Item { anchors { left: parent.left right: parent.right } height: Kube.Units.gridUnit Kube.IconButton { anchors { verticalCenter: parent.verticalCenter left: parent.left } height: parent.height width: parent.height - color: Kube.Colors.darkBackgroundColor - iconName: Kube.Icons.goBack_inverted + color: root.backgroundColor + iconName: Kube.Icons.iconName(Kube.Icons.goBack, root.invertIcons) onClicked: { var dateOffset = (24*60*60*1000) * 7; //7 days var myDate = root.selectedDate; myDate.setTime(myDate.getTime() - dateOffset); root.selectedDate = myDate } } Kube.Label { anchors { verticalCenter: parent.verticalCenter horizontalCenter: parent.horizontalCenter } - color: Kube.Colors.highlightedTextColor + color: root.textColor font.bold: true text: root.selectedDate.toLocaleString(Qt.locale(), "MMMM yyyy") } Kube.IconButton { anchors { verticalCenter: parent.verticalCenter right: parent.right } height: parent.height width: parent.height - color: Kube.Colors.darkBackgroundColor - iconName: Kube.Icons.goNext_inverted + color: root.backgroundColor + iconName: Kube.Icons.iconName(Kube.Icons.goNext, root.invertIcons) onClicked: { var dateOffset = (24*60*60*1000) * 7; //7 days var myDate = root.selectedDate; myDate.setTime(myDate.getTime() + dateOffset); root.selectedDate = myDate } } } MonthGrid { id: grid anchors { left: parent.left right: parent.right } month: root.selectedDate.getMonth() year: root.selectedDate.getFullYear() locale: Qt.locale() delegate: Text { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter opacity: model.month === grid.month ? 1 : 0.5 text: model.day font: grid.font - color: Kube.Colors.highlightedTextColor + color: root.textColor Rectangle { anchors { left: parent.left right: parent.right bottom: parent.bottom } width: Kube.Units.gridUnit height: 3 color: Kube.Colors.plasmaBlue opacity: 0.6 visible: model.day === root.selectedDate.getDate() && model.month === root.selectedDate.getMonth() } } onClicked: { root.selectedDate = date } } } diff --git a/views/calendar/qml/DayChooser.qml b/views/calendar/qml/DayChooser.qml index d3e45ea8..59b7caa4 100644 --- a/views/calendar/qml/DayChooser.qml +++ b/views/calendar/qml/DayChooser.qml @@ -1,57 +1,61 @@ /* * Copyright (C) 2017 Michael Bohlender, * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.7 import QtQuick.Layouts 1.2 import org.kube.framework 1.0 as Kube import Qt.labs.calendar 1.0 Item { id: root height: button.height width: button.width Kube.Button { id: button text: "Choose Date" onClicked: { popup.open() } Kube.Popup { id: popup property var year: 2018 property var month: Calendar.April x: button.x y: button.y + button.height width: 100 + Kube.Units.largeSpacing * 2 height: 100 + Kube.Units.largeSpacing * 2 modal: true focus: true DateSelector { anchors.fill: parent + selectedDate: new Date() + backgroundColor: Kube.Colors.backgroundColor + textColor: Kube.Colors.textColor + invertIcons: false } } } }