diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/controls/Private/qmldir | 2 | ||||
| -rw-r--r-- | src/controls/Styles/Base/StatusBarStyle.qml | 56 | ||||
| -rw-r--r-- | src/controls/Styles/Base/ToolBarStyle.qml | 50 | ||||
| -rw-r--r-- | src/controls/Styles/qmldir | 2 |
4 files changed, 93 insertions, 17 deletions
diff --git a/src/controls/Private/qmldir b/src/controls/Private/qmldir index c8c6f46b3..f099634c2 100644 --- a/src/controls/Private/qmldir +++ b/src/controls/Private/qmldir @@ -15,8 +15,6 @@ TableViewSelection 1.0 TableViewSelection.qml FastGlow 1.0 FastGlow.qml SourceProxy 1.0 SourceProxy.qml GroupBoxStyle 1.0 ../Styles/Base/GroupBoxStyle.qml -ToolBarStyle 1.0 ../Styles/Base/ToolBarStyle.qml -StatusBarStyle 1.0 ../Styles/Base/StatusBarStyle.qml ToolButtonStyle 1.0 ../Styles/Base/ToolButtonStyle.qml MenuContentItem 1.0 MenuContentItem.qml MenuContentScroller 1.0 MenuContentScroller.qml diff --git a/src/controls/Styles/Base/StatusBarStyle.qml b/src/controls/Styles/Base/StatusBarStyle.qml index a210650f7..aa8f6d6e9 100644 --- a/src/controls/Styles/Base/StatusBarStyle.qml +++ b/src/controls/Styles/Base/StatusBarStyle.qml @@ -43,19 +43,55 @@ import QtQuick.Controls.Private 1.0 /*! \qmltype StatusBarStyle - \internal - \ingroup applicationwindowstyling \inqmlmodule QtQuick.Controls.Styles - \since 5.1 + \ingroup controlsstyling + \since 5.2 + \brief Provides custom styling for StatusBar + + The status bar can be defined by overriding the background component and + setting the content padding. + + Example: + \qml + StatusBar { + style: StatusBarStyle { + padding { + left: 8 + right: 8 + top: 3 + bottom: 3 + } + background: Rectangle { + implicitHeight: 16 + implicitWidth: 200 + gradient: Gradient{ + GradientStop{color: "#eee" ; position: 0} + GradientStop{color: "#ccc" ; position: 1} + } + Rectangle { + anchors.top: parent.top + width: parent.width + height: 1 + color: "#999" + } + } + } + } + \endqml */ + Style { - padding.left: 3 - padding.right: 3 - padding.top: 3 - padding.bottom: 2 + /*! The content padding inside the status bar. */ + padding { + left: 3 + right: 3 + top: 3 + bottom: 2 + } - property Component panel: Rectangle { + /*! This defines the background of the tool bar. */ + property Component background: Rectangle { implicitHeight: 16 implicitWidth: 200 @@ -71,4 +107,8 @@ Style { color: "#999" } } + + property Component panel: Loader { + sourceComponent: background + } } diff --git a/src/controls/Styles/Base/ToolBarStyle.qml b/src/controls/Styles/Base/ToolBarStyle.qml index 51fe8ca74..ca5d93fba 100644 --- a/src/controls/Styles/Base/ToolBarStyle.qml +++ b/src/controls/Styles/Base/ToolBarStyle.qml @@ -43,18 +43,50 @@ import QtQuick.Controls.Private 1.0 /*! \qmltype ToolBarStyle - \internal - \ingroup applicationwindowstyling \inqmlmodule QtQuick.Controls.Styles + \ingroup controlsstyling + \since 5.2 + \brief Provides custom styling for ToolBar + + The tool bar can be defined by overriding the background component and + setting the content padding. + + Example: + \qml + ToolBar { + style: ToolBarStyle { + padding { + left: 8 + right: 8 + top: 3 + bottom: 3 + } + background: Rectangle { + implicitWidth: 100 + implicitHeight: 40 + border.color: "#999" + gradient: Gradient { + GradientStop { position: 0 ; color: "#fff" } + GradientStop { position: 1 ; color: "#eee" } + } + } + } + } + \endqml */ + Style { - padding.left: 6 - padding.right: 6 - padding.top: 3 - padding.bottom: 3 + /*! The content padding inside the tool bar. */ + padding { + left: 6 + right: 6 + top: 3 + bottom: 3 + } - property Component panel: Item { + /*! This defines the background of the tool bar. */ + property Component background: Item { implicitHeight: 40 implicitWidth: 200 Rectangle { @@ -71,4 +103,8 @@ Style { } } } + + property Component panel: Loader { + sourceComponent: background + } } diff --git a/src/controls/Styles/qmldir b/src/controls/Styles/qmldir index 8e53b6ba0..5cd368ac8 100644 --- a/src/controls/Styles/qmldir +++ b/src/controls/Styles/qmldir @@ -13,3 +13,5 @@ TabViewStyle 1.0 Base/TabViewStyle.qml TableViewStyle 1.0 Base/TableViewStyle.qml TextAreaStyle 1.1 Base/TextAreaStyle.qml TextFieldStyle 1.0 Base/TextFieldStyle.qml +ToolBarStyle 1.0 Base/ToolBarStyle.qml +StatusBarStyle 1.0 Base/StatusBarStyle.qml |
