Changeset View
Changeset View
Standalone View
Standalone View
src/data/contents/ui/gallery/components/InfoSheet.qml
Show All 15 Lines | |||||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.6 | 20 | import QtQuick 2.6 | ||
21 | import QtQuick.Controls 2.0 as Controls | 21 | import QtQuick.Controls 2.0 as Controls | ||
22 | import QtQuick.Layouts 1.2 | 22 | import QtQuick.Layouts 1.2 | ||
23 | import org.kde.kirigami 2.4 as Kirigami | 23 | import org.kde.kirigami 2.4 as Kirigami | ||
24 | import Data 1.0 | ||||
24 | 25 | | |||
25 | Kirigami.OverlaySheet { | 26 | Kirigami.OverlaySheet { | ||
26 | id: root | 27 | id: root | ||
27 | property Kirigami.Page page | 28 | property Kirigami.Page page | ||
28 | property url higUrl | 29 | property url higUrl: infoData.higUrl | ||
29 | property url sourceUrl | 30 | property url sourceUrl: infoData.sourceUrl | ||
30 | property alias title: titleLabel.text | 31 | property alias title: titleLabel.text | ||
31 | property alias text: mainText.text | 32 | property alias text: mainText.text | ||
33 | property alias component: infoData.component | ||||
32 | 34 | | |||
33 | onSheetOpenChanged: page.actions.main.checked = sheetOpen | 35 | onSheetOpenChanged: page.actions.main.checked = sheetOpen | ||
34 | header: Kirigami.Heading { | 36 | header: Kirigami.Heading { | ||
35 | id: titleLabel | 37 | id: titleLabel | ||
38 | | ||||
39 | text: infoData.title | ||||
36 | Layout.fillWidth: true | 40 | Layout.fillWidth: true | ||
41 | | ||||
42 | InfoData { | ||||
43 | id: infoData | ||||
44 | } | ||||
37 | } | 45 | } | ||
38 | 46 | | |||
39 | footer: RowLayout { | 47 | footer: RowLayout { | ||
40 | Item { | 48 | Item { | ||
41 | Layout.fillWidth: true | 49 | Layout.fillWidth: true | ||
42 | } | 50 | } | ||
43 | Controls.ToolButton { | 51 | Controls.ToolButton { | ||
44 | text: qsTr("HIG...") | 52 | text: qsTr("HIG...") | ||
45 | enabled: higUrl != "" | 53 | enabled: higUrl != "" | ||
46 | onClicked: Qt.openUrlExternally(higUrl) | 54 | onClicked: Qt.openUrlExternally(higUrl) | ||
47 | } | 55 | } | ||
48 | Controls.ToolButton { | 56 | Controls.ToolButton { | ||
49 | text: qsTr("Source code...") | 57 | text: qsTr("Source code...") | ||
50 | enabled: sourceUrl != "" | 58 | enabled: sourceUrl != "" | ||
51 | onClicked: Qt.openUrlExternally(sourceUrl) | 59 | onClicked: Qt.openUrlExternally(sourceUrl) | ||
52 | } | 60 | } | ||
53 | } | 61 | } | ||
54 | 62 | | |||
55 | Controls.Label { | 63 | Controls.Label { | ||
56 | id: mainText | 64 | id: mainText | ||
65 | text: infoData.text | ||||
57 | property int implicitWidth: Kirigami.Units.gridUnit * 25 | 66 | property int implicitWidth: Kirigami.Units.gridUnit * 25 | ||
58 | wrapMode: Text.WordWrap | 67 | wrapMode: Text.WordWrap | ||
59 | } | 68 | } | ||
60 | } | 69 | } |