mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Fix Enter key handling on material management page
This commit is contained in:
parent
aa8d91faf6
commit
6058f632df
3 changed files with 15 additions and 0 deletions
|
|
@ -99,6 +99,7 @@ TabView
|
||||||
property var new_diameter_value: null;
|
property var new_diameter_value: null;
|
||||||
property var old_diameter_value: null;
|
property var old_diameter_value: null;
|
||||||
property var old_approximate_diameter_value: null;
|
property var old_approximate_diameter_value: null;
|
||||||
|
property bool keyPressed: false
|
||||||
|
|
||||||
onYes:
|
onYes:
|
||||||
{
|
{
|
||||||
|
|
@ -112,6 +113,16 @@ TabView
|
||||||
properties.diameter = old_diameter_value;
|
properties.diameter = old_diameter_value;
|
||||||
diameterSpinBox.value = properties.diameter;
|
diameterSpinBox.value = properties.diameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onVisibilityChanged:
|
||||||
|
{
|
||||||
|
if (!visible && !keyPressed)
|
||||||
|
{
|
||||||
|
// If the user closes this dialog without clicking on any button, it's the same as clicking "No".
|
||||||
|
no();
|
||||||
|
}
|
||||||
|
keyPressed = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Display Name") }
|
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Display Name") }
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ Item
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
onEditingFinished: base.editingFinished()
|
onEditingFinished: base.editingFinished()
|
||||||
|
Keys.onEnterPressed: base.editingFinished()
|
||||||
|
Keys.onReturnPressed: base.editingFinished()
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,8 @@ Item
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
onEditingFinished: base.editingFinished()
|
onEditingFinished: base.editingFinished()
|
||||||
|
Keys.onEnterPressed: base.editingFinished()
|
||||||
|
Keys.onReturnPressed: base.editingFinished()
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue