diff --git a/views/calendar/qml/EventView.qml b/views/calendar/qml/EventView.qml index 1d1ebb56..56b3e787 100644 --- a/views/calendar/qml/EventView.qml +++ b/views/calendar/qml/EventView.qml @@ -1,102 +1,84 @@ /* * Copyright (C) 2018 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.4 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.3 import org.kube.framework 1.0 as Kube FocusScope { id: root property var controller - width: Kube.Units.gridUnit * 7 * 7 + Kube.Units.gridUnit * 2 - height: Kube.Units.gridUnit * 27 + width: contentLayout.implicitWidth + 2 * Kube.Units.smallSpacing + height: contentLayout.implicitHeight + 2 * Kube.Units.smallSpacing Rectangle { anchors { fill: parent } - color: Kube.Colors.viewBackgroundColor - Column { - + ColumnLayout { + id: contentLayout anchors { - fill: parent - margins: Kube.Units.smallSpacing + centerIn: parent } spacing: Kube.Units.largeSpacing - Kube.TextField { + Kube.Label { width: parent.width - placeholderText: "Title" text: controller.summary + font.bold: true } - RowLayout { - spacing: Kube.Units.smallSpacing - - DayChooser { } - - TimeChooser { - visible: !controller.allDay - } - Kube.Label { - text: " " + qsTr("until") + " " - } - - DayChooser { } - - TimeChooser { - visible: !controller.allDay - } + Kube.Label { + visible: controller.allDay + text: controller.start.toLocaleString(Qt.locale(), "dd. MMMM") + " - " + controller.end.toLocaleString(Qt.locale(), "dd. MMMM") + } + Kube.Label { + visible: !controller.allDay + text: controller.start.toLocaleString(Qt.locale(), "dd. MMMM hh:mm") + " - " + controller.end.toLocaleString(Qt.locale(), "dd. MMMM hh:mm") } + Kube.Label { + text: controller.description + } RowLayout { - spacing: Kube.Units.largeSpacing - - RowLayout { - Layout.fillHeight: true - Kube.CheckBox { - checked: controller.allDay - onClicked: { - controller.allDay = !controller.allDay - } - } - - Kube.Label { - text: "All day" + Kube.Button { + text: qsTr("Remove") + onClicked: { + root.controller.remove() } } - - Kube.ComboBox { - model: ["once", "daily", "weekly"] + Item { + Layout.fillWidth: true + } + Kube.Button { + text: qsTr("Edit") + onClicked: { + //TODO + } } - } - Kube.TextEditor { - width: parent.width - height: 200 - text: controller.description } } } }