diff options
author | Jens Bache-Wiig <jens.bache-wiig@digia.com> | 2013-02-10 16:10:43 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-19 19:08:00 +0100 |
commit | f7f28017634f21beb1b4120c74832ddddb9f4518 (patch) | |
tree | 8320d14f44a5b71dde8d045d3131943bdac82d66 /src/styles/Desktop/TextFieldStyle.qml | |
parent | 1c911f64771541dd5039d636637b0f17346a17a1 (diff) | |
download | qtquickcontrols-f7f28017634f21beb1b4120c74832ddddb9f4518.tar.gz |
Style cleanups
Introducing new Control and Style items to share
some code and making sure no styles are Items.
Change-Id: Iced031dc03803c381a39d6b4d1987ba4890ec2ef
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src/styles/Desktop/TextFieldStyle.qml')
-rw-r--r-- | src/styles/Desktop/TextFieldStyle.qml | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/src/styles/Desktop/TextFieldStyle.qml b/src/styles/Desktop/TextFieldStyle.qml index 31fc79ea..529f09bf 100644 --- a/src/styles/Desktop/TextFieldStyle.qml +++ b/src/styles/Desktop/TextFieldStyle.qml @@ -38,43 +38,46 @@ ** ****************************************************************************/ import QtQuick 2.0 -import QtDesktop 1.0 +import QtDesktop.Styles 1.0 import QtDesktop.Private 1.0 -StyleItem { - id: textfieldstyle - anchors.fill: parent - elementType: "edit" - sunken: true - hasFocus: textfield.activeFocus - hover: __containsMouse +Style { + property Component panel: StyleItem { + id: textfieldstyle + elementType: "edit" + anchors.fill: parent - SystemPalette { - id: syspal - colorGroup: control.enabled ? - SystemPalette.Active : - SystemPalette.Disabled - } + sunken: true + hasFocus: control.activeFocus + hover: __containsMouse + hints: control.styleHints - contentWidth: 200 - contentHeight: 18 + SystemPalette { + id: syspal + colorGroup: control.enabled ? + SystemPalette.Active : + SystemPalette.Disabled + } - property bool rounded: hints.indexOf("rounded") > -1 - property int topMargin: 1 - property int leftMargin: rounded ? 8 : 4 - property int rightMargin: 4 - property int bottomMargin: 1 + property color foregroundColor: syspal.text + property color backgroundColor: syspal.base + property color placeholderTextColor: "darkGray" + property color selectionColor: syspal.highlight + property color selectedTextColor: syspal.highlightedText - property color foregroundColor: syspal.text - property color backgroundColor: syspal.base - property color placeholderTextColor: "darkGray" - property color selectionColor: syspal.highlight - property color selectedTextColor: syspal.highlightedText - hints: control.styleHints + property bool rounded: hints.indexOf("rounded") > -1 + property int topMargin: 1 + property int leftMargin: rounded ? 8 : 4 + property int rightMargin: 4 + property int bottomMargin: 1 - FocusFrame { - anchors.fill: parent - visible: textfield.activeFocus && textfieldstyle.styleHint("focuswidget") + contentWidth: 100 + contentHeight: 18 + + FocusFrame { + anchors.fill: parent + visible: textfield.activeFocus && textfieldstyle.styleHint("focuswidget") + } } } |