From cef5d11130e73e4585c8339252df53a51d186ab0 Mon Sep 17 00:00:00 2001 From: James Graham Date: Thu, 12 May 2022 19:16:40 +0000 Subject: [PATCH] Fix scrollbar behaviour in Room List In the Room List there is always a gap left for the scrollbar in normal mode whether it is visible or not. This commit makes the gap disappear when the scrollbar is not visible by using the verticalscrollbarpolicy of the scrollpage. Fixes network/neochat#518 --- imports/NeoChat/Page/RoomListPage.qml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/imports/NeoChat/Page/RoomListPage.qml b/imports/NeoChat/Page/RoomListPage.qml index 4e7d513f2..396c47c1e 100644 --- a/imports/NeoChat/Page/RoomListPage.qml +++ b/imports/NeoChat/Page/RoomListPage.qml @@ -22,21 +22,10 @@ Kirigami.ScrollablePage { property var enteredRoom property bool collapsedMode: Config.roomListPageWidth === applicationWindow().collapsedPageWidth && applicationWindow().shouldUseSidebars + verticalScrollBarPolicy: collapsedMode ? QQC2.ScrollBar.AlwaysOff : QQC2.ScrollBar.AsNeeded + onCollapsedModeChanged: if (collapsedMode) { sortFilterRoomListModel.filterText = ""; - if (page.contentItem && page.contentItem.flickableItem && page.contentItem.flickableItem.QQC2.ScrollBar.vertical) { - page.contentItem.flickableItem.QQC2.ScrollBar.vertical.visible = false; - } - } else { - page.contentItem.flickableItem.QQC2.ScrollBar.vertical.visible = true; - } - - // HACK: the scrollbar is created with a 0 timer, so we need to set the visible flag - // after it has been created - Timer { - running: true - interval: 200 - onTriggered: page.contentItem.flickableItem.QQC2.ScrollBar.vertical.visible = !collapsedMode; } Connections {