Commit 87a1b861 authored by Marco Martin's avatar Marco Martin
Browse files

also top drawers

parent f19f50c6
......@@ -18,7 +18,7 @@
*/
import QtQuick 2.0
import QtQuick.Controls 2.0 as Controls
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.2
import org.kde.kirigami 2.5 as Kirigami
......@@ -64,29 +64,68 @@ Kirigami.ScrollablePage {
text: qsTr("A modal bottom drawer will span for the whole application window width and will darken the rest of the app. Clicking on a darkened will dismiss the drawer.")
}
Controls.Button {
Layout.alignment: Qt.AlignRight
text: qsTr("Close")
onClicked: modalBottomDrawer.close()
}
}
}
Kirigami.OverlayDrawer {
id: inlineBottomDrawer
edge: Qt.BottomEdge
modal: false
contentItem: ColumnLayout {
Controls.Label {
Layout.fillWidth: true
wrapMode: Text.WordWrap
text: qsTr("An inline bottom drawer...")
text: qsTr("An inline top drawer covers the whole application width but lets the uncovered pieces to still be interacted with.")
}
Controls.Button {
Layout.alignment: Qt.AlignRight
text: qsTr("Close")
onClicked: inlineBottomDrawer.close()
}
}
}
Kirigami.OverlayDrawer {
id: modalTopDrawer
edge: Qt.TopEdge
contentItem: ColumnLayout {
Controls.Label {
Layout.fillWidth: true
wrapMode: Text.WordWrap
text: qsTr("A modal top drawer will span for the whole application window width and will darken the rest of the app. Clicking on the darkened area will dismiss the drawer.")
}
Controls.Button {
Layout.alignment: Qt.AlignRight
text: qsTr("Close")
onClicked: modalTopDrawer.close()
}
}
}
Kirigami.OverlayDrawer {
id: inlineTopDrawer
edge: Qt.TopEdge
modal: false
contentItem: ColumnLayout {
Controls.Label {
Layout.fillWidth: true
wrapMode: Text.WordWrap
text: qsTr("An inline bottom drawer covers the whole application width but lets the uncovered pieces to still be interacted with.")
}
Controls.Button {
Layout.alignment: Qt.AlignRight
text: qsTr("Close")
onClicked: inlineTopDrawer.close()
}
}
}
ColumnLayout {
width: page.width
spacing: Kirigami.Units.smallSpacing
......@@ -101,5 +140,15 @@ Kirigami.ScrollablePage {
Layout.alignment: Qt.AlignHCenter
onClicked: inlineBottomDrawer.open()
}
Controls.Button {
text: qsTr("Modal Top Drawer")
Layout.alignment: Qt.AlignHCenter
onClicked: modalTopDrawer.open()
}
Controls.Button {
text: "Inline Top Drawer"
Layout.alignment: Qt.AlignHCenter
onClicked: inlineTopDrawer.open()
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment