From 619369e1487082d4be433e3bbfecf288de9ef7bd Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Mon, 8 Aug 2022 13:56:16 -0600 Subject: [PATCH] Add hackaround for Qt bug to all non-horizontally-scrollable scrollviews https://bugreports.qt.io/browse/QTBUG-83890 has been open for years with a patch that's been stalled for years. There's no indication that it's going to be fixed anytime soon, and it generates bug reports for us. Let's add the typical hackaround for all non-horizontally-scrollable scrollviews. BUG: 457584 --- imports/NeoChat/Component/ChatBox/ChatBar.qml | 3 +++ imports/NeoChat/Component/ChatBox/CompletionMenu.qml | 1 + imports/NeoChat/Component/ChatBox/ReplyPane.qml | 4 ++++ imports/NeoChat/Menu/Timeline/MessageSourceSheet.qml | 4 ++++ imports/NeoChat/Panel/RoomDrawer.qml | 3 +++ imports/NeoChat/Settings/SonnetConfigPage.qml | 8 ++++++++ 6 files changed, 23 insertions(+) diff --git a/imports/NeoChat/Component/ChatBox/ChatBar.qml b/imports/NeoChat/Component/ChatBox/ChatBar.qml index f2a56988d..0523ace7e 100644 --- a/imports/NeoChat/Component/ChatBox/ChatBar.qml +++ b/imports/NeoChat/Component/ChatBox/ChatBar.qml @@ -63,6 +63,9 @@ ToolBar { Layout.maximumHeight: fontMetrics.lineSpacing * 8 - fontMetrics.leading + inputField.topPadding + inputField.bottomPadding + // HACK: Hide unnecessary horizontal scrollbar (https://bugreports.qt.io/browse/QTBUG-83890) + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + FontMetrics { id: fontMetrics font: inputField.font diff --git a/imports/NeoChat/Component/ChatBox/CompletionMenu.qml b/imports/NeoChat/Component/ChatBox/CompletionMenu.qml index 18bdb7ebb..d5507b964 100644 --- a/imports/NeoChat/Component/ChatBox/CompletionMenu.qml +++ b/imports/NeoChat/Component/ChatBox/CompletionMenu.qml @@ -47,6 +47,7 @@ Popup { implicitHeight: Math.min(completionListView.contentHeight, Kirigami.Units.gridUnit * 10) contentItem: ScrollView { + // HACK: Hide unnecessary horizontal scrollbar (https://bugreports.qt.io/browse/QTBUG-83890) ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ListView { id: completionListView diff --git a/imports/NeoChat/Component/ChatBox/ReplyPane.qml b/imports/NeoChat/Component/ChatBox/ReplyPane.qml index 36c7731f4..2e72d622f 100644 --- a/imports/NeoChat/Component/ChatBox/ReplyPane.qml +++ b/imports/NeoChat/Component/ChatBox/ReplyPane.qml @@ -71,6 +71,10 @@ Loader { Layout.alignment: Qt.AlignLeft | Qt.AlignTop Layout.fillWidth: true Layout.maximumHeight: fontMetrics.lineSpacing * 8 - fontMetrics.leading + + // HACK: Hide unnecessary horizontal scrollbar (https://bugreports.qt.io/browse/QTBUG-83890) + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + TextArea { id: textArea leftPadding: 0 diff --git a/imports/NeoChat/Menu/Timeline/MessageSourceSheet.qml b/imports/NeoChat/Menu/Timeline/MessageSourceSheet.qml index bf0048fc6..400d01023 100644 --- a/imports/NeoChat/Menu/Timeline/MessageSourceSheet.qml +++ b/imports/NeoChat/Menu/Timeline/MessageSourceSheet.qml @@ -22,6 +22,10 @@ Kirigami.Page { ScrollView { anchors.fill: parent contentWidth: availableWidth + + // HACK: Hide unnecessary horizontal scrollbar (https://bugreports.qt.io/browse/QTBUG-83890) + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + TextArea { id: sourceTextArea text: sourceText diff --git a/imports/NeoChat/Panel/RoomDrawer.qml b/imports/NeoChat/Panel/RoomDrawer.qml index 6a4821f9f..b43510f56 100644 --- a/imports/NeoChat/Panel/RoomDrawer.qml +++ b/imports/NeoChat/Panel/RoomDrawer.qml @@ -217,6 +217,9 @@ Kirigami.OverlayDrawer { Layout.fillWidth: true Layout.fillHeight: true + // HACK: Hide unnecessary horizontal scrollbar (https://bugreports.qt.io/browse/QTBUG-83890) + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + ListView { id: userListView clip: true diff --git a/imports/NeoChat/Settings/SonnetConfigPage.qml b/imports/NeoChat/Settings/SonnetConfigPage.qml index 255f82421..a01d43c3e 100644 --- a/imports/NeoChat/Settings/SonnetConfigPage.qml +++ b/imports/NeoChat/Settings/SonnetConfigPage.qml @@ -190,6 +190,10 @@ Kirigami.Page { Layout.fillHeight: true enabled: autodetectLanguageCheckbox.checked Component.onCompleted: background.visible = wideMode + + // HACK: Hide unnecessary horizontal scrollbar (https://bugreports.qt.io/browse/QTBUG-83890) + QQC2.ScrollBar.horizontal.policy: QQC2.ScrollBar.AlwaysOff + ListView { clip: true model: settings.dictionaryModel @@ -254,6 +258,10 @@ Kirigami.Page { } QQC2.ScrollView { anchors.fill: parent + + // HACK: Hide unnecessary horizontal scrollbar (https://bugreports.qt.io/browse/QTBUG-83890) + QQC2.ScrollBar.horizontal.policy: QQC2.ScrollBar.AlwaysOff + ListView { model: settings.currentIgnoreList delegate: Kirigami.BasicListItem {