2 * Copyright (C) 2014-2015 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
29 property bool highlightShown: false
30 property real shadowOpacity: 1
32 property int windowWidth: application.session && application.session.surface ? application.session.surface.size.width : 0
33 property int windowHeight: application.session && application.session.surface ? application.session.surface.size.height : 0
48 target: applicationWindow
49 itemScale: Math.max(root.width / root.windowWidth, root.height / root.windowHeight)
64 source: "graphics/dropshadow2gu.sci"
65 opacity: root.shadowOpacity * .3
69 id: selectionHighlight
71 anchors.margins: -units.gu(1)
73 opacity: highlightShown ? 0.15 : 0
78 anchors { left: selectionHighlight.left; right: selectionHighlight.right; bottom: selectionHighlight.bottom; }
80 color: UbuntuColors.orange
81 visible: root.highlightShown
91 objectName: application ? "appWindow_" + application.appId : "appWindow_null"
92 anchors.top: parent.top
94 anchors.left: parent.left
95 width: root.windowWidth
96 height: root.windowHeight
101 property real itemScale: 1
104 origin.x: 0; origin.y: 0
105 xScale: applicationWindow.itemScale
106 yScale: applicationWindow.itemScale