Added ApplicationWindowStyle based on Base style. upstream v5.4.0 v5.5.90+alpha1
authorTomasz Olszak <olszak.tomasz@gmail.com>
Mon, 6 Oct 2014 23:05:06 +0000 (01:05 +0200)
committerTomasz Olszak <olszak.tomasz@gmail.com>
Fri, 10 Oct 2014 12:46:15 +0000 (14:46 +0200)
Change-Id: Ic01c8f4d36f4b9f7d022d74193b5d434db9da541
Reviewed-by: Philippe Coval <rzr@gna.org>
Reviewed-by: Leon Anavi <leon@anavi.org>
Reviewed-by: Tomasz Olszak <olszak.tomasz@gmail.com>
src/styles/ApplicationWindowStyle.qml [new file with mode: 0644]
src/styles/styles.pro

diff --git a/src/styles/ApplicationWindowStyle.qml b/src/styles/ApplicationWindowStyle.qml
new file mode 100644 (file)
index 0000000..475494f
--- /dev/null
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 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.2
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Private 1.0
+
+QtObject {
+    readonly property ApplicationWindow control: __control
+
+    property Component background: Rectangle {
+        visible: !styleData.hasColor
+        color: SystemPaletteSingleton.window(true)
+    }
+
+    property Component panel: Item {
+        readonly property alias contentArea: contentArea
+        readonly property alias menuBarArea: menuBarArea
+        readonly property alias toolBarArea: toolBarArea
+        readonly property alias statusBarArea: statusBarArea
+
+        Loader {
+            anchors.fill: parent
+            sourceComponent: background
+        }
+
+        Item {
+            id: contentArea
+            anchors.top: toolBarArea.bottom
+            anchors.left: parent.left
+            anchors.right: parent.right
+            anchors.bottom: statusBarArea.top
+        }
+
+        Item {
+            id: toolBarArea
+            anchors.top: parent.menuBarArea.bottom
+            anchors.left: parent.left
+            anchors.right: parent.right
+            implicitHeight: childrenRect.height
+            height: visibleChildren.length > 0 ? implicitHeight: 0
+        }
+
+        Item {
+            id: menuBarArea
+            anchors.top: parent.top
+            anchors.left: parent.left
+            anchors.right: parent.right
+            implicitHeight: childrenRect.height
+            height: visibleChildren.length > 0 ? implicitHeight: 0
+        }
+
+        Item {
+            id: statusBarArea
+            anchors.bottom: parent.bottom
+            anchors.left: parent.left
+            anchors.right: parent.right
+            implicitHeight: childrenRect.height
+            height: visibleChildren.length > 0 ? implicitHeight: 0
+        }
+    }
+}
index 90ef5d7..8d3a20d 100644 (file)
@@ -29,7 +29,8 @@ QML_FILES = \
     PanelStyle.qml \
     RadioButtonStyle.qml \
     FocusFrameStyle.qml \
-    ScrollViewStyle.qml
+    ScrollViewStyle.qml \
+    ApplicationWindowStyle.qml
 
 QML_FILES += \
     private/DateEditField.qml\