Add remove action to records. Use popup sheet with old calendar widget to select dates.

This commit is contained in:
2020-06-10 09:48:09 -04:00
parent 84dd6d1efc
commit 1852fbc6d2

View File

@@ -2,6 +2,7 @@ import QtQuick 2.9
import org.kde.kirigami 2.12 as Kirigami import org.kde.kirigami 2.12 as Kirigami
import QtQuick.Controls 2.9 as Controls import QtQuick.Controls 2.9 as Controls
import QtQuick.Layouts 1.12 as Layouts import QtQuick.Layouts 1.12 as Layouts
import QtQuick.Controls 1.4 as Old
Kirigami.ApplicationWindow { Kirigami.ApplicationWindow {
id: root id: root
@@ -223,6 +224,15 @@ Kirigami.ApplicationWindow {
text: notes 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")+":" Kirigami.FormData.label: qsTr("Service Type")+":"
} }
Controls.TextField { Layouts.RowLayout {
id: dateField
selectByMouse: true
Kirigami.FormData.label: qsTr("Date")+":" 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 { 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());
}
}
}
} }
} }
} }