on 551c708 help sign in
91 lines 2.4 kB history raw
1/*
2 * Copyright 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 Lesser 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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Olivier Tilloy <olivier.tilloy@canonical.com>
19 */
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23import Unity.Indicators 0.1 as Indicators
25Indicators.BaseMenuItem {
26 id: groupedMessage
28 property alias title: __title.text
29 property alias count: label.text
30 property string appIcon: "qrc:/indicators/artwork/messaging/default_app.svg"
32 signal activateApp()
33 signal dismiss()
35 implicitHeight: units.gu(10)
37 Row {
38 anchors.fill: parent
39 anchors.margins: units.gu(2)
40 spacing: units.gu(4)
42 UbuntuShape {
43 height: units.gu(6)
44 width: units.gu(6)
45 image: Image {
46 source: groupedMessage.appIcon
47 fillMode: Image.PreserveAspectFit
48 }
49 }
51 Label {
52 id: __title
53 anchors.verticalCenter: parent.verticalCenter
54 color: "#e8e1d0"
55 font.weight: Font.DemiBold
56 fontSize: "medium"
57 }
59 Label {
60 id: label
61 anchors.verticalCenter: parent.verticalCenter
62 width: parent.width - x
63 horizontalAlignment: Text.AlignRight
64 color: "#e8e1d0"
65 font.weight: Font.DemiBold
66 fontSize: "medium"
67 text: "0"
68 }
69 }
71 Indicators.HLine {
72 anchors.top: parent.top
73 color: "#403b37"
74 }
76 Indicators.HLine {
77 anchors.bottom: parent.bottom
78 color: "#060606"
79 }
81 MouseArea {
82 anchors.fill: parent
83 onClicked: {
84 groupedMessage.activateApp();
85 }
86 }
88 onItemRemoved: {
89 groupedMessage.dismiss();
90 }