moment/harmonyqml/UI.qml

38 lines
929 B
QML
Raw Normal View History

import QtQuick.Controls 1.4 as Controls1
2019-03-22 14:28:14 +11:00
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4
2019-03-26 09:29:46 +11:00
//https://doc.qt.io/qt-5/qml-qtquick-controls-splitview.html
Controls1.SplitView {
2019-03-22 14:28:14 +11:00
anchors.fill: parent
SidePane {
Layout.minimumWidth: 36
width: 200
2019-03-26 09:29:46 +11:00
}
2019-03-22 14:28:14 +11:00
StackView {
function show_page(componentName) {
pageStack.replace(componentName + ".qml")
}
function show_room(user_obj, room_obj) {
pageStack.replace(
"ChatPage.qml", { user: user_obj, room: room_obj }
)
2019-03-22 14:28:14 +11:00
}
id: "pageStack"
initialItem: ChatPage {
user: Backend.accountsModel.get(0)
room: Backend.roomsModel[Backend.accountsModel.get(0).user_id].get(0)
}
2019-03-22 14:28:14 +11:00
onCurrentItemChanged: currentItem.forceActiveFocus()
// Buggy
replaceExit: null
popExit: null
pushExit: null
}
}