diff options
author | Jens Bache-Wiig <jens.bache-wiig@digia.com> | 2013-05-02 18:18:08 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-08 21:42:37 +0200 |
commit | 2416927b67dcb4021edd38231295c13fe1b5a580 (patch) | |
tree | f7d31bc4c1640d867ef59c4109766c3cc0a336a6 /src/styles | |
parent | 2ae89b14d8dcc7176af3d475b38d3c023a1897a2 (diff) | |
download | qtquickcontrols-2416927b67dcb4021edd38231295c13fe1b5a580.tar.gz |
Refactor and clean up public style API
Change-Id: I10271c860abd9b45a262e3548628e6a3026e1a4f
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/styles')
29 files changed, 881 insertions, 708 deletions
diff --git a/src/styles/ButtonStyle.qml b/src/styles/ButtonStyle.qml index e7455029..91796292 100644 --- a/src/styles/ButtonStyle.qml +++ b/src/styles/ButtonStyle.qml @@ -43,32 +43,45 @@ import QtQuick.Controls.Private 1.0 /*! \qmltype ButtonStyle - \internal \inqmlmodule QtQuick.Controls.Styles 1.0 - \brief provides custom styling for Button + \since QtQuick.Controls.Styles 1.0 + \brief Provides custom styling for Button + + You can create a custom button by replacing the "background" delegate + of the ButtonStyle with a custom design. + + Example: + \qml + Button { + text: "A button" + style: ButtonStyle { + background: Rectangle { + implicitWidth: 100 + implicitHeight: 25 + border.width: control.activeFocus ? 2 : 1 + border.color: "#888" + radius: 4 + gradient: Gradient { + GradientStop { position: 0 ; color: control.pressed ? "#ccc" : "#eee" } + GradientStop { position: 1 ; color: control.pressed ? "#aaa" : "#ccc" } + } + } + } + } + \endqml + If you need a custom label, you can replace the label item. */ Style { id: buttonstyle - property font font - property color backgroundColor: "lightGray" - property color foregroundColor: __syspal.text - property var __syspal: SystemPalette { - colorGroup: control.enabled ? SystemPalette.Active : SystemPalette.Disabled - } + /*! The \l Button attached to this style. */ + readonly property Button control: __control - property Component label: Item { - Text { - id: textitem - anchors.centerIn: parent - renderType: Text.NativeRendering - text: control.text - color: buttonstyle.foregroundColor - font: buttonstyle.font - } - } + /*! The padding between the background and the label components. */ + property Margins padding: Margins { top: 4 ; left: 4 ; right: 4 ; bottom: 4 } + /*! The background of the button. */ property Component background: Item { implicitWidth: 100 implicitHeight: 25 @@ -94,29 +107,47 @@ Style { border.bottom: 4 } } + Image { + id: imageItem + visible: control.menu !== null + source: "images/arrow-down.png" + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: 8 + opacity: control.enabled ? 0.7 : 0.5 + } + } + + /*! The label of the button. */ + property Component label: Text { + renderType: Text.NativeRendering + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + text: control.text + color: __syspal.text } + /*! \internal */ property Component panel: Item { - property Item controlref: control + anchors.centerIn: parent anchors.fill: parent - - implicitWidth: backgroundLoader.implicitWidth - implicitHeight: backgroundLoader.implicitHeight + implicitWidth: Math.max(labelLoader.implicitWidth + padding.left + padding.right, backgroundLoader.implicitWidth) + implicitHeight: Math.max(labelLoader.implicitHeight + padding.top + padding.bottom, backgroundLoader.implicitHeight) Loader { id: backgroundLoader anchors.fill: parent sourceComponent: background - property Item control: controlref - property Item label: labelLoader.item } Loader { id: labelLoader sourceComponent: label anchors.fill: parent - property Item control: controlref + anchors.leftMargin: padding.left + anchors.topMargin: padding.top + anchors.rightMargin: padding.right + anchors.bottomMargin: padding.bottom } } } - diff --git a/src/styles/CheckBoxStyle.qml b/src/styles/CheckBoxStyle.qml index ecd3e433..ccf40f0d 100644 --- a/src/styles/CheckBoxStyle.qml +++ b/src/styles/CheckBoxStyle.qml @@ -43,20 +43,57 @@ import QtQuick.Controls.Private 1.0 /*! \qmltype CheckBoxStyle - \internal \inqmlmodule QtQuick.Controls.Styles 1.0 - \brief provides custom styling for CheckBox + \since QtQuick.Controls.Styles 1.0 + \brief Provides custom styling for CheckBox + + Example: + \qml + CheckBox { + text: "Check Box" + style: CheckBoxStyle{ + indicator: Rectangle { + implicitWidth: 16 + implicitHeight: 16 + radius: 3 + border.color: control.activeFocus ? "darkblue" : "gray" + border.width: 1 + Rectangle { + visible: control.checked + color: "#555" + border.color: "#333" + radius: 1 + anchors.margins: 4 + anchors.fill: parent + } + } + } + } + } + \endqml */ Style { + id: checkboxStyle - property int labelSpacing: 6 - property color textColor: __syspal.text + /*! The \l CheckBox attached to this style. */ + readonly property CheckBox control: __control - property SystemPalette __syspal: SystemPalette { - colorGroup: control.enabled ? SystemPalette.Active : SystemPalette.Disabled + /*! The text label. */ + property Component label: Text { + text: control.text + color: __syspal.text + renderType: Text.NativeRendering + verticalAlignment: Text.AlignVCenter } - property Component indicator: Item { + /*! The content padding. */ + property Margins padding: Margins { top: 0 ; left: 0 ; right: 4 ; bottom: 0 } + + /*! The spacing between indicator and label. */ + property int spacing: 4 + + /*! The indicator button. */ + property Component indicator: Item { implicitWidth: 18 implicitHeight: 18 BorderImage { @@ -79,6 +116,7 @@ Style { anchors.topMargin: 3 anchors.bottomMargin: 5 border.color: "#222" + opacity: control.enabled ? 1 : 0.5 Rectangle { anchors.fill: parent anchors.margins: 1 @@ -101,31 +139,26 @@ Style { } } - property Component label: Text { - text: control.text - color: textColor - renderType: Text.NativeRendering - } - + /*! \internal */ property Component panel: Item { - implicitWidth: Math.round(row.width + 4) - implicitHeight: row.height - property var _cref: control + implicitWidth: Math.round(row.width + padding.left + padding.right) + implicitHeight: Math.max(indicatorLoader.implicitHeight, labelLoader.implicitHeight) + padding.top + padding.bottom Row { id: row - spacing: labelSpacing + y: padding.top + x: padding.left + spacing: checkboxStyle.spacing Loader { id: indicatorLoader sourceComponent: indicator anchors.verticalCenter: parent.verticalCenter - property CheckBox control: _cref } Loader { id: labelLoader sourceComponent: label - anchors.verticalCenter: parent.verticalCenter - property CheckBox control: _cref + anchors.top: parent.top + anchors.bottom: parent.bottom } } } diff --git a/src/styles/ComboBoxStyle.qml b/src/styles/ComboBoxStyle.qml index 1227c194..7b55a928 100644 --- a/src/styles/ComboBoxStyle.qml +++ b/src/styles/ComboBoxStyle.qml @@ -38,31 +38,32 @@ ** ****************************************************************************/ import QtQuick 2.1 +import QtQuick.Controls 1.0 import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Private 1.0 /*! \qmltype ComboBoxStyle - \internal \inqmlmodule QtQuick.Controls.Styles 1.0 + \since QtQuick.Controls.Styles 1.0 + \brief Provides custom styling for ComboBox */ Style { - property color foregroundColor: __syspal.text - property var __syspal: SystemPalette { - colorGroup: control.enabled ? SystemPalette.Active : SystemPalette.Disabled - } + /*! The \l ComboBox attached to this style. */ + readonly property ComboBox control: __control - property Component panel: Item { - implicitWidth: 100 - implicitHeight: 24 - property bool popup: false - property alias font: textitem.font + /*! The padding between the background and the label components. */ + property Margins padding: Margins { top: 4 ; left: 6 ; right: 6 ; bottom:4 } + /*! The background of the button. */ + property Component background: Item { + implicitWidth: 100 + implicitHeight: 25 BorderImage { anchors.fill: parent - source: control.__pressed ? "images/button_down.png" : "images/button.png" + source: control.pressed ? "images/button_down.png" : "images/button.png" border.top: 6 border.bottom: 6 border.left: 6 @@ -81,28 +82,61 @@ Style { border.top: 4 border.bottom: 4 } - Text { - id: textitem - anchors.centerIn: parent - text: control.currentText - color: foregroundColor - renderType: Text.NativeRendering - } Image { + id: imageItem source: "images/arrow-down.png" anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right anchors.rightMargin: 8 - opacity: 0.7 + opacity: control.enabled ? 0.7 : 0.5 } } } - property Component dropDownStyle: MenuStyle { + /*! The label of the button. */ + property Component label: Item { + implicitWidth: textitem.implicitWidth + 20 + Text { + id: textitem + anchors.centerIn: parent + text: control.currentText + renderType: Text.NativeRendering + color: __syspal.text + } + } + + /*! \internal */ + property Component panel: Item { + property bool popup: false + anchors.centerIn: parent + anchors.fill: parent + implicitWidth: Math.max(labelLoader.implicitWidth + padding.left + padding.right, backgroundLoader.implicitWidth) + implicitHeight: Math.max(labelLoader.implicitHeight + padding.top + padding.bottom, backgroundLoader.implicitHeight) + + Loader { + id: backgroundLoader + anchors.fill: parent + sourceComponent: background + } + + Loader { + id: labelLoader + sourceComponent: label + anchors.fill: parent + anchors.leftMargin: padding.left + anchors.topMargin: padding.top + anchors.rightMargin: padding.right + anchors.bottomMargin: padding.bottom + } + } + + /*! \internal */ + property Component __dropDownStyle: MenuStyle { __menuItemType: "comboboxitem" } - property Component popupStyle: Style { + /*! \internal */ + property Component __popupStyle: Style { property Component frame: Rectangle { width: (parent ? parent.contentWidth : 0) @@ -111,9 +145,15 @@ Style { } property Component menuItem: Rectangle { + property string textRef: text implicitWidth: textItem.contentWidth implicitHeight: textItem.contentHeight border.color: "#777" + Text { + id: textItem + visible: false + text: textRef + } } } } diff --git a/src/styles/Desktop/CheckBoxStyle.qml b/src/styles/Desktop/CheckBoxStyle.qml index e979d94a..15b20d2d 100644 --- a/src/styles/Desktop/CheckBoxStyle.qml +++ b/src/styles/Desktop/CheckBoxStyle.qml @@ -81,11 +81,7 @@ Style { renderType: Text.NativeRendering elide: Text.ElideRight enabled: control.enabled - color: syspal.windowText - SystemPalette { - id: syspal - colorGroup: enabled ? SystemPalette.Active : SystemPalette.Disabled - } + color: __syspal.windowText } } } diff --git a/src/styles/Desktop/ComboBoxStyle.qml b/src/styles/Desktop/ComboBoxStyle.qml index 852ef741..a27bb4d4 100644 --- a/src/styles/Desktop/ComboBoxStyle.qml +++ b/src/styles/Desktop/ComboBoxStyle.qml @@ -38,12 +38,14 @@ ** ****************************************************************************/ import QtQuick 2.1 +import QtQuick.Controls 1.0 import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Private 1.0 Style { + readonly property ComboBox control: __control property Component panel: Item { - property int popup: styleItem.styleHint("comboboxpopup") + property bool popup: !!styleItem.styleHint("comboboxpopup") implicitWidth: 115 implicitHeight: styleItem.implicitHeight @@ -55,7 +57,7 @@ Style { height: parent.height width: parent.width elementType: "combobox" - sunken: control.__pressed + sunken: control.pressed raised: !sunken hover: control.__containsMouse enabled: control.enabled @@ -74,11 +76,11 @@ Style { } } - property Component popupStyle: MenuStyle { + property Component __popupStyle: MenuStyle { __menuItemType: "comboboxitem" } - property Component dropDownStyle: Style { + property Component __dropDownStyle: Style { property Component frame: StyleItem { elementType: "frame" diff --git a/src/styles/Desktop/GroupBoxStyle.qml b/src/styles/Desktop/GroupBoxStyle.qml index 6d675c9e..40c5ce58 100644 --- a/src/styles/Desktop/GroupBoxStyle.qml +++ b/src/styles/Desktop/GroupBoxStyle.qml @@ -44,7 +44,7 @@ import QtQuick.Controls.Private 1.0 Style { property int margin: 8 - + readonly property GroupBox control: __control property Component panel: StyleItem { id: styleitem elementType: "groupbox" diff --git a/src/styles/Desktop/MenuStyle.qml b/src/styles/Desktop/MenuStyle.qml index bd85a1c1..960a163d 100644 --- a/src/styles/Desktop/MenuStyle.qml +++ b/src/styles/Desktop/MenuStyle.qml @@ -57,15 +57,13 @@ Style { property int subMenuOverlap: pixelMetric("submenuoverlap") - SystemPalette { id: syspal } - Rectangle { visible: anchors.margins > 0 anchors { fill: parent margins: pixelMetric("menupanelwidth") } - color: syspal.window + color: __syspal.window } } diff --git a/src/styles/Desktop/ProgressBarStyle.qml b/src/styles/Desktop/ProgressBarStyle.qml index a7ac50dc..b61dadd1 100644 --- a/src/styles/Desktop/ProgressBarStyle.qml +++ b/src/styles/Desktop/ProgressBarStyle.qml @@ -52,9 +52,9 @@ Style { minimum: indeterminate ? 0 : control.minimumValue.toFixed(decimals) * factor maximum: indeterminate ? 0 : control.maximumValue.toFixed(decimals) * factor enabled: control.enabled - horizontal: control.orientation == Qt.Horizontal + horizontal: control.orientation === Qt.Horizontal hints: control.styleHints - contentWidth: 23 - contentHeight: 23 + contentWidth: horizontal ? 200 : 23 + contentHeight: horizontal ? 23 : 200 } } diff --git a/src/styles/Desktop/RadioButtonStyle.qml b/src/styles/Desktop/RadioButtonStyle.qml index 8281df6d..be74ae55 100644 --- a/src/styles/Desktop/RadioButtonStyle.qml +++ b/src/styles/Desktop/RadioButtonStyle.qml @@ -38,9 +38,11 @@ ** ****************************************************************************/ import QtQuick 2.1 +import QtQuick.Controls 1.0 import QtQuick.Controls.Private 1.0 Style { + readonly property RadioButton control: __control property Component panel: Item { anchors.fill: parent @@ -74,11 +76,7 @@ Style { renderType: Text.NativeRendering elide: Text.ElideRight enabled: control.enabled - color: syspal.windowText - SystemPalette { - id: syspal - colorGroup: enabled ? SystemPalette.Active : SystemPalette.Disabled - } + color: __syspal.windowText } } } diff --git a/src/styles/Desktop/ScrollBarStyle.qml b/src/styles/Desktop/ScrollBarStyle.qml deleted file mode 100644 index 182dfabd..00000000 --- a/src/styles/Desktop/ScrollBarStyle.qml +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Quick Controls module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.1 -import QtQuick.Controls 1.0 -import QtQuick.Controls.Private 1.0 -import QtQuick.Controls.Styles 1.0 - -Style { - id: scrollbarStyle - readonly property bool horizontal: control.orientation === Qt.Horizontal - property bool scrollToClickPosition: control.__panel.scrollToClickPosition - - property Component panel: StyleItem { - id: styleitem - anchors.fill:parent - elementType: "scrollbar" - hover: activeControl != "none" - activeControl: "none" - sunken: control.upPressed | control.downPressed | control.handlePressed - minimum: control.minimumValue - maximum: control.maximumValue - value: control.value - horizontal: scrollbarStyle.horizontal - enabled: control.enabled - - implicitWidth: horizontal ? 200 : pixelMetric("scrollbarExtent") - implicitHeight: horizontal ? pixelMetric("scrollbarExtent") : 200 - property int scrollToClickPosition: styleHint("scrollToClickPosition") - } -} - diff --git a/src/styles/Desktop/ScrollViewStyle.qml b/src/styles/Desktop/ScrollViewStyle.qml index d9768ac2..cc13cb42 100644 --- a/src/styles/Desktop/ScrollViewStyle.qml +++ b/src/styles/Desktop/ScrollViewStyle.qml @@ -45,14 +45,16 @@ import "." as Desktop Style { id: root - readonly property bool externalScrollBars: __styleitem.styleHint("externalScrollBars") - readonly property int scrollBarSpacing: __styleitem.pixelMetric("scrollbarspacing") - readonly property int frameWidth: __styleitem.pixelMetric("defaultframewidth") + property Margins padding: Margins { + property int frameWidth: __styleitem.pixelMetric("defaultframewidth") + left: frameWidth + top: frameWidth + bottom: frameWidth + right: frameWidth + } property StyleItem __styleitem: StyleItem { elementType: "frame" } - property Component scrollBar: Desktop.ScrollBarStyle {} - property Component frame: StyleItem { id: styleitem elementType: "frame" @@ -61,4 +63,26 @@ Style { } property Component corner: StyleItem { elementType: "scrollareacorner" } + + readonly property bool __externalScrollBars: __styleitem.styleHint("externalScrollBars") + readonly property int __scrollBarSpacing: __styleitem.pixelMetric("scrollbarspacing") + readonly property bool scrollToClickedPosition: __styleitem.styleHint("scrollToClickPosition") !== 0 + + property Component __scrollbar: StyleItem { + readonly property bool isTransient: __styleitem.styleHint("transientScrollBars") + anchors.fill:parent + elementType: "scrollbar" + hover: activeControl != "none" + activeControl: "none" + sunken: __control.upPressed | __control.downPressed | __control.handlePressed + minimum: __control.minimumValue + maximum: __control.maximumValue + value: __control.value + horizontal: __control.orientation === Qt.Horizontal + enabled: __control.enabled + + implicitWidth: horizontal ? 200 : pixelMetric("scrollbarExtent") + implicitHeight: horizontal ? pixelMetric("scrollbarExtent") : 200 + } + } diff --git a/src/styles/Desktop/SpinBoxStyle.qml b/src/styles/Desktop/SpinBoxStyle.qml index 54cd0fb5..02b2ecbe 100644 --- a/src/styles/Desktop/SpinBoxStyle.qml +++ b/src/styles/Desktop/SpinBoxStyle.qml @@ -42,28 +42,27 @@ import QtQuick.Controls 1.0 import QtQuick.Controls.Private 1.0 Style { + readonly property SpinBox control: __control property Component panel: Item { id: style property rect upRect property rect downRect - property int topMargin: edit.anchors.topMargin - property int leftMargin: 2 + edit.anchors.leftMargin - property int rightMargin: 2 + edit.anchors.rightMargin - property int bottomMargin: edit.anchors.bottomMargin + property Margins margins: Margins{ + top: edit.anchors.topMargin + left: 2 + edit.anchors.leftMargin + right: 2 + edit.anchors.leftMargin + bottom: edit.anchors.bottomMargin + } + property int horizontalTextAlignment: Qt.AlignLeft property int verticalTextAlignment: Qt.AlignVCenter - property color foregroundColor: syspal.text - property color backgroundColor: syspal.base - property color selectionColor: syspal.highlight - property color selectedTextColor: syspal.highlightedText - - SystemPalette { - id: syspal - colorGroup: control.enabled ? SystemPalette.Active : SystemPalette.Disabled - } + property color foregroundColor: __syspal.text + property color backgroundColor: __syspal.base + property color selectionColor: __syspal.highlight + property color selectedTextColor: __syspal.highlightedText width: 100 height: styleitem.implicitHeight @@ -104,17 +103,17 @@ Style { id: styleitem elementType: "spinbox" anchors.fill: parent - sunken: (control.__downEnabled && control.__downPressed) || (control.__upEnabled && control.__upPressed) - hover: __containsMouse + sunken: (controlState.downEnabled && controlState.downPressed) || (controlState.upEnabled && controlState.upPressed) + hover: controlState.containsMouse hints: control.styleHints hasFocus: control.activeFocus enabled: control.enabled - value: (control.__upPressed ? 1 : 0) | - (control.__downPressed ? 1<<1 : 0) | - (control.__upEnabled ? (1<<2) : 0) | - (control.__downEnabled ? (1<<3) : 0) - contentWidth: control.__contentWidth - contentHeight: control.__contentHeight + value: (controlState.upPressed ? 1 : 0) | + (controlState.downPressed ? 1<<1 : 0) | + (controlState.upEnabled ? (1<<2) : 0) | + (controlState.downEnabled ? (1<<3) : 0) + contentWidth: controlState.contentWidth + contentHeight: controlState.contentHeight } } } diff --git a/src/styles/Desktop/TabViewStyle.qml b/src/styles/Desktop/TabViewStyle.qml index b5fc2319..830732bb 100644 --- a/src/styles/Desktop/TabViewStyle.qml +++ b/src/styles/Desktop/TabViewStyle.qml @@ -44,38 +44,36 @@ import QtQuick.Controls.Styles 1.0 Style { id: root - property int leftMargin: 0 - property int rightMargin: 0 - property StyleItem __barstyle: StyleItem { elementType: "tabbar" ; visible: false } - property string tabBarAlignment: __barstyle.styleHint("tabbaralignment"); + property int tabsLeftPadding: 0 + property int tabsRightPadding: 0 + property int tabsAlignment: __barstyle.styleHint("tabbaralignment") === "center" ? Qt.AlignHCenter : Qt.AlignLeft; property int tabOverlap: __barstyle.pixelMetric("taboverlap"); - property int tabBaseOverlap: __barstyle.pixelMetric("tabbaseoverlap"); - property string tabPosition: control.tabPosition == Qt.TopEdge ? "Top" : "Bottom" + property int frameOverlap: __barstyle.pixelMetric("tabbaseoverlap"); + property StyleItem __barstyle: StyleItem { elementType: "tabbar" ; visible: false } property Component frame: StyleItem { id: styleitem anchors.fill: parent anchors.topMargin: 1//stack.baseOverlap z: style == "oxygen" ? 1 : 0 elementType: "tabframe" - hints: tabPosition + hints: control.tabPosition === Qt.TopEdge ? "Top" : "Bottom" value: tabbarItem && tabsVisible && tabbarItem.tab(currentIndex) ? tabbarItem.tab(currentIndex).x : 0 minimum: tabbarItem && tabsVisible && tabbarItem.tab(currentIndex) ? tabbarItem.tab(currentIndex).width : 0 maximum: tabbarItem && tabsVisible ? tabbarItem.width : width Component.onCompleted: { stack.frameWidth = styleitem.pixelMetric("defaultframewidth"); stack.style = style; - stack.baseOverlap = root.tabBaseOverlap; } } property Component tab: Item { id: item property string tabpos: control.count === 1 ? "only" : index === 0 ? "beginning" : index === control.count - 1 ? "end" : "middle" - property string selectedpos: nextSelected ? "next" : previousSelected ? "previous" : "" + property string selectedpos: tab.nextSelected ? "next" : tab.previousSelected ? "previous" : "" property int tabHSpace: __barstyle.pixelMetric("tabhspace"); property int tabVSpace: __barstyle.pixelMetric("tabvspace"); - implicitWidth: Math.max(50, styleitem.textWidth(title)) + tabHSpace + 2 + implicitWidth: Math.max(50, styleitem.textWidth(tab.title)) + tabHSpace + 2 implicitHeight: Math.max(styleitem.font.pixelSize + tabVSpace + 6, 0) StyleItem { @@ -93,8 +91,8 @@ Style { hints: [tabPosition, tabpos, selectedpos] selected: tab.selected - text: elidedText(title, tabbarItem.elide, item.width - item.tabHSpace) - hover: tab.hover + text: elidedText(tab.title, tabbarItem.elide, item.width - item.tabHSpace) + hover: tab.hovered hasFocus: tabbarItem.activeFocus && selected } } diff --git a/src/styles/Desktop/TableViewStyle.qml b/src/styles/Desktop/TableViewStyle.qml index 716afa61..6cb13749 100644 --- a/src/styles/Desktop/TableViewStyle.qml +++ b/src/styles/Desktop/TableViewStyle.qml @@ -75,7 +75,7 @@ ScrollViewStyle { active: hasActiveFocus } - property Component standardDelegate: Item { + property Component itemDelegate: Item { height: Math.max(16, label.implicitHeight) property int implicitWidth: sizehint.paintedWidth + 4 diff --git a/src/styles/Desktop/TextFieldStyle.qml b/src/styles/Desktop/TextFieldStyle.qml index 68fd5d2c..9bb83ccf 100644 --- a/src/styles/Desktop/TextFieldStyle.qml +++ b/src/styles/Desktop/TextFieldStyle.qml @@ -58,8 +58,7 @@ Style { SystemPalette.Disabled } - property color foregroundColor: syspal.text - property color backgroundColor: syspal.base + property color textColor: syspal.text property color placeholderTextColor: "darkGray" property color selectionColor: syspal.highlight property color selectedTextColor: syspal.highlightedText diff --git a/src/styles/GroupBoxStyle.qml b/src/styles/GroupBoxStyle.qml index 0020f4e3..83904209 100644 --- a/src/styles/GroupBoxStyle.qml +++ b/src/styles/GroupBoxStyle.qml @@ -45,15 +45,20 @@ import QtQuick.Controls.Private 1.0 \qmltype GroupBoxStyle \internal \inqmlmodule QtQuick.Controls.Styles 1.0 + \since QtQuick.Controls.Styles 1.0 */ Style { + + /*! The \l GroupBox attached to this style. */ + readonly property GroupBox control: __control + + /*! The margin. */ property int margin: 9 - property color textColor: __syspal.text - property SystemPalette __syspal: SystemPalette { - colorGroup: control.enabled ? SystemPalette.Active : SystemPalette.Disabled - } + /*! The title text color. */ + property color textColor: __syspal.text + /*! The groupbox frame. */ property Component panel: Item { implicitWidth: control.contentWidth + 2 * margin diff --git a/src/styles/ProgressBarStyle.qml b/src/styles/ProgressBarStyle.qml index 12e3db25..4d2fea73 100644 --- a/src/styles/ProgressBarStyle.qml +++ b/src/styles/ProgressBarStyle.qml @@ -44,61 +44,119 @@ import QtQuick.Controls.Private 1.0 /*! \qmltype ProgressBarStyle - \internal + \inqmlmodule QtQuick.Controls.Styles 1.0 - \brief provides custom styling for ProgressBar + \since QtQuick.Controls.Styles 1.0 + \brief Provides custom styling for ProgressBar + + Example: + \qml + ProgressBar { + value: slider.value + style: ProgressBarStyle { + background: Rectangle { + radius: 2 + color: "lightgray" + border.color: "gray" + border.width: 1 + implicitWidth: 200 + implicitHeight: 24 + } + progress: Rectangle { + color: "lightsteelblue" + border.color: "steelblue" + } + } + } + \endqml */ Style { - property color backgroundColor: "darkgrey" - property color progressColor: "#49d" + id: progressBarStyle + + /*! The \l ProgressBar attached to this style. */ + readonly property ProgressBar control: __control + + /*! A value in the range [0-1] indicating the current progress. */ + readonly property real currentProgress: control.indeterminate ? 1.0 : + control.value / control.maximumValue + + /*! This property holds the visible contents of the progress bar + You can access the Slider through the \c control property. + + For convenience, you can also access the readonly property \c controlState.progress + which provides the current progress as a \c real in the range [0-1] + */ + property Margins padding: Margins { top: 0 ; left: 0 ; right: 0 ; bottom: 0 } + + + property Component progress: Rectangle { + property color progressColor: "#49d" + anchors.fill: parent + radius: 2 + antialiasing: true + gradient: Gradient { + GradientStop {color: Qt.lighter(progressColor, 1.3) ; position: 0} + GradientStop {color: progressColor ; position: 1.4} + } + border.width: 1 + border.color: Qt.darker(progressColor, 1.2) + Rectangle { + color: "transparent" + radius: 1.5 + antialiasing: true + anchors.fill: parent + anchors.margins: 1 + border.color: Qt.rgba(1,1,1,0.3) + } + } property Component background: Item { implicitWidth: 200 implicitHeight: 24 BorderImage { anchors.fill: parent + anchors.bottomMargin: -2 + anchors.leftMargin: -1 + anchors.rightMargin: -1 source: "images/editbox.png" border.left: 4 border.right: 4 border.top: 4 border.bottom: 4 } - Rectangle { - id: progressItem - implicitWidth: control.indeterminate ? parent.width : parent.width * control.value / control.maximumValue - radius: 2 - antialiasing: true - height: parent.height - 2 - gradient: Gradient { - GradientStop {color: Qt.lighter(progressColor, 1.3) ; position: 0} - GradientStop {color: progressColor ; position: 1.4} - } - border.width: 1 - border.color: Qt.darker(progressColor, 1.2) - Rectangle { - color: "transparent" - radius: 1.5 - antialiasing: true - anchors.fill: parent - anchors.margins: 1 - border.color: Qt.rgba(1,1,1,0.3) - } - } } - property Component panel: Item { - property Item controlref: control - anchors.fill: parent + property Component panel: Item{ + property bool horizontal: control.orientation == Qt.Horizontal + implicitWidth: horizontal ? backgroundLoader.implicitWidth : backgroundLoader.implicitHeight + implicitHeight: horizontal ? backgroundLoader.implicitHeight : backgroundLoader.implicitWidth - implicitWidth: backgroundLoader.implicitWidth - implicitHeight: backgroundLoader.implicitHeight + Item { + width: horizontal ? parent.width : parent.height + height: !horizontal ? parent.width : parent.height + y: horizontal ? 0 : width + rotation: horizontal ? 0 : -90 + transformOrigin: Item.TopLeft - Loader { - id: backgroundLoader - anchors.fill: parent - sourceComponent: background - property Item control: controlref + Loader { + id: backgroundLoader + anchors.fill: parent + sourceComponent: background + } + + Loader { + sourceComponent: progressBarStyle.progress + anchors.topMargin: padding.top + anchors.leftMargin: padding.left + anchors.rightMargin: padding.right + anchors.bottomMargin: padding.bottom + + anchors.top: parent.top + anchors.left: parent.left + anchors.bottom: parent.bottom + width: currentProgress * (parent.width - padding.left - padding.right) + } } } } diff --git a/src/styles/RadioButtonStyle.qml b/src/styles/RadioButtonStyle.qml index cf7b7ff9..e1696ad2 100644 --- a/src/styles/RadioButtonStyle.qml +++ b/src/styles/RadioButtonStyle.qml @@ -43,20 +43,57 @@ import QtQuick.Controls.Private 1.0 /*! \qmltype RadioButtonStyle - \internal \inqmlmodule QtQuick.Controls.Styles 1.0 - \brief provides custom styling for RadioButton + \since QtQuick.Controls.Styles 1.0 + \brief Provides custom styling for RadioButton + + Example: + \qml + RadioButton { + text: "Radio Button" + style: RadioButtonStyle{ + indicator: Rectangle { + implicitWidth: 16 + implicitHeight: 16 + radius: 9 + border.color: control.activeFocus ? "darkblue" : "gray" + border.width: 1 + Rectangle { + anchors.fill: parent + visible: control.checked + color: "#555" + radius: 9 + anchors.margins: 4 + } + } + } + } + } + \endqml */ + Style { + id: radiobuttonStyle - property int labelSpacing: 6 - property color textColor: __syspal.text + /*! The \l RadioButton attached to this style. */ + readonly property RadioButton control: __control - property SystemPalette __syspal: SystemPalette { - colorGroup: control.enabled ? SystemPalette.Active : SystemPalette.Disabled + /*! The text label. */ + property Component label: Text { + text: control.text + renderType: Text.NativeRendering + verticalAlignment: Text.AlignVCenter + color: __syspal.text } - property Component indicator: Rectangle { + /*! The content padding. */ + property Margins padding: Margins { top: 0 ; left: 0 ; right: 4 ; bottom: 0 } + + /*! The spacing between indicator and label. */ + property int spacing: 4 + + /*! The indicator button. */ + property Component indicator: Rectangle { width: 17 height: 17 color: "white" @@ -73,33 +110,30 @@ Style { border.color: "#222" antialiasing: true radius: height/2 + opacity: control.enabled ? 1 : 0.5 } } - property Component label: Text { - text: control.text - color: textColor - renderType: Text.NativeRendering - } + /*! \internal */ property Component panel: Item { - implicitWidth: row.width - implicitHeight: row.height - property var _cref: control + implicitWidth: Math.round(row.width + padding.left + padding.right) + implicitHeight: Math.max(indicatorLoader.implicitHeight, labelLoader.implicitHeight) + padding.top + padding.bottom Row { id: row - spacing: labelSpacing + y: padding.top + x: padding.left + spacing: radiobuttonStyle.spacing Loader { id: indicatorLoader sourceComponent: indicator anchors.verticalCenter: parent.verticalCenter - property Item control: _cref } Loader { id: labelLoader sourceComponent: label - anchors.verticalCenter: parent.verticalCenter - property Item control: _cref + anchors.top: parent.top + anchors.bottom: parent.bottom } } } diff --git a/src/styles/ScrollBarStyle.qml b/src/styles/ScrollBarStyle.qml deleted file mode 100644 index 6912b63b..00000000 --- a/src/styles/ScrollBarStyle.qml +++ /dev/null @@ -1,273 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Quick Controls module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.1 -import QtQuick.Controls 1.0 -import QtQuick.Controls.Private 1.0 - -/*! - \qmltype ScrollBarStyle - \internal - \inqmlmodule QtQuick.Controls.Styles 1.0 - \brief provides custom styling for scroll bars - - The ScrollBar style can only be set as part of a - a \l ScrollViewStyle. -*/ -Style { - id: styleitem - - /*! This is the current orientation of the scroll bar. */ - readonly property bool horizontal: control.orientation === Qt.Horizontal - - /*! This property determines if the scrollBar should directly move to - the offset that is clicked by the user or if it should simply increment - or decrement it's position. - - The default value is \cfalse. - */ - property bool scrollToClickPosition: true - - /*! This is the minimum extent of the scroll bar handle. - - The default value is \c 30. - */ - property int minimumHandleLength: 30 - - /*! This property controls the edge overlap - between the handle and the increment/decrement buttons. - - The default value is \c 30. - */ - property int handleOverlap: 1 - - /*! This component controls the appearance of the - scroll bar background. - */ - property Component background: Item { - implicitWidth: 16 - implicitHeight: 16 - clip: true - Rectangle { - anchors.fill: parent - color: "#ddd" - border.color: "#aaa" - anchors.rightMargin: horizontal ? -2 : -1 - anchors.leftMargin: horizontal ? -2 : 0 - anchors.topMargin: horizontal ? 0 : -2 - anchors.bottomMargin: horizontal ? -1 : -2 - } - } - - /*! This component controls the appearance of the - scroll bar handle. - */ - property Component handle: Item { - implicitWidth: 16 - implicitHeight: 16 - Rectangle { - anchors.fill: parent - color: mouseOver ? "#ddd" : "lightgray" - border.color: "#aaa" - anchors.rightMargin: horizontal ? 0 : -1 - anchors.bottomMargin: horizontal ? -1 : 0 - Rectangle { - anchors.fill: parent - anchors.margins: 1 - color: "transparent" - border.color: "#44ffffff" - } - } - } - - /*! This component controls the appearance of the - scroll bar increment button. - */ - property Component incrementControl: Rectangle { - implicitWidth: 16 - implicitHeight: 16 - Rectangle { - anchors.fill: parent - anchors.bottomMargin: -1 - anchors.rightMargin: -1 - border.color: "#aaa" - Image { - source: horizontal ? "images/arrow-right.png" : "images/arrow-down.png" - anchors.centerIn: parent - opacity: 0.7 - } - gradient: Gradient { - GradientStop {color: control.downPressed ? "lightgray" : "white" ; position: 0} - GradientStop {color: control.downPressed ? "lightgray" : "lightgray" ; position: 1} - } - } - } - - /*! This component controls the appearance of the - scroll bar decrement button. - */ - property Component decrementControl: Rectangle { - implicitWidth: 16 - implicitHeight: 16 - Rectangle { - anchors.fill: parent - anchors.topMargin: horizontal ? 0 : -1 - anchors.leftMargin: horizontal ? -1 : 0 - anchors.bottomMargin: horizontal ? -1 : 0 - anchors.rightMargin: horizontal ? 0 : -1 - color: "lightgray" - Image { - source: horizontal ? "images/arrow-left.png" : "images/arrow-up.png" - anchors.centerIn: parent - anchors.verticalCenterOffset: horizontal ? 0 : -1 - anchors.horizontalCenterOffset: horizontal ? -1 : 0 - opacity: 0.7 - } - gradient: Gradient { - GradientStop {color: control.upPressed ? "lightgray" : "white" ; position: 0} - GradientStop {color: control.upPressed ? "lightgray" : "lightgray" ; position: 1} - } - border.color: "#aaa" - } - } - - /*! \internal */ - property Component panel: Item { - - property string activeControl: "" - - implicitWidth: horizontal ? 200 : bg.implicitWidth - implicitHeight: horizontal ? bg.implicitHeight : 200 - - function pixelMetric(arg) { - if (arg === "scrollbarExtent") - return (styleitem.horizontal ? bg.height : bg.width); - return 0; - } - - function styleHint(arg) { - return false; - } - - function hitTest(argX, argY) { - if (itemIsHit(handleControl, argX, argY)) - return "handle" - else if (itemIsHit(upControl, argX, argY)) - return "up"; - else if (itemIsHit(downControl, argX, argY)) - return "down"; - else if (itemIsHit(bg, argX, argY)) { - if (styleitem.horizontal && argX < handleControl.x || !styleitem.horizontal && argY < handleControl.y) - return "upPage" - else - return "downPage" - } - - return "none"; - } - - function subControlRect(arg) { - if (arg === "handle") { - return Qt.rect(handleControl.x, handleControl.y, handleControl.width, handleControl.height); - } else if (arg === "groove") { - if (styleitem.horizontal) { - return Qt.rect(upControl.width - styleitem.handleOverlap, - 0, - control.width - (upControl.width + downControl.width - styleitem.handleOverlap * 2), - control.height); - } else { - return Qt.rect(0, - upControl.height - styleitem.handleOverlap, - control.width, - control.height - (upControl.height + downControl.height - styleitem.handleOverlap * 2)); - } - } - return Qt.rect(0,0,0,0); - } - - function itemIsHit(argItem, argX, argY) { - var pos = argItem.mapFromItem(control, argX, argY); - return (pos.x >= 0 && pos.x <= argItem.width && pos.y >= 0 && pos.y <= argItem.height); - } - - Loader { - id: upControl - anchors.top: parent.top - anchors.left: parent.left - sourceComponent: decrementControl - property bool mouseOver: activeControl === "up" - property bool pressed: control.upPressed - } - - Loader { - id: bg - anchors.top: horizontal ? undefined : upControl.bottom - anchors.bottom: horizontal ? undefined : downControl.top - anchors.left: horizontal ? upControl.right : undefined - anchors.right: horizontal ? downControl.left : undefined - sourceComponent: background - } - - Loader { - id: downControl - anchors.bottom: horizontal ? undefined : parent.bottom - anchors.right: horizontal ? parent.right : undefined - sourceComponent: incrementControl - property bool mouseOver: activeControl === "down" - property bool pressed: control.downPressed - } - - Loader{ - id: handleControl - property bool mouseOver: activeControl === "handle" - property var flickableItem: control.parent.parent.flickableItem - property int extent: Math.max(minimumHandleLength, horizontal ? - (flickableItem.width/flickableItem.contentWidth) * bg.width : - (flickableItem.height/flickableItem.contentHeight) * bg.height) - height: horizontal ? implicitHeight : extent - width: horizontal ? extent : implicitWidth - anchors.top: bg.top - anchors.left: bg.left - anchors.topMargin: horizontal ? 0 : -handleOverlap + (control.value / control.maximumValue) * (bg.height + 2 * handleOverlap- height) - anchors.leftMargin: horizontal ? -handleOverlap + (control.value / control.maximumValue) * (bg.width + 2 * handleOverlap - width) : 0 - sourceComponent: handle - } - } -} diff --git a/src/styles/ScrollViewStyle.qml b/src/styles/ScrollViewStyle.qml index 11bdc59e..38dea2b4 100644 --- a/src/styles/ScrollViewStyle.qml +++ b/src/styles/ScrollViewStyle.qml @@ -43,41 +43,26 @@ import QtQuick.Controls.Private 1.0 /*! \qmltype ScrollViewStyle - \internal \inqmlmodule QtQuick.Controls.Styles 1.0 - \brief provides custom styling for ScrollView + \since QtQuick.Controls.Styles 1.0 + \brief Provides custom styling for ScrollView */ Style { id: root - /*! This property controls if the scroll bars - should stay outside or inside the scroll view - frame. + /*! The \l ScrollView attached to this style. */ + readonly property ScrollView control: __control - The default value is \c false. - */ - property bool externalScrollBars: false - - /*! This property controls the spacing between the - scroll bars and the frame when \l externalScrollBars - is \c true. - - The default value is \c 4. - */ - property int scrollBarSpacing: 4 - - /*! This property controls the frame width of the scrollView. - - The default value is \c 1. - */ - property int frameWidth: 1 - - /*! This property controls the scroll bar appearance */ - property Component scrollBar: ScrollBarStyle {} + /*! This property controls the frame border padding of the scrollView. */ + property Margins padding: Margins {left: 1; top: 1; right: 1; bottom: 1} /*! This Component paints the corner area between scroll bars */ property Component corner: Rectangle { color: "#ccc" } + /*! This component determines if the flickable should reposition itself at the + mouse location when clicked. */ + property bool scrollToClickedPosition: true + /*! This Component paints the frame around scroll bars. */ property Component frame: Rectangle { color: "white" @@ -86,4 +71,253 @@ Style { radius: 1 visible: control.frameVisible } + + /*! This is the minimum extent of the scroll bar handle. + + The default value is \c 30. + */ + + property int minimumHandleLength: 30 + + /*! This property controls the edge overlap + between the handle and the increment/decrement buttons. + + The default value is \c 30. + */ + + property int handleOverlap: 1 + + /*! This component controls the appearance of the + scroll bar background. + + \list + \li property bool hovered + \li property bool horizontal + \endlist + */ + + property Component scrollBarBackground: Item { + implicitWidth: 16 + implicitHeight: 16 + clip: true + Rectangle { + anchors.fill: parent + color: "#ddd" + border.color: "#aaa" + anchors.rightMargin: horizontal ? -2 : -1 + anchors.leftMargin: horizontal ? -2 : 0 + anchors.topMargin: horizontal ? 0 : -2 + anchors.bottomMargin: horizontal ? -1 : -2 + } + } + + /*! This component controls the appearance of the + scroll bar handle. + + \list + \li property bool hovered + \li property bool pressed + \li property bool horizontal + \endlist + */ + + property Component handle: Item { + implicitWidth: 16 + implicitHeight: 16 + Rectangle { + anchors.fill: parent + color: hovered ? "#ddd" : "lightgray" + border.color: "#aaa" + anchors.rightMargin: horizontal ? 0 : -1 + anchors.bottomMargin: horizontal ? -1 : 0 + Rectangle { + anchors.fill: parent + anchors.margins: 1 + color: "transparent" + border.color: "#44ffffff" + } + } + } + + /*! This component controls the appearance of the + scroll bar increment button. + + You can access the following state properties: + + \list + \li property bool hovered + \li property bool pressed + \li property bool horizontal + \endlist + */ + property Component incrementControl: Rectangle { + implicitWidth: 16 + implicitHeight: 16 + Rectangle { + anchors.fill: parent + anchors.bottomMargin: -1 + anchors.rightMargin: -1 + border.color: "#aaa" + Image { + source: horizontal ? "images/arrow-right.png" : "images/arrow-down.png" + anchors.centerIn: parent + opacity: control.enabled ? 0.7 : 0.5 + } + gradient: Gradient { + GradientStop {color: pressed ? "lightgray" : "white" ; position: 0} + GradientStop {color: pressed ? "lightgray" : "lightgray" ; position: 1} + } + } + } + + /*! This component controls the appearance of the + scroll bar decrement button. + + \list + \li property bool hovered + \li property bool pressed + \li property bool horizontal + \endlist + */ + property Component decrementControl: Rectangle { + implicitWidth: 16 + implicitHeight: 16 + Rectangle { + anchors.fill: parent + anchors.topMargin: horizontal ? 0 : -1 + anchors.leftMargin: horizontal ? -1 : 0 + anchors.bottomMargin: horizontal ? -1 : 0 + anchors.rightMargin: horizontal ? 0 : -1 + color: "lightgray" + Image { + source: horizontal ? "images/arrow-left.png" : "images/arrow-up.png" + anchors.centerIn: parent + anchors.verticalCenterOffset: horizontal ? 0 : -1 + anchors.horizontalCenterOffset: horizontal ? -1 : 0 + opacity: control.enabled ? 0.7 : 0.5 + } + gradient: Gradient { + GradientStop {color: pressed ? "lightgray" : "white" ; position: 0} + GradientStop {color: pressed ? "lightgray" : "lightgray" ; position: 1} + } + border.color: "#aaa" + } + } + + /*! \internal */ + property Component __scrollbar: Item { + id: panel + property string activeControl: "" + property bool scrollToClickPosition: true + property var controlStateRef: controlState + + implicitWidth: controlState.horizontal ? 200 : bg.implicitWidth + implicitHeight: controlState.horizontal ? bg.implicitHeight : 200 + + function pixelMetric(arg) { + if (arg === "scrollbarExtent") + return (controlState.horizontal ? bg.height : bg.width); + return 0; + } + + function styleHint(arg) { + return false; + } + + function hitTest(argX, argY) { + if (itemIsHit(handleControl, argX, argY)) + return "handle" + else if (itemIsHit(incrementLoader, argX, argY)) + return "up"; + else if (itemIsHit(decrementLoader, argX, argY)) + return "down"; + else if (itemIsHit(bg, argX, argY)) { + if (controlState.horizontal && argX < handleControl.x || !controlState.horizontal && argY < handleControl.y) + return "upPage" + else + return "downPage" + } + + return "none"; + } + + function subControlRect(arg) { + if (arg === "handle") { + return Qt.rect(handleControl.x, handleControl.y, handleControl.width, handleControl.height); + } else if (arg === "groove") { + if (controlState.horizontal) { + return Qt.rect(incrementLoader.width - handleOverlap, + 0, + __control.width - (incrementLoader.width + decrementLoader.width - handleOverlap * 2), + __control.height); + } else { + return Qt.rect(0, + incrementLoader.height - handleOverlap, + __control.width, + __control.height - (incrementLoader.height + decrementLoader.height - handleOverlap * 2)); + } + } + return Qt.rect(0,0,0,0); + } + + function itemIsHit(argItem, argX, argY) { + var pos = argItem.mapFromItem(__control, argX, argY); + return (pos.x >= 0 && pos.x <= argItem.width && pos.y >= 0 && pos.y <= argItem.height); + } + + Loader { + id: incrementLoader + anchors.top: parent.top + anchors.left: parent.left + sourceComponent: decrementControl + property bool hovered: activeControl === "up" + property bool pressed: controlState.upPressed + property bool horizontal: controlState.horizontal + } + + Loader { + id: bg + anchors.top: controlState.horizontal ? undefined : incrementLoader.bottom + anchors.bottom: controlState.horizontal ? undefined : decrementLoader.top + anchors.left: controlState.horizontal ? incrementLoader.right : undefined + anchors.right: controlState.horizontal ? decrementLoader.left : undefined + sourceComponent: scrollBarBackground + property bool horizontal: controlState.horizontal + property bool hovered: activeControl !== "none" + } + + Loader { + id: decrementLoader + anchors.bottom: controlState.horizontal ? undefined : parent.bottom + anchors.right: controlState.horizontal ? parent.right : undefined + sourceComponent: incrementControl + property bool hovered: activeControl === "down" + property bool pressed: controlState.downPressed + property bool horizontal: controlState.horizontal + } + + property var flickableItem: control.flickableItem + property int extent: Math.max(minimumHandleLength, controlState.horizontal ? + (flickableItem ? flickableItem.width/flickableItem.contentWidth : 0 ) * bg.width : + (flickableItem ? flickableItem.height/flickableItem.contentHeight : 0) * bg.height) + + Loader { + id: handleControl + height: controlState.horizontal ? implicitHeight : extent + width: controlState.horizontal ? extent : implicitWidth + anchors.top: bg.top + anchors.left: bg.left + anchors.topMargin: controlState.horizontal ? 0 : -handleOverlap + (__control.value / __control.maximumValue) * (bg.height + 2 * handleOverlap- height) + anchors.leftMargin: controlState.horizontal ? -handleOverlap + (__control.value / __control.maximumValue) * (bg.width + 2 * handleOverlap - width) : 0 + sourceComponent: handle + property bool hovered: activeControl === "handle" + property bool pressed: controlState.handlePressed + property bool horizontal: controlState.horizontal + } + } + + /*! \internal */ + property bool __externalScrollBars: false + /*! \internal */ + property int __scrollBarSpacing: 4 } diff --git a/src/styles/SliderStyle.qml b/src/styles/SliderStyle.qml index 27001182..02ad173f 100644 --- a/src/styles/SliderStyle.qml +++ b/src/styles/SliderStyle.qml @@ -44,6 +44,8 @@ import QtQuick.Controls.Private 1.0 /*! \qmltype SliderStyle \inqmlmodule QtQuick.Controls.Styles 1.0 + \since QtQuick.Controls.Styles 1.0 + \brief Provides custom styling for Slider The slider style allows you to create a custom appearance for a \l Slider control. @@ -55,27 +57,21 @@ import QtQuick.Controls.Private 1.0 Example: \qml Slider { + anchors.centerIn: parent style: SliderStyle { - background: Rectangle { + groove: Rectangle { implicitWidth: 200 implicitHeight: 8 color: "gray" radius: 8 - Rectangle { - height: parent.height - width: handlePosition - radius: 8 - border.color: "gray" - border.width: 2 - color: "lightsteelblue" - } } handle: Rectangle { + anchors.centerIn: parent color: control.pressed ? "white" : "lightgray" border.color: "gray" border.width: 2 - width: 24 - height: 24 + width: 34 + height: 34 radius: 12 } } @@ -85,6 +81,12 @@ import QtQuick.Controls.Private 1.0 Style { id: styleitem + /*! The \l Slider attached to this style. */ + readonly property Slider control: __control + + /*! The padding around the groove item. */ + property Margins padding: Margins { top: 0 ; left: 0 ; right: 0 ; bottom: 0 } + /*! This property holds the item for the slider handle. You can access the slider through the \c control property */ @@ -114,12 +116,10 @@ Style { } } - /*! This property holds the background for the slider. - - You can access the slider through the \c control property. + /*! This property holds the background groove of the slider. You can access the handle position through the \c handlePosition property. */ - property Component background: Item { + property Component groove: Item { anchors.verticalCenter: parent.verticalCenter implicitWidth: 100 implicitHeight: 8 @@ -140,29 +140,32 @@ Style { property Component panel: Item { id: root property bool horizontal : control.orientation === Qt.Horizontal - property Control __cref: control - implicitWidth: horizontal ? backgroundLoader.implicitWidth : Math.max(handleLoader.implicitHeight, backgroundLoader.implicitHeight) - implicitHeight: horizontal ? Math.max(handleLoader.implicitHeight, backgroundLoader.implicitHeight) : backgroundLoader.implicitWidth + property int horizontalSize: grooveLoader.implicitWidth + padding.left + padding.right + property int verticalSize: Math.max(handleLoader.implicitHeight, grooveLoader.implicitHeight) + padding.top + padding.bottom + + implicitWidth: horizontal ? horizontalSize : verticalSize + implicitHeight: horizontal ? verticalSize : horizontalSize + y: horizontal ? 0 : height rotation: horizontal ? 0 : -90 transformOrigin: Item.TopLeft + Item { + anchors.fill: parent + Loader { - id: backgroundLoader - property Control control: __cref - property Item handle: handleLoader.item + id: grooveLoader property int handlePosition: handleLoader.x + handleLoader.width/2 - - sourceComponent: background - width: horizontal ? parent.width : parent.height - y: Math.round(horizontal ? parent.height/2 : parent.width/2) - backgroundLoader.item.height/2 + x: padding.left + sourceComponent: groove + width: (horizontal ? parent.width : parent.height) - padding.left - padding.right + y: padding.top + (Math.round(horizontal ? parent.height : parent.width - padding.top - padding.bottom) - grooveLoader.item.height)/2 } Loader { id: handleLoader - property Control control: __cref sourceComponent: handle - anchors.verticalCenter: backgroundLoader.verticalCenter + anchors.verticalCenter: grooveLoader.verticalCenter x: Math.round(control.value / control.maximumValue * ((horizontal ? root.width : root.height)- item.width)) } } diff --git a/src/styles/SpinBoxStyle.qml b/src/styles/SpinBoxStyle.qml index db10fcab..4c966566 100644 --- a/src/styles/SpinBoxStyle.qml +++ b/src/styles/SpinBoxStyle.qml @@ -45,48 +45,53 @@ import QtQuick.Controls.Private 1.0 \qmltype SpinBoxStyle \internal \inqmlmodule QtQuick.Controls.Styles 1.0 - \brief provides custom styling for SpinBox + \since QtQuick.Controls.Styles 1.0 + \brief Provides custom styling for SpinBox */ Style { id: spinboxStyle - property int topMargin: 0 - property int leftMargin: 4 - property int rightMargin: 12 - property int bottomMargin: 0 + /*! The \l SpinBox attached to this style. */ + readonly property SpinBox control: __control - property color foregroundColor: __syspal.text - property color backgroundColor: __syspal.base + /*! The content margins of the text field. */ + property Margins margins: Margins { top: 0 ; left: 4 ; right: 12 ; bottom: 0 } + + /*! The text color. */ + property color textColor: __syspal.text + + /*! The text highlight color, used behind selections. */ property color selectionColor: __syspal.highlight - property color selectedTextColor: __syspal.highlightedText - property var __syspal: SystemPalette { - colorGroup: control.enabled ? SystemPalette.Active : SystemPalette.Disabled - } + /*! The highlighted text color, used in selections. */ + property color selectedTextColor: __syspal.highlightedText - property Component upControl: Item { + /*! The button used to increment the value. */ + property Component incrementControl: Item { implicitWidth: 18 Image { source: "images/arrow-up.png" anchors.centerIn: parent anchors.verticalCenterOffset: 1 - opacity: 0.7 + opacity: control.enabled ? 0.7 : 0.5 anchors.horizontalCenterOffset: -1 } } - property Component downControl: Item { + /*! The button used to decrement the value. */ + property Component decrementControl: Item { implicitWidth: 18 Image { source: "images/arrow-down.png" anchors.centerIn: parent anchors.verticalCenterOffset: -1 anchors.horizontalCenterOffset: -1 - opacity: 0.7 + opacity: control.enabled ? 0.7 : 0.5 } } + /*! The background of the SpinBox. */ property Component background: Item { BorderImage { anchors.fill: parent @@ -96,71 +101,62 @@ Style { border.top: 4 border.bottom: 4 anchors.bottomMargin: -2 + BorderImage { + anchors.fill: parent + anchors.margins: -1 + anchors.topMargin: -2 + anchors.bottomMargin: 1 + anchors.rightMargin: 0 + source: "images/focusframe.png" + visible: control.activeFocus + border.left: 4 + border.right: 4 + border.top: 4 + border.bottom: 4 + } } } - property Component panel: Item { + /*! \internal */ + property Component panel: Item { id: styleitem - implicitWidth: control.__contentWidth + 26 + implicitWidth: controlState.contentWidth + 26 implicitHeight: 23 - property color foregroundColor: spinboxStyle.foregroundColor - property color backgroundColor: spinboxStyle.backgroundColor + property color foregroundColor: spinboxStyle.textColor property color selectionColor: spinboxStyle.selectionColor property color selectedTextColor: spinboxStyle.selectedTextColor - property int leftMargin: spinboxStyle.leftMargin - property int rightMargin: spinboxStyle.rightMargin - property int topMargin: spinboxStyle.topMargin - property int bottomMargin: spinboxStyle.bottomMargin + property var margins: spinboxStyle.margins - property rect upRect: Qt.rect(width - upControlLoader.implicitWidth, 0, upControlLoader.implicitWidth, height / 2 + 1) - property rect downRect: Qt.rect(width - downControlLoader.implicitWidth, height / 2, downControlLoader.implicitWidth, height / 2) + property rect upRect: Qt.rect(width - incrementControlLoader.implicitWidth, 0, incrementControlLoader.implicitWidth, height / 2 + 1) + property rect downRect: Qt.rect(width - decrementControlLoader.implicitWidth, height / 2, decrementControlLoader.implicitWidth, height / 2) property int horizontalTextAlignment: Qt.AlignLeft property int verticalTextAlignment: Qt.AlignVCenter - property SpinBox cref: control - Loader { id: backgroundLoader anchors.fill: parent sourceComponent: background - property SpinBox control: cref } Loader { - id: upControlLoader + id: incrementControlLoader x: upRect.x y: upRect.y width: upRect.width height: upRect.height - sourceComponent: upControl - property SpinBox control: cref + sourceComponent: incrementControl } Loader { - id: downControlLoader + id: decrementControlLoader x: downRect.x y: downRect.y width: downRect.width height: downRect.height - sourceComponent: downControl - property SpinBox control: cref + sourceComponent: decrementControl } - - BorderImage { - anchors.fill: parent - anchors.margins: -1 - anchors.topMargin: -2 - anchors.rightMargin: 0 - source: "images/focusframe.png" - visible: control.activeFocus - border.left: 4 - border.right: 4 - border.top: 4 - border.bottom: 4 - } - } } diff --git a/src/styles/StatusBarStyle.qml b/src/styles/StatusBarStyle.qml index 77ce8d0a..049b15f2 100644 --- a/src/styles/StatusBarStyle.qml +++ b/src/styles/StatusBarStyle.qml @@ -45,6 +45,7 @@ import QtQuick.Controls.Private 1.0 \qmltype StatusBarStyle \internal \inqmlmodule QtQuick.Controls.Styles 1.0 + \since QtQuick.Controls.Styles 1.0 */ Item { implicitHeight: 22 diff --git a/src/styles/TabViewStyle.qml b/src/styles/TabViewStyle.qml index 75c63314..48a401d1 100644 --- a/src/styles/TabViewStyle.qml +++ b/src/styles/TabViewStyle.qml @@ -38,67 +38,106 @@ ** ****************************************************************************/ import QtQuick 2.1 +import QtQuick.Controls 1.0 import QtQuick.Controls.Private 1.0 /*! \qmltype TabViewStyle - \internal \inqmlmodule QtQuick.Controls.Styles 1.0 - \brief provides custom styling for TabView + \since QtQuick.Controls.Styles 1.0 + \brief Provides custom styling for TabView + +\qml + TabView { + id: frame + anchors.fill: parent + anchors.margins: 4 + Tab { title: "Tab 1" } + Tab { title: "Tab 2" } + Tab { title: "Tab 3" } + + style: TabViewStyle { + frameOverlap: 1 + tab: Rectangle { + color: tab.selected ? "steelblue" :"lightsteelblue" + border.color: "steelblue" + implicitWidth: Math.max(text.width + 4, 80) + implicitHeight: 20 + radius: 2 + Text { + id: text + anchors.centerIn: parent + text: tab.title + color: tab.selected ? "white" : "black" + } + } + frame: Rectangle { color: "steelblue" } + } + } +\endqml + */ Style { - /*! This property holds the base alignment of the tab bar. - The default value is "left". Supporeted alignments are - "left", "center" or "right". - */ - property string tabBarAlignment: "left" + /*! The \l ScrollView attached to this style. */ + readonly property TabView control: __control - /*! This property holds the left margin of the tab bar. - It will only affect tabs \l tabBarAligment set to "right". + /*! This property holds the horizontal alignment of + the tab buttons. Supported values are: + \list + \li Qt.AlignLeft (default) + \li Qt.AlignHCenter + \li Qt.AlignRight + \endlist */ - property int leftMargin: 0 + property int tabsAlignment: Qt.AlignLeft - /*! This property holds the right margin of the tab bar. - It will only affect tabs \l tabBarAligment set to "right". - */ - property int rightMargin: 0 + /*! This property holds the left padding of the tab bar. */ + property int tabsLeftPadding: 0 + + /*! This property holds the right padding of the tab bar. */ + property int tabsRightPadding: 0 /*! This property holds the amount of overlap there are between - individual tab buttons. The default value is 0 - */ - property int tabOverlap: 3 + individual tab buttons. */ + property int tabOverlap: 1 - property int tabvshift : 0 - property int tabBaseOverlap: 2 + /*! This property holds the amount of overlap there are between + individual tab buttons and the frame. */ + property int frameOverlap: 2 - property color textColor: __syspal.text + /*! This defines the tab frame. */ + property Component frame: Rectangle { + color: "#dcdcdc" + border.color: "#aaa" - property var __syspal: SystemPalette { - colorGroup: control.enabled ? SystemPalette.Active : SystemPalette.Disabled - } - - property Component frame: Item { Rectangle { anchors.fill: parent - anchors.topMargin: -tabBaseOverlap - color: "#dcdcdc" - border.color: "#aaa" - - Rectangle { - anchors.fill: parent - color: "transparent" - border.color: "#66ffffff" - anchors.margins: 1 - } + color: "transparent" + border.color: "#66ffffff" + anchors.margins: 1 } } + /*! This defines the tab. You can access the tab state through the + \c tab property, with the following properties: + + \table + \li readonly property int index - This is the current tab index. + \li readonly property bool selected - This is the active tab. + \li readonly property string title - Tab title text. + \li readonly property bool nextSelected = The next tab is selected. + \li readonly property bool previsousSelected - The previous tab is selected. + \li readonly property bool hovered - The tab is currently under the mouse. + \endtable + */ property Component tab: Item { scale: control.tabPosition === Qt.TopEdge ? 1 : -1 + implicitWidth: Math.round(textitem.implicitWidth + 20) implicitHeight: Math.round(textitem.implicitHeight + 10) + clip: true Item { anchors.fill: parent @@ -111,7 +150,7 @@ Style { border.bottom: 6 border.left: 6 border.right: 6 - anchors.topMargin: control.tabPosition === Qt.TopEdge ? (tab.selected ? 0 : 1) : 0 + anchors.topMargin: tab.selected ? 0 : 1 } BorderImage { anchors.fill: parent @@ -119,20 +158,20 @@ Style { anchors.leftMargin: -2 anchors.rightMargin: -1 source: "images/focusframe.png" - visible: tabbarItem.activeFocus && tab.selected + visible: control.activeFocus && tab.selected border.left: 4 border.right: 4 border.top: 4 border.bottom: 4 } - - } - Text { - id: textitem - anchors.centerIn: parent - text: tab.title - color: textColor - renderType: Text.NativeRendering + Text { + id: textitem + anchors.centerIn: parent + text: tab.title + renderType: Text.NativeRendering + scale: control.tabPosition === Qt.TopEdge ? 1 : -1 + color: __syspal.text + } } } } diff --git a/src/styles/TableViewStyle.qml b/src/styles/TableViewStyle.qml index 86678f97..e2d3c0c7 100644 --- a/src/styles/TableViewStyle.qml +++ b/src/styles/TableViewStyle.qml @@ -41,17 +41,31 @@ import QtQuick 2.1 import QtQuick.Controls 1.0 import QtQuick.Controls.Private 1.0 +/*! + \qmltype TableViewStyle + \inqmlmodule QtQuick.Controls.Styles 1.0 + \since QtQuick.Controls.Styles 1.0 + \brief Provides custom styling for TableView + + Note that this class derives from \l ScrollViewStyle + and supports all of the properties defined there. +*/ ScrollViewStyle { id: root - property bool activateItemOnSingleClick: false + /*! The \l TableView attached to this style. */ + readonly property TableView control: __control + + /*! The text color. */ property color textColor: __syspal.text + + /*! The text highlight color, used behind selections. */ property color highlightedTextColor: "white" - property SystemPalette __syspal: SystemPalette { - colorGroup: control.enabled ? SystemPalette.Active : SystemPalette.Disabled - } + /*! Activates items on single click. */ + property bool activateItemOnSingleClick: false + /* Delegate for header. This delegate is described in \l TableView::headerDelegate */ property Component headerDelegate: Rectangle { gradient: Gradient { GradientStop {position: 0 ; color: "#eee"} @@ -85,6 +99,7 @@ ScrollViewStyle { } } + /* Delegate for header. This delegate is described in \l TableView::rowDelegate */ property Component rowDelegate: Rectangle { implicitHeight: 20 implicitWidth: 80 @@ -107,7 +122,8 @@ ScrollViewStyle { } } - property Component standardDelegate: Item { + /* Delegate for header. This delegate is described in \l TableView::itemDelegate */ + property Component itemDelegate: Item { height: Math.max(16, label.implicitHeight) property int implicitWidth: sizehint.paintedWidth + 4 diff --git a/src/styles/TextFieldStyle.qml b/src/styles/TextFieldStyle.qml index 4414f33b..4e7e8b66 100644 --- a/src/styles/TextFieldStyle.qml +++ b/src/styles/TextFieldStyle.qml @@ -43,30 +43,49 @@ import QtQuick.Controls.Private 1.0 /*! \qmltype TextFieldStyle - \internal \inqmlmodule QtQuick.Controls.Styles 1.0 - \brief provides custom styling for TextField. + \since QtQuick.Controls.Styles 1.0 + \brief Provides custom styling for TextField. + + Example: + \qml + TextField { + style: TextFieldStyle { + textColor: "black" + background: Rectangle { + radius: 2 + implicitWidth: 100 + implicitHeight: 24 + border.color: "#333" + border.width: 1 + } + } + } + \endqml */ Style { id: style - property int topMargin: 4 - property int leftMargin: 6 - property int rightMargin: 6 - property int bottomMargin: 4 + /*! The \l TextField attached to this style. */ + readonly property TextField control: __control - property color foregroundColor: __syspal.text - property color backgroundColor: "white" - property color selectionColor: __syspal.highlight - property color selectedTextColor: __syspal.highlightedText - - property SystemPalette __syspal: SystemPalette { - colorGroup: control.enabled ? SystemPalette.Active : SystemPalette.Disabled - } + /*! The content margins of the text field. */ + property Margins padding: Margins { top: 4 ; left: 6 ; right: 6 ; bottom:4 } + /*! The current font. */ property font font + /*! The text color. */ + property color textColor: __syspal.text + + /*! The text highlight color, used behind selections. */ + property color selectionColor: __syspal.highlight + + /*! The highlighted text color, used in selections. */ + property color selectedTextColor: __syspal.highlightedText + + /*! The background of the text field. */ property Component background: Item { implicitWidth: 100 implicitHeight: 25 @@ -93,16 +112,16 @@ Style { } } + /*! \internal */ property Component panel: Item { anchors.fill: parent - property int topMargin: style.topMargin - property int leftMargin: style.leftMargin - property int rightMargin: style.rightMargin - property int bottomMargin: style.bottomMargin + property int topMargin: padding.top + property int leftMargin: padding.left + property int rightMargin: padding.right + property int bottomMargin: padding.bottom - property color foregroundColor: style.foregroundColor - property color backgroundColor: style.backgroundColor + property color textColor: style.textColor property color selectionColor: style.selectionColor property color selectedTextColor: style.selectedTextColor diff --git a/src/styles/ToolButtonStyle.qml b/src/styles/ToolButtonStyle.qml index 8c8bdc3c..e8d05d6c 100644 --- a/src/styles/ToolButtonStyle.qml +++ b/src/styles/ToolButtonStyle.qml @@ -47,6 +47,7 @@ import QtQuick.Controls.Private 1.0 \inqmlmodule QtQuick.Controls.Styles 1.0 */ Style { + readonly property ToolButton control: __control property Component panel: Item { id: styleitem implicitWidth: 36 diff --git a/src/styles/qmldir b/src/styles/qmldir index 8a0b058c..d9595239 100644 --- a/src/styles/qmldir +++ b/src/styles/qmldir @@ -2,17 +2,10 @@ module QtQuick.Controls.Styles ButtonStyle 1.0 ButtonStyle.qml CheckBoxStyle 1.0 CheckBoxStyle.qml ComboBoxStyle 1.0 ComboBoxStyle.qml -FocusFrameStyle 1.0 FocusFrameStyle.qml -GroupBoxStyle 1.0 GroupBoxStyle.qml ProgressBarStyle 1.0 ProgressBarStyle.qml RadioButtonStyle 1.0 RadioButtonStyle.qml ScrollViewStyle 1.0 ScrollViewStyle.qml -ScrollBarStyle 1.0 ScrollBarStyle.qml SliderStyle 1.0 SliderStyle.qml -SpinBoxStyle 1.0 SpinBoxStyle.qml -StatusBarStyle 1.0 StatusBarStyle.qml TabViewStyle 1.0 TabViewStyle.qml TableViewStyle 1.0 TableViewStyle.qml TextFieldStyle 1.0 TextFieldStyle.qml -ToolBarStyle 1.0 ToolBarStyle.qml -ToolButtonStyle 1.0 ToolButtonStyle.qml diff --git a/src/styles/styles.pro b/src/styles/styles.pro index d9198fef..30806565 100644 --- a/src/styles/styles.pro +++ b/src/styles/styles.pro @@ -10,7 +10,6 @@ QML_FILES = \ MenuStyle.qml \ ProgressBarStyle.qml \ RadioButtonStyle.qml \ - ScrollBarStyle.qml \ ScrollViewStyle.qml\ SliderStyle.qml \ SpinBoxStyle.qml \ @@ -33,7 +32,6 @@ QML_FILES += \ Desktop/ProgressBarStyle.qml \ Desktop/RadioButtonStyle.qml \ Desktop/ScrollViewStyle.qml \ - Desktop/ScrollBarStyle.qml \ Desktop/SliderStyle.qml \ Desktop/SpinBoxStyle.qml \ Desktop/StatusBarStyle.qml\ |