mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Allow mouse selection in SpinBox
CURA-8684
This commit is contained in:
parent
1ecc1ad753
commit
14767a92c6
1 changed files with 14 additions and 0 deletions
|
@ -266,6 +266,13 @@ OldControls.TabView
|
|||
to: 100000000
|
||||
editable: true
|
||||
|
||||
contentItem: TextField
|
||||
{
|
||||
text: spoolCostSpinBox.textFromValue(spoolCostSpinBox.value, spoolCostSpinBox.locale)
|
||||
selectByMouse: true
|
||||
background: Item {}
|
||||
}
|
||||
|
||||
property int decimals: 2
|
||||
|
||||
valueFromText: function(text) {
|
||||
|
@ -296,6 +303,13 @@ OldControls.TabView
|
|||
to: 10000
|
||||
editable: true
|
||||
|
||||
contentItem: TextField
|
||||
{
|
||||
text: spoolWeightSpinBox.textFromValue(spoolWeightSpinBox.value, spoolWeightSpinBox.locale)
|
||||
selectByMouse: true
|
||||
background: Item {}
|
||||
}
|
||||
|
||||
valueFromText: function(text, locale) {
|
||||
// remove all non-number tokens from input string so value can be parsed correctly
|
||||
var value = Number(text.replace(",", ".").replace(/[^0-9.-]+/g, ""));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue