Compare commits

...

1 Commits

Author SHA1 Message Date
Tobias Fella
c1a36de9a2 Port to bottom navbar 2021-10-14 21:46:33 +02:00
2 changed files with 74 additions and 71 deletions

View File

@@ -46,6 +46,11 @@ Kirigami.ScrollablePage {
}
}
actions.main: Kirigami.Action {
text: i18n("New room")
icon.name: "list-add"
}
function goToNextRoom() {
do {
listView.incrementCurrentIndex();
@@ -70,8 +75,7 @@ Kirigami.ScrollablePage {
Component {
id: searchField
Kirigami.SearchField {
Layout.topMargin: Kirigami.Units.smallSpacing
Layout.bottomMargin: Kirigami.Units.smallSpacing
Layout.margins: Kirigami.Units.smallSpacing
Layout.fillHeight: true
Layout.fillWidth: true
onTextChanged: sortFilterRoomListModel.filterText = text
@@ -271,6 +275,7 @@ Kirigami.ScrollablePage {
id: configButton
visible: roomListItem.hovered || Kirigami.Settings.isMobile
Accessible.name: i18n("Configure room")
flat: true
action: Kirigami.Action {
id: optionAction

View File

@@ -6,7 +6,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15 as QQC2
import QtQuick.Layouts 1.15
import org.kde.kirigami 2.15 as Kirigami
import org.kde.kirigami 2.19 as Kirigami
import org.kde.neochat 1.0
import NeoChat.Component 1.0
@@ -224,56 +224,6 @@ Kirigami.ApplicationWindow {
}
}
globalDrawer: Kirigami.GlobalDrawer {
property bool hasLayer
contentItem.implicitWidth: columnWidth
isMenu: true
actions: [
Kirigami.Action {
text: i18n("Explore rooms")
icon.name: "compass"
onTriggered: pushReplaceLayer("qrc:/imports/NeoChat/Page/JoinRoomPage.qml", {"connection": Controller.activeConnection})
enabled: pageStack.layers.currentItem.title !== i18n("Explore Rooms") && Controller.accountCount > 0
},
Kirigami.Action {
text: i18n("Start a Chat")
icon.name: "irc-join-channel"
onTriggered: pushReplaceLayer("qrc:/imports/NeoChat/Page/StartChatPage.qml", {"connection": Controller.activeConnection})
enabled: pageStack.layers.currentItem.title !== i18n("Start a Chat") && Controller.accountCount > 0
},
Kirigami.Action {
text: i18n("Create a Room")
icon.name: "irc-join-channel"
onTriggered: {
let dialog = createRoomDialog.createObject(root.overlay);
dialog.open();
}
shortcut: StandardKey.New
enabled: pageStack.layers.currentItem.title !== i18n("Start a Chat") && Controller.accountCount > 0
},
Kirigami.Action {
text: i18n("Settings")
icon.name: "settings-configure"
onTriggered: pushReplaceLayer("qrc:/imports/NeoChat/Page/SettingsPage.qml")
enabled: pageStack.layers.currentItem.title !== i18n("Settings")
shortcut: StandardKey.Preferences
},
Kirigami.Action {
text: i18n("Logout")
icon.name: "list-remove-user"
enabled: Controller.accountCount > 0
onTriggered: Controller.logout(Controller.activeConnection, true)
},
Kirigami.Action {
text: i18n("Quit")
icon.name: "gtk-quit"
shortcut: StandardKey.Quit
onTriggered: Qt.quit()
}
]
}
Component.onCompleted: Controller.setBlur(pageStack, Config.blur && !Config.compactLayout);
Connections {
target: Config
@@ -292,23 +242,6 @@ Kirigami.ApplicationWindow {
background: Rectangle {
color: Config.blur && !Config.compactLayout ? Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 1 - Config.transparency) : "transparent"
}
Component {
id: roomListComponent
RoomListPage {
id: roomList
Connections {
target: root.roomPage
function onSwitchRoomUp() {
roomList.goToNextRoom();
}
function onSwitchRoomDown() {
roomList.goToPreviousRoom();
}
}
}
}
Connections {
target: Controller
@@ -421,7 +354,7 @@ Kirigami.ApplicationWindow {
}
property Item hoverLinkIndicator: QQC2.Control {
parent: overlay.parent
parent: overlay.parent
property alias text: linkText.text
opacity: text.length > 0 ? 1 : 0
@@ -436,4 +369,69 @@ Kirigami.ApplicationWindow {
color: Kirigami.Theme.backgroundColor
}
}
Component {
id: settingsPageComponent
SettingsPage {}
}
Component {
id: roomListComponent
RoomListPage {
id: roomList
Connections {
target: root.roomPage
function onSwitchRoomUp() {
roomList.goToNextRoom();
}
function onSwitchRoomDown() {
roomList.goToPreviousRoom();
}
}
}
}
footer: Kirigami.NavigationTabBar {
actions: [
Kirigami.Action {
icon.name: "globe"
text: "Spaces"
checked: fooPage.visble
onTriggered: {
console.warn("foo")
}
},
Kirigami.Action {
icon.name: "dialog-messages"
text: "Rooms"
checked: fooPage.visble
onTriggered: {
while (pageStack.depth > 0) {
pageStack.pop();
}
pageStack.push(roomListComponent);
}
},
Kirigami.Action {
icon.name: "document-open-recent-symbolic"
text: "Recent"
checked: fooPage.visble
onTriggered: {
console.warn("foo")
}
},
Kirigami.Action {
icon.name: "settings-configure"
text: "Settings"
checked: fooPage.visble
onTriggered: {
while (pageStack.depth > 0) {
pageStack.pop();
}
pageStack.push(settingsPageComponent);
}
}
]
}
}