Changeset View
Changeset View
Standalone View
Standalone View
src/data/contents/ui/gallery/InlineMessagesGallery.qml
Show All 17 Lines | |||||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.7 | 21 | import QtQuick 2.7 | ||
22 | import QtQuick.Layouts 1.2 | 22 | import QtQuick.Layouts 1.2 | ||
23 | import QtQuick.Controls 2.0 as Controls | 23 | import QtQuick.Controls 2.0 as Controls | ||
24 | import org.kde.kirigami 2.4 as Kirigami | 24 | import org.kde.kirigami 2.4 as Kirigami | ||
25 | 25 | | |||
26 | import "components" | ||||
27 | | ||||
26 | Kirigami.ScrollablePage { | 28 | Kirigami.ScrollablePage { | ||
27 | id: page | 29 | id: page | ||
28 | 30 | | |||
29 | title: qsTr("Inline Messages") | 31 | title: qsTr("Inline Messages") | ||
30 | 32 | | |||
31 | actions.main: Kirigami.Action { | 33 | actions.main: Kirigami.Action { | ||
32 | iconName: "documentinfo" | 34 | iconName: "documentinfo" | ||
33 | text: qsTr("Info") | 35 | text: qsTr("Info") | ||
34 | checkable: true | 36 | checkable: true | ||
35 | onCheckedChanged: sheet.sheetOpen = checked; | 37 | onCheckedChanged: sheet.sheetOpen = checked; | ||
36 | shortcut: "Alt+I" | 38 | shortcut: "Alt+I" | ||
37 | } | 39 | } | ||
38 | 40 | | |||
39 | Kirigami.OverlaySheet { | 41 | | ||
40 | id: sheet | 42 | //Close the drawer with the back button | ||
41 | onSheetOpenChanged: page.actions.main.checked = sheetOpen | 43 | onBackRequested: { | ||
42 | header: RowLayout { | 44 | if (sheet.sheetOpen) { | ||
43 | Kirigami.Heading { | 45 | event.accepted = true; | ||
44 | Layout.fillWidth: true | 46 | sheet.close(); | ||
45 | text: qsTr("Inline Messages") | | |||
46 | } | | |||
47 | Controls.ToolButton { | | |||
48 | text: qsTr("HIG...") | | |||
49 | enabled: false | | |||
50 | onClicked: Qt.openUrlExternally("") | | |||
51 | } | | |||
52 | Controls.ToolButton { | | |||
53 | text: qsTr("Source code...") | | |||
54 | onClicked: Qt.openUrlExternally("https://cgit.kde.org/kirigami.git/tree/examples/gallerydata/contents/ui/gallery/InlineMessagesGallery.qml") | | |||
55 | } | 47 | } | ||
56 | } | 48 | } | ||
57 | 49 | | |||
58 | Controls.Label { | 50 | InfoSheet { | ||
59 | property int implicitWidth: Kirigami.Units.gridUnit * 25 | 51 | id: sheet | ||
60 | wrapMode: Text.WordWrap | 52 | | ||
61 | text: qsTr("Inline messages allow you to show various types of messages placed the same layout as content they relate to, instead of showing a message in an overlay. They are invisible by default and need to be explicitly set visible to be revealed.") | 53 | page: page | ||
62 | } | 54 | component: "InlineMessagesGallery" | ||
63 | } | 55 | } | ||
64 | 56 | | |||
65 | ColumnLayout { | 57 | ColumnLayout { | ||
66 | spacing: Kirigami.Units.largeSpacing | 58 | spacing: Kirigami.Units.largeSpacing | ||
67 | 59 | | |||
68 | Kirigami.InlineMessage { | 60 | Kirigami.InlineMessage { | ||
69 | Layout.fillWidth: true | 61 | Layout.fillWidth: true | ||
70 | 62 | | |||
▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines |