diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index b8a73c31cf..dbcda42b5e 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -69,38 +69,84 @@ Rectangle { } } - - TextField { - id: printJobTextfield + Rectangle + { + id: jobNameRow + anchors.top: parent.top anchors.right: parent.right height: UM.Theme.sizes.jobspecs_line.height - width: base.width - property int unremovableSpacing: 5 - text: '' - horizontalAlignment: TextInput.AlignRight - onTextChanged: Printer.setJobName(text) visible: base.activity - onEditingFinished: { - if (printJobTextfield.text != ''){ - printJobTextfield.focus = false + + Item + { + width: parent.width + height: parent.height + + Button + { + id: printJobPencilIcon + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + width: UM.Theme.sizes.save_button_specs_icons.width + height: UM.Theme.sizes.save_button_specs_icons.height + + onClicked: + { + printJobTextfield.selectAll() + printJobTextfield.focus = true + } + style: ButtonStyle + { + background: Rectangle + { + color: "transparent" + UM.RecolorImage + { + width: UM.Theme.sizes.save_button_specs_icons.width + height: UM.Theme.sizes.save_button_specs_icons.height + sourceSize.width: width + sourceSize.height: width + color: UM.Theme.colors.setting_control_text + source: UM.Theme.icons.pencil; + } + } + } } - } - validator: RegExpValidator { - regExp: /^[^\\ \/ \.]*$/ - } - style: TextFieldStyle{ - textColor: UM.Theme.colors.setting_control_text; - font: UM.Theme.fonts.default; - background: Rectangle { - opacity: 0 - border.width: 0 + + TextField + { + id: printJobTextfield + anchors.right: printJobPencilIcon.left + anchors.rightMargin: UM.Theme.sizes.default_margin.width/2 + height: UM.Theme.sizes.jobspecs_line.height + width: base.width + property int unremovableSpacing: 5 + text: '' + horizontalAlignment: TextInput.AlignRight + onTextChanged: Printer.setJobName(text) + onEditingFinished: { + if (printJobTextfield.text != ''){ + printJobTextfield.focus = false + } + } + validator: RegExpValidator { + regExp: /^[^\\ \/ \.]*$/ + } + style: TextFieldStyle{ + textColor: UM.Theme.colors.setting_control_text; + font: UM.Theme.fonts.default_bold; + background: Rectangle { + opacity: 0 + border.width: 0 + } + } } } } Label{ id: boundingSpec - anchors.top: printJobTextfield.bottom + anchors.top: jobNameRow.bottom anchors.right: parent.right height: UM.Theme.sizes.jobspecs_line.height verticalAlignment: Text.AlignVCenter diff --git a/resources/themes/cura/icons/pencil.svg b/resources/themes/cura/icons/pencil.svg new file mode 100644 index 0000000000..cdeb265ad7 --- /dev/null +++ b/resources/themes/cura/icons/pencil.svg @@ -0,0 +1,16 @@ + + + + + + image/svg+xml + + + + + + + + + + \ No newline at end of file diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index 1f99c51270..861b0c50d1 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -9,6 +9,11 @@ "size": 1.15, "family": "Proxima Nova Rg" }, + "default_bold": { + "size": 1.15, + "bold": true, + "family": "Proxima Nova Rg" + }, "small": { "size": 1.0, "family": "Proxima Nova Rg"