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
This commit is contained in:
Carl Schwan
2023-06-17 21:32:51 +02:00
parent 529cfa8f7d
commit bd5ed0f46c

View File

@@ -9,7 +9,7 @@ import org.kde.kirigami 2.15 as Kirigami
import org.kde.neochat 1.0 import org.kde.neochat 1.0
QQC2.ToolBar { RowLayout {
id: root id: root
property var desiredWidth 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 { QQC2.ToolButton {
id: row id: menuButton
Kirigami.SearchField { display: QQC2.AbstractButton.IconOnly
Layout.topMargin: Kirigami.Units.smallSpacing checkable: true
Layout.bottomMargin: Kirigami.Units.smallSpacing action: Kirigami.Action {
Layout.fillWidth: true text: i18n("Create rooms and chats")
Layout.preferredWidth: root.desiredWidth ? root.desiredWidth - menuButton.width - row.spacing : -1 icon.name: "irc-join-channel"
visible: !root.collapsed onTriggered: {
onTextChanged: sortFilterRoomListModel.filterText = text if (Kirigami.isMobile) {
KeyNavigation.tab: listView let menu = mobileMenu.createObject();
} menu.open();
QQC2.ToolButton { } else {
id: menuButton let menu = desktopMenu.createObject(menuButton, {y: menuButton.height});
display: QQC2.AbstractButton.IconOnly menu.closed.connect(menuButton.toggle)
checkable: true menu.open();
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
} }
} }