Add remove action to records. Use popup sheet with old calendar widget to select dates.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user