2 * Copyright (C) 2017 Canonical Ltd.
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.
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.
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/>.
18import Lomiri.Components 1.3
22 implicitWidth: Math.max(iconShape.width, titleLabel.width)
23 implicitHeight: iconShape.height + titleLabel.height + labelMargin + iconMargin
24 property alias title: titleLabel.text
25 property alias iconSource: icon.source
27 property real iconHeight: (height - titleLabel.height) * 0.65
28 property real iconMargin: (height - titleLabel.height) * 0.25
29 property real labelMargin: (height - titleLabel.height) * 0.1
30 property int maxWidth: units.gu(10)
42 borderSource: "undefined"
43 aspect: LomiriShape.Flat
46 sourceSize.width: iconShape.width
47 sourceSize.height: iconShape.height
48 cache: false // see lpbug#1543290 why no cache
53 anchors.fill: iconShape
54 onClicked: root.clicked()
62 topMargin: labelMargin
67 elide: Label.ElideRight