Replace textField in JobSpecs

CURA-8685
This commit is contained in:
Jaime van Kessel 2022-02-15 15:32:29 +01:00
parent 77b46868a6
commit b45b3faa3c
2 changed files with 12 additions and 20 deletions

View file

@ -18,6 +18,8 @@ UM.Dialog
width: minimumWidth width: minimumWidth
height: minimumHeight height: minimumHeight
GridLayout GridLayout
{ {
UM.I18nCatalog { id: catalog; name: "cura" } UM.I18nCatalog { id: catalog; name: "cura" }

View file

@ -1,9 +1,8 @@
// Copyright (c) 2021 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import UM 1.5 as UM import UM 1.5 as UM
@ -29,7 +28,8 @@ Item
{ {
if (!activity) if (!activity)
{ {
//When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't set an empty string as a jobName (which is later used for saving the file) // When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't
// set an empty string as a jobName (which is later used for saving the file)
PrintInformation.baseName = "" PrintInformation.baseName = ""
} }
} }
@ -66,7 +66,7 @@ Item
height: UM.Theme.getSize("jobspecs_line").height height: UM.Theme.getSize("jobspecs_line").height
width: Math.max(__contentWidth + UM.Theme.getSize("default_margin").width, 50) width: Math.max(__contentWidth + UM.Theme.getSize("default_margin").width, 50)
maximumLength: 120 maximumLength: 120
text: (PrintInformation === null) ? "" : PrintInformation.jobName text: PrintInformation === null ? "" : PrintInformation.jobName
horizontalAlignment: TextInput.AlignLeft horizontalAlignment: TextInput.AlignLeft
property string textBeforeEdit: "" property string textBeforeEdit: ""
@ -91,17 +91,10 @@ Item
validator: RegExpValidator { validator: RegExpValidator {
regExp: /^[^\\\/\*\?\|\[\]]*$/ regExp: /^[^\\\/\*\?\|\[\]]*$/
} }
font: UM.Theme.getFont("default")
style: TextFieldStyle color: UM.Theme.getColor("text_scene")
{ background: Item {}
textColor: UM.Theme.getColor("text_scene") selectByMouse: true
font: UM.Theme.getFont("default")
background: Rectangle
{
opacity: 0
border.width: 0
}
}
} }
} }
@ -125,10 +118,7 @@ Item
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
} }
Component.onCompleted: Component.onCompleted: base.addAdditionalComponents("jobSpecsButton")
{
base.addAdditionalComponents("jobSpecsButton")
}
Connections Connections
{ {