Change copyrights from Nokia to Digia
[profile/ivi/qtwayland.git] / examples / qml-compositor / WindowChrome.qml
index 6fb2ebe..fe9f5d7 100644 (file)
@@ -1,7 +1,7 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the examples of the Qt Toolkit.
 **
 **     notice, this list of conditions and the following disclaimer in
 **     the documentation and/or other materials provided with the
 **     distribution.
-**   * Neither the name of Nokia Corporation 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.
+**   * 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
@@ -45,12 +45,19 @@ Item {
     anchors.fill: parent
 
     property variant window: parent;
+    property bool selected: root.selectedWindow === window
 
     MouseArea {
         anchors.fill: parent
         enabled: !window.focus
+        hoverEnabled: !window.focus
         onClicked: {
-            window.takeFocus();
+            if (selected) {
+                window.takeFocus();
+            } else {
+                root.selectedWindow = window
+                root.focus = true
+            }
         }
     }
 }