Make texts fields selectable by mouse for various components

This enables mouse-selectable for
- The image reader dialog
- Layer view text field (in simulation view)
- The TextField with unit component (for instace used to set the scale
 of models)
- Rename dialog(s)
- Currency text field
- The settings filter text field

CURA-8684
This commit is contained in:
casper 2022-01-31 10:28:00 +01:00
parent 5aa67770a2
commit 264ce3bdd1
4 changed files with 10 additions and 1 deletions

View file

@ -42,6 +42,7 @@ UM.Dialog
TextField { TextField {
id: peak_height id: peak_height
selectByMouse: true
objectName: "Peak_Height" objectName: "Peak_Height"
validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/} validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/}
width: 180 * screenScaleFactor width: 180 * screenScaleFactor
@ -65,6 +66,7 @@ UM.Dialog
TextField { TextField {
id: base_height id: base_height
selectByMouse: true
objectName: "Base_Height" objectName: "Base_Height"
validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/} validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/}
width: 180 * screenScaleFactor width: 180 * screenScaleFactor
@ -88,6 +90,7 @@ UM.Dialog
TextField { TextField {
id: width id: width
selectByMouse: true
objectName: "Width" objectName: "Width"
focus: true focus: true
validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/}
@ -111,6 +114,7 @@ UM.Dialog
} }
TextField { TextField {
id: depth id: depth
selectByMouse: true
objectName: "Depth" objectName: "Depth"
focus: true focus: true
validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/}
@ -180,6 +184,7 @@ UM.Dialog
} }
TextField { TextField {
id: transmittance id: transmittance
selectByMouse: true
objectName: "Transmittance" objectName: "Transmittance"
focus: true focus: true
validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/}

View file

@ -46,6 +46,7 @@ UM.Dialog
TextField TextField
{ {
id: filterInput id: filterInput
selectByMouse: true
anchors anchors
{ {

View file

@ -1,5 +1,6 @@
// 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.5 import QtQuick 2.5
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
@ -62,6 +63,7 @@ UM.PointingRectangle
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
renderType: Text.NativeRendering renderType: Text.NativeRendering
background: Item {} background: Item {}
selectByMouse: true
onEditingFinished: { onEditingFinished: {

View file

@ -216,6 +216,7 @@ UM.PreferencesPage
TextField TextField
{ {
id: currencyField id: currencyField
selectByMouse: true
text: UM.Preferences.getValue("cura/currency") text: UM.Preferences.getValue("cura/currency")
onTextChanged: UM.Preferences.setValue("cura/currency", text) onTextChanged: UM.Preferences.setValue("cura/currency", text)
} }