From bd5ed0f46c1141a1b351708cdf680e6c122d38a1 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Sat, 17 Jun 2023 21:32:51 +0200 Subject: [PATCH] Fix toolbar of RoomList when using font size 11px We don't need to use a ToolBar for the titleDelegate since the titleDelegate is already included inside a toolbar. This work magically when using the default font size of 10px Noto Sans but breaks with 11px BUG: 467242 --- src/qml/Page/RoomList/ExploreComponent.qml | 61 ++++++++++------------ 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/src/qml/Page/RoomList/ExploreComponent.qml b/src/qml/Page/RoomList/ExploreComponent.qml index b04b9d56e..364632a94 100644 --- a/src/qml/Page/RoomList/ExploreComponent.qml +++ b/src/qml/Page/RoomList/ExploreComponent.qml @@ -9,7 +9,7 @@ import org.kde.kirigami 2.15 as Kirigami import org.kde.neochat 1.0 -QQC2.ToolBar { +RowLayout { id: root property var desiredWidth @@ -45,40 +45,37 @@ QQC2.ToolBar { } } - padding: 0 + Kirigami.SearchField { + Layout.topMargin: Kirigami.Units.smallSpacing + Layout.bottomMargin: Kirigami.Units.smallSpacing + Layout.fillWidth: true + Layout.preferredWidth: root.desiredWidth ? root.desiredWidth - menuButton.width - root.spacing : -1 + visible: !root.collapsed + onTextChanged: sortFilterRoomListModel.filterText = text + KeyNavigation.tab: listView + } - RowLayout { - id: row - Kirigami.SearchField { - Layout.topMargin: Kirigami.Units.smallSpacing - Layout.bottomMargin: Kirigami.Units.smallSpacing - Layout.fillWidth: true - Layout.preferredWidth: root.desiredWidth ? root.desiredWidth - menuButton.width - row.spacing : -1 - visible: !root.collapsed - onTextChanged: sortFilterRoomListModel.filterText = text - KeyNavigation.tab: listView - } - QQC2.ToolButton { - id: menuButton - display: QQC2.AbstractButton.IconOnly - checkable: true - action: Kirigami.Action { - text: i18n("Create rooms and chats") - icon.name: "irc-join-channel" - onTriggered: { - if (Kirigami.isMobile) { - let menu = mobileMenu.createObject(); - menu.open(); - } else { - let menu = desktopMenu.createObject(menuButton, {y: menuButton.height}); - menu.closed.connect(menuButton.toggle) - menu.open(); - } + QQC2.ToolButton { + id: menuButton + display: QQC2.AbstractButton.IconOnly + checkable: true + action: Kirigami.Action { + text: i18n("Create rooms and chats") + icon.name: "irc-join-channel" + onTriggered: { + if (Kirigami.isMobile) { + let menu = mobileMenu.createObject(); + menu.open(); + } else { + let menu = desktopMenu.createObject(menuButton, {y: menuButton.height}); + menu.closed.connect(menuButton.toggle) + menu.open(); } } - QQC2.ToolTip { - text: parent.text - } + } + + QQC2.ToolTip { + text: parent.text } }