diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2014-10-01 10:33:39 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@digia.com> | 2014-10-01 15:27:49 +0200 |
commit | cc174637dd75da1e759a058648dac9cc9fb5ba2c (patch) | |
tree | 6260c990d7968d188ef0dbd8bd6ab7c1cbc0af5a | |
parent | 121056b1410614cc3181ef8557eb1b4e44b8d5ad (diff) | |
download | qtquickcontrols-cc174637dd75da1e759a058648dac9cc9fb5ba2c.tar.gz |
gallery: cleanup system palette usage
ApplicationWindow sets the background color as appropriate => no need
to use SystemPalette there. The child window was unnecessarily creating
an extra Rectangle just for the background color => use Window::color.
Change-Id: Id109c9e5f4d633baf1133afd3a1e9af277310e98
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
-rw-r--r-- | examples/quick/controls/gallery/content/ChildWindow.qml | 116 | ||||
-rw-r--r-- | examples/quick/controls/gallery/main.qml | 3 |
2 files changed, 57 insertions, 62 deletions
diff --git a/examples/quick/controls/gallery/content/ChildWindow.qml b/examples/quick/controls/gallery/content/ChildWindow.qml index 039e20dd..334b11e5 100644 --- a/examples/quick/controls/gallery/content/ChildWindow.qml +++ b/examples/quick/controls/gallery/content/ChildWindow.qml @@ -54,69 +54,67 @@ Window { title: "child window" flags: Qt.Dialog + color: syspal.window - Rectangle { - color: syspal.window - anchors.fill: parent + SystemPalette { id: syspal } - Label { - id: dimensionsText - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: parent.top - width: parent.width - horizontalAlignment: Text.AlignHCenter - } + Label { + id: dimensionsText + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + width: parent.width + horizontalAlignment: Text.AlignHCenter + } - Label { - id: availableDimensionsText - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: dimensionsText.bottom - width: parent.width - horizontalAlignment: Text.AlignHCenter - } + Label { + id: availableDimensionsText + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: dimensionsText.bottom + width: parent.width + horizontalAlignment: Text.AlignHCenter + } - Label { - id: closeText - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: availableDimensionsText.bottom - text: "This is a new Window, press the\nbutton below to close it again." - } - Button { - anchors.horizontalCenter: closeText.horizontalCenter - anchors.top: closeText.bottom - id: closeWindowButton - text:"Close" - width: 98 - tooltip:"Press me, to close this window again" - onClicked: window1.visible = false - } - Button { - anchors.horizontalCenter: closeText.horizontalCenter - anchors.top: closeWindowButton.bottom - id: maximizeWindowButton - text:"Maximize" - width: 98 - tooltip:"Press me, to maximize this window again" - onClicked: window1.visibility = Window.Maximized; - } - Button { - anchors.horizontalCenter: closeText.horizontalCenter - anchors.top: maximizeWindowButton.bottom - id: normalizeWindowButton - text:"Normalize" - width: 98 - tooltip:"Press me, to normalize this window again" - onClicked: window1.visibility = Window.Windowed; - } - Button { - anchors.horizontalCenter: closeText.horizontalCenter - anchors.top: normalizeWindowButton.bottom - id: minimizeWindowButton - text:"Minimize" - width: 98 - tooltip:"Press me, to minimize this window again" - onClicked: window1.visibility = Window.Minimized; - } + Label { + id: closeText + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: availableDimensionsText.bottom + text: "This is a new Window, press the\nbutton below to close it again." + } + Button { + anchors.horizontalCenter: closeText.horizontalCenter + anchors.top: closeText.bottom + id: closeWindowButton + text:"Close" + width: 98 + tooltip:"Press me, to close this window again" + onClicked: window1.visible = false + } + Button { + anchors.horizontalCenter: closeText.horizontalCenter + anchors.top: closeWindowButton.bottom + id: maximizeWindowButton + text:"Maximize" + width: 98 + tooltip:"Press me, to maximize this window again" + onClicked: window1.visibility = Window.Maximized; + } + Button { + anchors.horizontalCenter: closeText.horizontalCenter + anchors.top: maximizeWindowButton.bottom + id: normalizeWindowButton + text:"Normalize" + width: 98 + tooltip:"Press me, to normalize this window again" + onClicked: window1.visibility = Window.Windowed; + } + Button { + anchors.horizontalCenter: closeText.horizontalCenter + anchors.top: normalizeWindowButton.bottom + id: minimizeWindowButton + text:"Minimize" + width: 98 + tooltip:"Press me, to minimize this window again" + onClicked: window1.visibility = Window.Minimized; } } diff --git a/examples/quick/controls/gallery/main.qml b/examples/quick/controls/gallery/main.qml index a6f4ce39..8b89d80d 100644 --- a/examples/quick/controls/gallery/main.qml +++ b/examples/quick/controls/gallery/main.qml @@ -228,9 +228,6 @@ ApplicationWindow { } } - - SystemPalette {id: syspal} - color: syspal.window ListModel { id: choices ListElement { text: "Banana" } |