2 * Copyright (C) 2014-2016 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * Authors: Michael Zanetti <michael.zanetti@canonical.com>
20 import Ubuntu.Components 1.3
21 import Unity.Application 0.1
26 property alias window: applicationWindow
27 property alias application: applicationWindow.application
28 property alias surface: applicationWindow.surface
30 property bool highlightShown: false
31 property real shadowOpacity: 1
33 property int windowWidth: surface ? surface.size.width : 0
34 property int windowHeight: surface ? surface.size.height : 0
49 target: applicationWindow
50 itemScale: Math.max(root.width / root.windowWidth, root.height / root.windowHeight)
60 scale: highlightShown ? 1.025 : 1
62 UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
70 source: "graphics/dropshadow2gu.sci"
71 opacity: root.shadowOpacity * .3
75 id: selectionHighlight
77 anchors.margins: -units.gu(1)
79 opacity: highlightShown ? 0.55 : 0
84 anchors { left: selectionHighlight.left; right: selectionHighlight.right; bottom: selectionHighlight.bottom; }
86 color: theme.palette.normal.focus
87 visible: root.highlightShown
97 objectName: application ? "appWindow_" + application.appId : "appWindow_null"
98 anchors.top: parent.top
100 anchors.left: parent.left
101 width: root.windowWidth
102 height: root.windowHeight
107 property real itemScale: 1
110 origin.x: 0; origin.y: 0
111 xScale: applicationWindow.itemScale
112 yScale: applicationWindow.itemScale
121 opacity: root.highlightShown ? 0 : .1
122 Behavior on opacity {
123 UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }