mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 03:05:55 +08:00
Make jobname less sensitive to being touched
This commit is contained in:
parent
2beeca0687
commit
528814c9e6
@ -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:
|
||||||
{
|
{
|
||||||
var new_name = text == "" ? catalog.i18nc("@text Print job name", "Untitled") : text
|
if (text != textBeforeEdit) {
|
||||||
PrintInformation.setJobName(new_name, true)
|
var new_name = text == "" ? catalog.i18nc("@text Print job name", "Untitled") : text
|
||||||
|
PrintInformation.setJobName(new_name, true)
|
||||||
|
}
|
||||||
printJobTextfield.focus = false
|
printJobTextfield.focus = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user