summaryrefslogtreecommitdiff
path: root/controls/Placeholder.qml
diff options
context:
space:
mode:
Diffstat (limited to 'controls/Placeholder.qml')
-rw-r--r--controls/Placeholder.qml66
1 files changed, 66 insertions, 0 deletions
diff --git a/controls/Placeholder.qml b/controls/Placeholder.qml
new file mode 100644
index 0000000..f1e7996
--- /dev/null
+++ b/controls/Placeholder.qml
@@ -0,0 +1,66 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Michael Spencer <sonrisesoftware@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
7 *
8 * This Source Code Form is subject to the terms of the Mozilla Public
9 * License, v. 2.0. If a copy of the MPL was not distributed with this
10 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 *
12 * $END_LICENSE$
13 */
14
15import QtQuick 2.2
16import QtQuick.Layouts 1.0
17import QtQuick.Controls 2.0
18import QtQuick.Controls.Material 2.0
19import Fluid.Controls 1.0
20
21/*!
22 \qmltype Placeholder
23 \inqmlmodule Fluid.Controls
24 \ingroup fluidcontrols
25
26 \brief Placeholder.
27*/
28Item {
29 property alias iconName: icon.name
30 property alias iconSource: icon.source
31 property alias text: textLabel.text
32 property alias subText: subTextLabel.text
33
34 ColumnLayout {
35 anchors.centerIn: parent
36
37 width: parent.width - 2 * Units.mediumSpacing
38
39 Icon {
40 id: icon
41 size: 96
42
43 Layout.alignment: Qt.AlignHCenter
44 }
45
46 Label {
47 id: textLabel
48 font: FluidStyle.titleFont
49 color: Material.secondaryTextColor
50 horizontalAlignment: Qt.AlignHCenter
51
52 Layout.fillWidth: true
53 }
54
55 Label {
56 id: subTextLabel
57 font: FluidStyle.subheadingFont
58 color: Material.secondaryTextColor
59 horizontalAlignment: Qt.AlignHCenter
60 wrapMode: Text.Wrap
61 visible: text !== ""
62
63 Layout.fillWidth: true
64 }
65 }
66}