~gerboland/unity/8-refactor-wm-and-test

« back to all changes in this revision

Viewing changes to SideStage/SideStage.qml

  • Committer: Michał Sawicz
  • Date: 2013-06-05 22:03:08 UTC
  • Revision ID: michal.sawicz@canonical.com-20130605220308-yny8fv3futtr04fg
Inital unity8 commit.

Previous history can be found at https://code.launchpad.net/~unity-team/unity/phablet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2013 Canonical, Ltd.
 
3
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 */
 
16
 
 
17
import QtQuick 2.0
 
18
import Ubuntu.Application 0.1
 
19
import Ubuntu.Components 0.1
 
20
import "../Components"
 
21
 
 
22
Stage {
 
23
    id: stage
 
24
 
 
25
    type: ApplicationInfo.SideStage
 
26
    property real handleSizeCollapsed: units.gu(2.5)
 
27
    property real handleSizeExpanded: units.gu(4)
 
28
    property bool handleExpanded
 
29
 
 
30
    /* FIXME: workaround so that when a main stage app goes fullscreen
 
31
       the sidestage's top is not transparent. Proper fix would be to
 
32
       resize the side stage app.
 
33
    */
 
34
    Rectangle {
 
35
        id: backgroundBeneathPanel
 
36
        anchors {
 
37
            top: parent.top
 
38
            left: parent.left
 
39
            right: parent.right
 
40
        }
 
41
        height: shell.panelHeight
 
42
        color: background.color
 
43
        z: -1
 
44
    }
 
45
 
 
46
    Rectangle {
 
47
        id: background
 
48
        anchors.fill: parent
 
49
        color: "#2c2924"
 
50
        z: -1
 
51
        visible: stage.usingScreenshots
 
52
    }
 
53
 
 
54
    SidestageHandle {
 
55
        id: handle
 
56
        objectName: "sideStageHandle"
 
57
 
 
58
        anchors {
 
59
            top: parent.top
 
60
            bottom: parent.bottom
 
61
            left: parent.left
 
62
            leftMargin: -width
 
63
        }
 
64
        width: handleExpanded ? handleSizeExpanded : handleSizeCollapsed
 
65
        Behavior on width { NumberAnimation { easing.type: Easing.OutQuart} }
 
66
        z: -1
 
67
    }
 
68
}