From 5562def4352dac419535a986115f42637be30e4e Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Thu, 3 Dec 2020 11:25:29 +0100 Subject: [PATCH] Make the right sidebar automatically visible on large screen Fix: #106 --- qml/main.qml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qml/main.qml b/qml/main.qml index 8e6325db0..07e66803a 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -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")