From 1852fbc6d29eac59924317cb0e09c9afa83ff87a Mon Sep 17 00:00:00 2001 From: Kevin Whitaker Date: Wed, 10 Jun 2020 09:48:09 -0400 Subject: [PATCH] Add remove action to records. Use popup sheet with old calendar widget to select dates. --- src/contents/ui/main.qml | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/src/contents/ui/main.qml b/src/contents/ui/main.qml index 1bcdc62..83d2d51 100644 --- a/src/contents/ui/main.qml +++ b/src/contents/ui/main.qml @@ -2,6 +2,7 @@ import QtQuick 2.9 import org.kde.kirigami 2.12 as Kirigami import QtQuick.Controls 2.9 as Controls import QtQuick.Layouts 1.12 as Layouts +import QtQuick.Controls 1.4 as Old Kirigami.ApplicationWindow { id: root @@ -223,6 +224,15 @@ Kirigami.ApplicationWindow { text: notes } } + actions: [ + Kirigami.Action { + text: qsTr("Remove") + iconName: "edit-delete" + onTriggered: { + //TODO + } + } + ] } } } @@ -259,11 +269,21 @@ Kirigami.ApplicationWindow { Kirigami.FormData.label: qsTr("Service Type")+":" } - Controls.TextField { - id: dateField - selectByMouse: true + Layouts.RowLayout { Kirigami.FormData.label: qsTr("Date")+":" - inputMethodHints: Qt.ImhDate //TODO: implement better input + Controls.TextField { + id: dateField + text: new Date().toLocaleDateString(Qt.locale()) + readOnly: true + } + Controls.Button { + icon.name: "office-calendar" + text: qsTr("Select Date") + display: Controls.AbstractButton.IconOnly + onClicked: { + calendarPopup.open(); + } + } } Controls.TextField { @@ -302,6 +322,16 @@ Kirigami.ApplicationWindow { } } } + + Kirigami.OverlaySheet { + id: calendarPopup + Old.Calendar { + selectedDate: Date.fromLocaleDateString(Qt.locale(), dateField.text) + onClicked: { + dateField.text = date.toLocaleDateString(Qt.locale()); + } + } + } } } } -- GitLab