Skip to content

Commit 182a9de

Browse files
committed
Merge branch '66-plantingform-cannot-update-unit' into 'master'
Resolve "PlantingForm: cannot update unit" Closes #66 See merge request ah/qrop!32
2 parents b84ea73 + add86e6 commit 182a9de

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

desktop/qml/PlantingDialog.qml

+5-4
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,14 @@ Dialog {
7373
contentHeight: scrollView.implicitHeight
7474

7575
Shortcut {
76-
sequence: "Ctrl+Enter"
77-
enabled: parent.visible
76+
sequences: ["Ctrl+Enter", "Ctrl+Return"]
77+
enabled: dialog.visible
7878
context: Qt.ApplicationShortcut
79-
onActivated: if (plantingForm.accepted) accept();
79+
onActivated: {
80+
if (plantingForm.accepted) accept();
81+
}
8082
}
8183

82-
8384
header: PlantingFormHeader {
8485
visible: mode === "add"
8586
id: plantingFormHeader

desktop/qml/PlantingForm.qml

+1
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ Flickable {
177177
var value = widgetField[i][2]
178178

179179
if ((widget instanceof MyTextField && widget.manuallyModified)
180+
|| (widget instanceof MyComboBox && widget.manuallyModified)
180181
|| (widget instanceof CheckBox && widget.manuallyModified)
181182
|| (widget instanceof DatePicker && widget.modified)) {
182183
map[name] = value;

desktop/qml/TaskDialog.qml

+9
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ Dialog {
6868
Material.background: Material.color(Material.Grey, Material.Shade100)
6969
height: sowPlantTask ? taskForm.implicitHeight + Units.smallSpacing : parent.height - 2 * Units.smallSpacing
7070

71+
Shortcut {
72+
sequences: ["Ctrl+Enter", "Ctrl+Return"]
73+
enabled: dialog.visible
74+
context: Qt.ApplicationShortcut
75+
onActivated: {
76+
if (taskForm.accepted) accept();
77+
}
78+
}
79+
7180
header: TaskDialogHeader {
7281
id: taskDialogHeader
7382
width: parent.width

0 commit comments

Comments
 (0)