~macslow/unity8/fix-1475678

« back to all changes in this revision

Viewing changes to Panel/SearchIndicator.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.Components 0.1
 
19
 
 
20
Item {
 
21
    id: search
 
22
 
 
23
    width: units.gu(9)
 
24
    height: units.gu(3)
 
25
 
 
26
    property string headerText: "Search"
 
27
 
 
28
    signal clicked
 
29
 
 
30
    // eater
 
31
    MouseArea {
 
32
        anchors.fill: parent
 
33
        onClicked: search.clicked()
 
34
    }
 
35
 
 
36
    Item {
 
37
        id: container
 
38
        objectName: "container"
 
39
 
 
40
        width: parent.width
 
41
        height: parent.height
 
42
 
 
43
        Behavior on opacity {NumberAnimation {}}
 
44
        Behavior on y {NumberAnimation {duration: 300; easing.type: Easing.OutCubic}}
 
45
 
 
46
        Image {
 
47
            id: icon
 
48
            source: "graphics/search.png"
 
49
            anchors.verticalCenter: parent.verticalCenter
 
50
            anchors.left: parent.left
 
51
            anchors.leftMargin: units.gu(1)
 
52
        }
 
53
 
 
54
        Label {
 
55
            text: search.headerText
 
56
            color: Qt.rgba(0.8, 0.8, 0.8, 1.0)
 
57
            fontSize: "small"
 
58
            font.capitalization: Font.AllUppercase
 
59
            anchors.left: icon.right
 
60
            anchors.leftMargin: units.gu(1)
 
61
            anchors.verticalCenter: parent.verticalCenter
 
62
        }
 
63
    }
 
64
 
 
65
    states: [
 
66
        State {
 
67
            name: "visible"
 
68
            PropertyChanges {
 
69
                target: container
 
70
                y: 0
 
71
                opacity: 1
 
72
            }
 
73
        },
 
74
        State {
 
75
            name: "hiddenUp"
 
76
            PropertyChanges {
 
77
                target: container
 
78
                y: -height
 
79
                opacity: 0
 
80
            }
 
81
        }
 
82
    ]
 
83
}