From 7ebc5eaac4a170bdc38eb49a3a29b3ae6bc271eb Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 09:30:02 +0100 Subject: [PATCH] Use `Cura.TextField` in the spinbox component CURA-8688 --- resources/qml/SpinBox.qml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/resources/qml/SpinBox.qml b/resources/qml/SpinBox.qml index b5e93804b1..3c5a4d95e2 100644 --- a/resources/qml/SpinBox.qml +++ b/resources/qml/SpinBox.qml @@ -5,6 +5,7 @@ import QtQuick 2.2 import QtQuick.Controls 2.15 import UM 1.5 as UM +import Cura 1.5 as Cura // This component extends the funtionality of QtControls 2.x Spinboxes to // - be able to contain fractional values @@ -73,19 +74,14 @@ Item background: Item {} - //TextField should be swapped with UM.TextField when it is restyled - contentItem: TextField + contentItem: Cura.TextField { text: spinBox.textFromValue(spinBox.value, spinBox.locale) - color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled") - background: UM.UnderlineBackground {} - - selectByMouse: base.editable validator: base.validator onActiveFocusChanged: { - if(!activeFocus) + if (!activeFocus) { base.editingFinished(); }