diff options
author | Ivan Vizir <define-true-false@yandex.com> | 2013-07-05 12:22:16 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-05 18:40:31 +0200 |
commit | 91b7df31f1dfea58125d01b990563bee949afda2 (patch) | |
tree | dbd1ccec60cfaaa7ec1dbfb5b693988b91052efe /examples/winextras | |
parent | c4ed73138c594abaaab7dbec1ce9c25c1bfec847 (diff) |
Move quickdwm example to examples/winextras directory, too.
Change-Id: Ic3fa14cf2e22e55ebf2aa10c8725b3d1a6569679
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Diffstat (limited to 'examples/winextras')
-rw-r--r-- | examples/winextras/quickdwm/icon.png | bin | 0 -> 4945 bytes | |||
-rw-r--r-- | examples/winextras/quickdwm/quickdwm.qml | 158 | ||||
-rw-r--r-- | examples/winextras/quickdwm/quickdwm.qmlproject | 15 |
3 files changed, 173 insertions, 0 deletions
diff --git a/examples/winextras/quickdwm/icon.png b/examples/winextras/quickdwm/icon.png Binary files differnew file mode 100644 index 0000000..6ad8096 --- /dev/null +++ b/examples/winextras/quickdwm/icon.png diff --git a/examples/winextras/quickdwm/quickdwm.qml b/examples/winextras/quickdwm/quickdwm.qml new file mode 100644 index 0000000..f6f807c --- /dev/null +++ b/examples/winextras/quickdwm/quickdwm.qml @@ -0,0 +1,158 @@ +/**************************************************************************** + ** + ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> + ** Contact: http://www.qt-project.org/legal + ** + ** This file is part of QtWinExtras in the Qt Toolkit. + ** + ** $QT_BEGIN_LICENSE:LGPL$ + ** Commercial License Usage + ** Licensees holding valid commercial Qt licenses may use this file in + ** accordance with the commercial license agreement provided with the + ** Software or, alternatively, in accordance with the terms contained in + ** a written agreement between you and Digia. For licensing terms and + ** conditions see http://qt.digia.com/licensing. For further information + ** use the contact form at http://qt.digia.com/contact-us. + ** + ** GNU Lesser General Public License Usage + ** Alternatively, this file may be used under the terms of the GNU Lesser + ** General Public License version 2.1 as published by the Free Software + ** Foundation and appearing in the file LICENSE.LGPL included in the + ** packaging of this file. Please review the following information to + ** ensure the GNU Lesser General Public License version 2.1 requirements + ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + ** + ** In addition, as a special exception, Digia gives you certain additional + ** rights. These rights are described in the Digia Qt LGPL Exception + ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. + ** + ** GNU General Public License Usage + ** Alternatively, this file may be used under the terms of the GNU + ** General Public License version 3.0 as published by the Free Software + ** Foundation and appearing in the file LICENSE.GPL included in the + ** packaging of this file. Please review the following information to + ** ensure the GNU General Public License version 3.0 requirements will be + ** met: http://www.gnu.org/copyleft/gpl.html. + ** + ** + ** $QT_END_LICENSE$ + ** + ****************************************************************************/ + +import QtQuick 2.0 +import QtWinExtras 1.0 +import QtQuick.Window 2.1 + +Rectangle { + width: 300 + height: 130 + color: "transparent" + + WinDwmFeatures { + id: dwmfeatures + bottomGlassMargin: isCompositionEnabled ? 30 : 0 + excludedFromPeek: true + flip3DPolicy: WinDwmFeatures.FlipExcludeAbove + } + + WinTaskbarButton { + progressState: WinTaskbarButton.IndeterminateState + overlayIcon: "icon.png" + } + + Window { + height: 128 + width: 256 + maximumHeight: height + minimumHeight: height + maximumWidth: width + minimumWidth: width + visible: true + title: "Sheet of glass" + + WinDwmFeatures { + bottomGlassMargin: isCompositionEnabled ? -1 : 0 + } + } + + Rectangle { + id: contentRect + anchors.fill: parent + anchors.bottomMargin: dwmfeatures.bottomGlassMargin + + Rectangle { + id: rectColorization + color: WinDwmFeatures.colorizationColor + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + height: 32 + + Text { + text: "Colorization color" + anchors.centerIn: parent + font.pointSize: 12 + } + } + + Rectangle { + id: rectRealColorization + color: WinDwmFeatures.realColorizationColor + anchors.top: rectColorization.bottom + anchors.left: parent.left + anchors.right: parent.right + height: rectColorization.height + + Text { + text: "Real colorization color" + anchors.centerIn: parent + font.pointSize: 12 + } + } + + Rectangle { + anchors.topMargin: 2 + anchors.left: parent.left + anchors.right: parent.right + anchors.top: rectRealColorization.bottom + height: rectRealColorization.height + color: (function () { + if (!mouseComposition.containsMouse) + return "#D7D7D7"; + else if (mouseComposition.containsMouse && !mouseComposition.pressedButtons) + return "#D7E0E7"; + else + return "#EEEEF7" + })() + + Text { + anchors.centerIn: parent + text: "DWM composition is " + (WinDwmFeatures.isCompositionEnabled ? "enabled" : "disabled") + font.pointSize: 12 + } + + MouseArea { + id: mouseComposition + anchors.fill: parent + hoverEnabled: true + onClicked: WinDwmFeatures.isCompositionEnabled = !WinDwmFeatures.isCompositionEnabled + } + } + } + + Rectangle { + id: transparentBottom + color: WinDwmFeatures.isCompositionEnabled ? "transparent" : "#EEE" + height: dwmfeatures.bottomGlassMargin + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + + Text { + id: textOnGlass + anchors.centerIn: parent + text: "Text on glass" + (WinDwmFeatures.isCompositionEnabled ? "" : " (potentially)") + font.pointSize: 12 + } + } +} diff --git a/examples/winextras/quickdwm/quickdwm.qmlproject b/examples/winextras/quickdwm/quickdwm.qmlproject new file mode 100644 index 0000000..20a7c55 --- /dev/null +++ b/examples/winextras/quickdwm/quickdwm.qmlproject @@ -0,0 +1,15 @@ +import QmlProject 1.1 + +Project { + mainFile: "quickdwm.qml" + + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } +} |