on e2c09dd help sign in
unity8/Panel/SearchIndicator.qml
81 lines 2.0 kB history raw
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 */
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import "../Components"
21Item {
22 id: search
24 width: units.gu(9)
25 height: units.gu(3)
27 property string headerText: i18n.tr("Search")
29 signal clicked
31 // eater
32 MouseArea {
33 anchors.fill: parent
34 onClicked: search.clicked()
35 }
37 Item {
38 id: container
39 objectName: "container"
41 width: parent.width
42 height: parent.height
44 Behavior on opacity { StandardAnimation {} }
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 }
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 }
65 states: [
66 State {
67 name: "visible"
68 PropertyChanges {
69 target: container
70 opacity: 1
71 }
72 },
73 State {
74 name: "hidden"
75 PropertyChanges {
76 target: container
77 opacity: 0
78 }
79 }
80 ]