diff --git a/examples/quick/controls/gallery/content/Styles.qml b/examples/quick/controls/gallery/content/Styles.qml index a65f30242b81eb472d7f060cf2f4a638a382bd8a..01b2646f49bfe3541569aa110f3c8a258c9ba560 100644 --- a/examples/quick/controls/gallery/content/Styles.qml +++ b/examples/quick/controls/gallery/content/Styles.qml @@ -172,17 +172,13 @@ Item { // Style delegates: property Component buttonStyle: ButtonStyle { - panel: Rectangle { + background: Rectangle { implicitHeight: 20 implicitWidth: 100 color: control.pressed ? "darkGray" : "lightGray" antialiasing: true border.color: "gray" radius: height/2 - Text { - anchors.centerIn: parent - text: control.text - } } } @@ -220,21 +216,21 @@ Item { } property Component progressbarStyle: ProgressBarStyle { - panel: Rectangle { + background: Rectangle { implicitWidth: 100 implicitHeight: 20 color: "#f0f0f0" border.color: "gray" antialiasing: true radius: height/2 - Rectangle { - implicitWidth: 100 - implicitHeight: 20 - color: "#f0f0f0" - border.color: "gray" - antialiasing: true - radius: height/2 - } + } + progress: Rectangle { + implicitWidth: 100 + implicitHeight: 20 + color: "#c0c0c0" + border.color: "gray" + antialiasing: true + radius: height/2 } } diff --git a/src/styles/Base/ButtonStyle.qml b/src/styles/Base/ButtonStyle.qml index a524d93f47e792ffc4c7c40e7c30dcbd982953fe..e668b042207273e812308ba785863ab0d7318eec 100644 --- a/src/styles/Base/ButtonStyle.qml +++ b/src/styles/Base/ButtonStyle.qml @@ -92,7 +92,13 @@ PaddedStyle { bottom: 4 } - /*! The background of the button. */ + /*! This defines the background of the button. In addition to the public + properties of \c control, the following state properties are available: + + \table + \li readonly property bool styleData.hovered - The button is currently hovered. + \endtable + */ property Component background: Item { implicitWidth: 100 implicitHeight: 25 @@ -129,7 +135,13 @@ PaddedStyle { } } - /*! The label of the button. */ + /*! This defines the label of the button. In addition to the public + properties of \c control, the following state properties are available: + + \table + \li readonly property bool styleData.hovered - The button is currently hovered. + \endtable + */ property Component label: Text { renderType: Text.NativeRendering verticalAlignment: Text.AlignVCenter @@ -149,6 +161,9 @@ PaddedStyle { id: backgroundLoader anchors.fill: parent sourceComponent: background + property QtObject styleData: QtObject { + readonly property bool hovered: control.__containsMouse + } } Loader { @@ -159,6 +174,9 @@ PaddedStyle { anchors.topMargin: padding.top anchors.rightMargin: padding.right anchors.bottomMargin: padding.bottom + property QtObject styleData: QtObject { + readonly property bool hovered: control.__containsMouse + } } } }