Make the right sidebar automatically visible on large screen

Fix: #106
This commit is contained in:
Carl Schwan
2020-12-03 11:25:29 +01:00
parent 21cd37c21e
commit 5562def435

View File

@@ -18,7 +18,11 @@ import NeoChat.Page 1.0
Kirigami.ApplicationWindow {
id: root
property var currentRoom: null
property int columnWidth: Kirigami.Units.gridUnit * 13
wideScreen: width > columnWidth * 5
Connections {
target: root.quitAction
@@ -113,14 +117,20 @@ Kirigami.ApplicationWindow {
contextDrawer: RoomDrawer {
id: contextDrawer
contentItem.implicitWidth: columnWidth
edge: Qt.application.layoutDirection == Qt.RightToLeft ? Qt.LeftEdge : Qt.RightEdge
modal: !root.wideScreen
onEnabledChanged: drawerOpen = enabled && !modal
onModalChanged: drawerOpen = !modal
enabled: roomManager.hasOpenRoom
room: roomManager.currentRoom
handleVisible: enabled && pageStack.layers.depth < 2
}
globalDrawer: Kirigami.GlobalDrawer {
isMenu: true
property bool hasLayer
contentItem.implicitWidth: columnWidth
isMenu: true
actions: [
Kirigami.Action {
text: i18n("Explore rooms")