Files
neochat/src/rooms/ExploreComponent.qml
Joshua Goins 2bacbe7ac7 Improve the bottom mobile navigation bar
The previous set of actions seems like a random selection, how many
rooms is someone creating to be that important?

I have redone it to have way fewer actions, mostly notification and
settings.
2026-01-24 10:55:36 -05:00

61 lines
1.7 KiB
QML

// SPDX-FileCopyrightText: 2023 James Graham <james.h.graham@protonmail.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Controls as QQC2
import QtQuick.Layouts
import QtMultimedia
import org.kde.kirigami as Kirigami
import org.kde.neochat
RowLayout {
id: root
property bool collapsed: false
signal search
/**
* @brief Emitted when the text is changed in the search field.
*/
signal textChanged(string newText)
Kirigami.Heading {
Layout.fillWidth: true
// Roughly equivalent to what Kirigami does for its built-in headings
Layout.leftMargin: Kirigami.Units.gridUnit - Kirigami.Units.mediumSpacing
visible: !root.collapsed
text: {
if (Kirigami.Settings.isMobile) {
if (RoomManager.currentSpace === '') {
return i18nc("@title Home space", "Home");
} else if(RoomManager.currentSpace === 'DM') {
return i18nc("@title", "Direct Messages");
}
return root.connection.room(RoomManager.currentSpace).displayName;
}
return i18nc("@title List of rooms", "Rooms");
}
}
Item {
Layout.fillWidth: true
visible: root.collapsed
}
QQC2.ToolButton {
id: searchButton
display: QQC2.AbstractButton.IconOnly
onClicked: root.search();
icon.name: "search"
text: i18nc("@action", "Search Rooms")
QQC2.ToolTip.visible: hovered
QQC2.ToolTip.text: text
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
}
}