mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 21:55:52 +08:00
Merge pull request #6594 from fieldOfView/fix_jobname_editing
Make jobname less sensitive to being touched
This commit is contained in:
commit
8b9e5c5154
@ -83,10 +83,22 @@ Item
|
|||||||
text: PrintInformation.jobName
|
text: PrintInformation.jobName
|
||||||
horizontalAlignment: TextInput.AlignLeft
|
horizontalAlignment: TextInput.AlignLeft
|
||||||
|
|
||||||
|
property string textBeforeEdit: ""
|
||||||
|
|
||||||
|
onActiveFocusChanged:
|
||||||
|
{
|
||||||
|
if (activeFocus)
|
||||||
|
{
|
||||||
|
textBeforeEdit = text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onEditingFinished:
|
onEditingFinished:
|
||||||
{
|
{
|
||||||
|
if (text != textBeforeEdit) {
|
||||||
var new_name = text == "" ? catalog.i18nc("@text Print job name", "Untitled") : text
|
var new_name = text == "" ? catalog.i18nc("@text Print job name", "Untitled") : text
|
||||||
PrintInformation.setJobName(new_name, true)
|
PrintInformation.setJobName(new_name, true)
|
||||||
|
}
|
||||||
printJobTextfield.focus = false
|
printJobTextfield.focus = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user