~ubuntu-branches/ubuntu/maverick/plasma-mobile/maverick

« back to all changes in this revision

Viewing changes to shell/data/mobile-homescreen/UnlockScreen.qml

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Belem
  • Date: 2010-08-30 23:41:22 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100830234122-3q94e0vf1qfl4e2c
Tags: 0.0~svn20100830-0ubuntu1
* New svn snapshot, revision 1170070. (LP: #627205)
* Updated Standards-Version to 3.9.1.
* Updated the build-dep kdebase-workspace-dev to >= 4.5.
* Removed the patches kubuntu_02_enable_mobilesystray_build.diff and
  kubuntu_03_add_mobilesystray_to_all_desktops.diff since upstream
  already enables the systray build and it is by default on all
  desktops.
* Switch to dpkg-source 3.0 (quilt) format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright 2010 Alexis Menard <menard@kde.org>                         *
 
3
 *   Copyright 2010 Artur Duque de Souza <asouza@kde.org>                  *
 
4
 *   Copyright 2010 Marco Martin <notmart@gmail.com>                       *
 
5
 *                                                                         *
 
6
 *   This program is free software; you can redistribute it and/or modify  *
 
7
 *   it under the terms of the GNU General Public License as published by  *
 
8
 *   the Free Software Foundation; either version 2 of the License, or     *
 
9
 *   (at your option) any later version.                                   *
 
10
 *                                                                         *
 
11
 *   This program is distributed in the hope that it will be useful,       *
 
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
14
 *   GNU General Public License for more details.                          *
 
15
 *                                                                         *
 
16
 *   You should have received a copy of the GNU General Public License     *
 
17
 *   along with this program; if not, write to the                         *
 
18
 *   Free Software Foundation, Inc.,                                       *
 
19
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
 
20
 ***************************************************************************/
 
21
 
 
22
import Qt 4.7
 
23
 
 
24
Rectangle {
 
25
    id: unlockscreen;
 
26
    width: 800;
 
27
    height: 480;
 
28
 
 
29
    color: "gray";
 
30
    opacity: 0.3;
 
31
 
 
32
    Rectangle {
 
33
        id: dragwidget;
 
34
 
 
35
        y: unlockscreen.height/2 - height/2;
 
36
        x: unlockscreen.width/4;
 
37
        width: (unlockscreen.width/4) * 2;
 
38
        height: 50;
 
39
        radius: 8;
 
40
        opacity: 0.7;
 
41
        smooth: true;
 
42
        gradient: Gradient {
 
43
            GradientStop { position: 0.0; color: "black" }
 
44
            GradientStop { position: 1.0; color: "white" }
 
45
        }
 
46
 
 
47
        Rectangle {
 
48
            id: draghandle;
 
49
            state: "locked";
 
50
 
 
51
            x: 0;
 
52
            y: 0;
 
53
            width: 80;
 
54
            height: parent.height;
 
55
            radius: 8;
 
56
            opacity: 0.7;
 
57
            smooth: true;
 
58
            gradient: Gradient {
 
59
                GradientStop { position: 0.0; color: "white" }
 
60
                GradientStop { position: 1.0; color: "black" }
 
61
            }
 
62
 
 
63
            MouseArea {
 
64
                id: hintregion;
 
65
                anchors.fill: parent;
 
66
 
 
67
                drag.target: parent;
 
68
                drag.axis: "XAxis"
 
69
                drag.minimumX: 0;
 
70
                drag.maximumX: dragwidget.width-draghandle.width;
 
71
 
 
72
                onPressed: {
 
73
                    draghandle.state = 'dragging';
 
74
                }
 
75
 
 
76
                onReleased: {
 
77
                    if (draghandle.state != 'dragging')
 
78
                        return;
 
79
                    var target = dragwidget.width/2;
 
80
                    if (draghandle.x > target) {
 
81
                        draghandle.state = 'unlocked';
 
82
                    } else {
 
83
                        draghandle.state = 'locked';
 
84
                    }
 
85
                }
 
86
            }
 
87
 
 
88
 
 
89
            states: [
 
90
                State {
 
91
                    name: "locked";
 
92
                    PropertyChanges {
 
93
                        target: draghandle;
 
94
                        x: 0;
 
95
                    }
 
96
                },
 
97
                State {
 
98
                    name: "unlocked";
 
99
                    PropertyChanges {
 
100
                        target: draghandle;
 
101
                        x: dragwidget.width - draghandle.width;
 
102
                    }
 
103
                },
 
104
                State {
 
105
                    name: "dragging"
 
106
                }
 
107
            ]
 
108
 
 
109
            transitions: Transition {
 
110
                NumberAnimation { properties: "x"; easing.type: "InOutQuad"; duration: 200 }
 
111
            }
 
112
        }
 
113
    }
 
114
 
 
115
 
 
116
 
 
117
 
 
118
}