From 8db06b8305984c614e8a54b9f2e7fe5f49b89dc4 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Fri, 5 Jun 2015 18:55:10 +0200 Subject: [PATCH] Add a text field style that can be used for generic text fields Based on the setting text field style. Contributes to Asana issue 33752130551782 --- resources/themes/cura/styles.qml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index dc2b80d2ad..b7db374da1 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -246,4 +246,32 @@ QtObject { } } } + + property Component text_field: Component { + TextFieldStyle { + textColor: UM.Theme.colors.setting_control_text; + font: UM.Theme.fonts.default; + + background: Rectangle + { + implicitHeight: control.height; + implicitWidth: control.width; + + border.width: 1; + border.color: UM.Theme.colors.setting_control_border; + + color: UM.Theme.colors.setting_validation_ok; + + Label { + anchors.right: parent.right; + anchors.rightMargin: UM.Theme.sizes.setting_unit_margin.width; + anchors.verticalCenter: parent.verticalCenter; + + text: control.unit ? control.unit : "" + color: UM.Theme.colors.setting_unit; + font: UM.Theme.fonts.default; + } + } + } + } }