| 1 |
import QtQuick 2.4 |
| 2 |
import Lomiri.Components 1.3 |
| 3 |
|
| 4 |
/* |
| 5 |
Component which displays an empty state (approved by design). It offers an |
| 6 |
icon, title and subtitle to describe the empty state. |
| 7 |
*/ |
| 8 |
|
| 9 |
Item { |
| 10 |
id: emptyState |
| 11 |
|
| 12 |
// Public APIs |
| 13 |
property alias iconName: emptyIcon.name |
| 14 |
property alias iconSource: emptyIcon.source |
| 15 |
property alias iconColor: emptyIcon.color |
| 16 |
property alias title: emptyLabel.text |
| 17 |
property alias subTitle: emptySublabel.text |
| 18 |
|
| 19 |
height: childrenRect.height |
| 20 |
|
| 21 |
Icon { |
| 22 |
id: emptyIcon |
| 23 |
anchors.horizontalCenter: parent.horizontalCenter |
| 24 |
height: units.gu(10) |
| 25 |
width: height |
| 26 |
color: "#BBBBBB" |
| 27 |
asynchronous: true |
| 28 |
} |
| 29 |
|
| 30 |
Label { |
| 31 |
id: emptyLabel |
| 32 |
anchors.top: emptyIcon.bottom |
| 33 |
anchors.topMargin: units.gu(5) |
| 34 |
anchors.horizontalCenter: parent.horizontalCenter |
| 35 |
fontSize: "large" |
| 36 |
font.bold: true |
| 37 |
} |
| 38 |
|
| 39 |
Label { |
| 40 |
id: emptySublabel |
| 41 |
anchors.top: emptyLabel.bottom |
| 42 |
anchors.horizontalCenter: parent.horizontalCenter |
| 43 |
horizontalAlignment: Text.AlignHCenter |
| 44 |
} |
| 45 |
} |