2
* This file is part of unity-2d
4
* Copyright 2010-2011 Canonical Ltd.
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; version 3.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
25
4
property alias icon: icon.source
26
5
property alias label: label.text
27
property alias iconSourceSize: icon.sourceSize
29
Accessible.name: label.text
43
width: sourceSize.width
44
height: sourceSize.height
46
anchors.horizontalCenter: parent.horizontalCenter
47
13
anchors.top: parent.top
14
anchors.left: parent.left
15
anchors.leftMargin: -1
49
19
fillMode: Image.PreserveAspectFit
20
sourceSize.width: width
21
sourceSize.height: height
52
24
opacity: status == Image.Ready ? 1 : 0
53
25
Behavior on opacity {NumberAnimation {duration: 200; easing.type: Easing.InOutQuad}}
60
state: ( parent.state == "selected" || parent.state == "hovered" ) ? "expanded" : ""
31
color: parent.state == "pressed" ? "#444444" : "#ffffff"
32
elide: Text.ElideMiddle
61
33
horizontalAlignment: Text.AlignHCenter
62
anchors.top: icon.bottom
34
anchors.bottom: parent.bottom
63
35
anchors.right: parent.right
64
36
anchors.left: parent.left
37
anchors.bottomMargin: 3
66
38
anchors.rightMargin: 5
67
39
anchors.leftMargin: 7
40
font.underline: parent.activeFocus