Start working on the RoomDrawer port
This commit is contained in:
52
qml/main.qml
52
qml/main.qml
@@ -1,6 +1,6 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12 as Controls
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick 2.14
|
||||
import QtQuick.Controls 2.14 as Controls
|
||||
import QtQuick.Layouts 1.14
|
||||
|
||||
import org.kde.kirigami 2.12 as Kirigami
|
||||
|
||||
@@ -10,14 +10,35 @@ import Spectral.Panel 2.0
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
id: root
|
||||
property var currentRoom: null
|
||||
|
||||
globalDrawer: SpectralSidebar { }
|
||||
|
||||
contextDrawer: Kirigami.ContextDrawer {
|
||||
contextDrawer: RoomDrawer {
|
||||
id: contextDrawer
|
||||
enabled: roomList.enteredRoom !== null
|
||||
visible: enabled
|
||||
room: root.currentRoom
|
||||
}
|
||||
|
||||
pageStack.initialPage: roomListPanelComponent
|
||||
pageStack.initialPage: RoomListPanel {
|
||||
id: roomList
|
||||
roomListModel: spectralRoomListModel
|
||||
|
||||
Component.onCompleted: {
|
||||
applicationWindow().pageStack.push(roomPanelComponent, {"currentRoom": roomList.enteredRoom })
|
||||
}
|
||||
|
||||
onEnterRoom: {
|
||||
applicationWindow().pageStack.push(roomPanelComponent, {"currentRoom": room})
|
||||
root.currentRoom = room
|
||||
|
||||
}
|
||||
onLeaveRoom: {
|
||||
var stack = applicationWindow().pageStack;
|
||||
roomList.enteredRoom = null
|
||||
|
||||
stack.removePage(stack.lastItem)
|
||||
}
|
||||
}
|
||||
|
||||
Controller {
|
||||
id: spectralController
|
||||
@@ -46,21 +67,4 @@ Kirigami.ApplicationWindow {
|
||||
currentRoom: root.currentRoom
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: roomListPanelComponent
|
||||
|
||||
RoomListPanel {
|
||||
roomListModel: spectralRoomListModel
|
||||
|
||||
onEnterRoom: {
|
||||
applicationWindow().pageStack.push(roomPanelComponent, {"currentRoom": room})
|
||||
}
|
||||
onLeaveRoom: {
|
||||
var stack = applicationWindow().pageStack;
|
||||
|
||||
stack.removePage(stack.lastItem)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user