diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-02-27 11:28:18 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-02-27 13:30:25 +0200 |
commit | 26a16b56b39f3904c382c392d7ed958fab73108b (patch) | |
tree | 09778baf8c65d62ee1c1e309e909ef265e286d2d /src/Authoring/Studio/Palettes/controls | |
parent | 7730cb4a0e14d4bee8ceb54d3ea019464175b613 (diff) | |
parent | 677d3ca825287b18c7133b94ec4d45d393db3390 (diff) |
Merge branch 'master' into wip/timeline
Change-Id: If6e06be72a24372eef95339f55ffda24888eebc3
Diffstat (limited to 'src/Authoring/Studio/Palettes/controls')
-rw-r--r-- | src/Authoring/Studio/Palettes/controls/FloatTextField.qml | 19 | ||||
-rw-r--r-- | src/Authoring/Studio/Palettes/controls/StyledComboBox.qml | 5 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/Authoring/Studio/Palettes/controls/FloatTextField.qml b/src/Authoring/Studio/Palettes/controls/FloatTextField.qml index 25680090..db0b3347 100644 --- a/src/Authoring/Studio/Palettes/controls/FloatTextField.qml +++ b/src/Authoring/Studio/Palettes/controls/FloatTextField.qml @@ -158,9 +158,13 @@ TextField { if (draggingActive) { var delta = _mouseHelper.delta().x; if (delta !== 0) { - floatTextFieldId.text = - Number(parseFloat(floatTextFieldId.text) - + delta).toFixed(validator.decimals); + if (floatTextFieldId.text !== "") { + floatTextFieldId.text = Number(parseFloat(floatTextFieldId.text) + + delta).toFixed(validator.decimals); + } else { + floatTextFieldId.text = Number(delta).toFixed(validator.decimals); + } + if (!rateLimiter.running) rateLimiter.start(); } @@ -179,8 +183,13 @@ TextField { delta = 10.0; if (event.key === Qt.Key_Down) delta = -delta; - floatTextFieldId.text = Number(parseFloat(floatTextFieldId.text) - + delta).toFixed(validator.decimals); + if (floatTextFieldId.text !== "") { + floatTextFieldId.text = Number(parseFloat(floatTextFieldId.text) + + delta).toFixed(validator.decimals); + } else { + floatTextFieldId.text = Number(delta).toFixed(validator.decimals); + } + if (!rateLimiter.running) rateLimiter.start(); } diff --git a/src/Authoring/Studio/Palettes/controls/StyledComboBox.qml b/src/Authoring/Studio/Palettes/controls/StyledComboBox.qml index 81760abd..f9afde69 100644 --- a/src/Authoring/Studio/Palettes/controls/StyledComboBox.qml +++ b/src/Authoring/Studio/Palettes/controls/StyledComboBox.qml @@ -40,6 +40,9 @@ ComboBox { Layout.preferredWidth: _valueWidth topPadding: 0 bottomPadding: 0 + // hack to fix the color after Qt.Quick.Controls2 "optimization" + property alias color: backgroundBox.color + delegate: ItemDelegate { id: itemDelegate @@ -87,6 +90,7 @@ ComboBox { x: control.width - width - 2 y: control.topPadding + (control.availableHeight - height) / 2 source: _resDir + "arrow_down.png" + rotation: control.popup.visible ? 180 : 0 } contentItem: StyledTextField { @@ -107,6 +111,7 @@ ComboBox { } background: Rectangle { + id: backgroundBox color: control.enabled ? _studioColor2 : "transparent" border.width: 0 } |