Room.qml 1.05 KB
Newer Older
Black Hat's avatar
Black Hat committed
1 2
import QtQuick 2.10
import QtQuick.Controls 2.3
Black Hat's avatar
Black Hat committed
3
import QtQuick.Layouts 1.3
Black Hat's avatar
Black Hat committed
4 5 6 7 8 9 10
import Matrique 0.1

import "qrc:/qml/form"

Page {
    property alias controller: roomListModel.controller

11 12
    id: page

Black Hat's avatar
Black Hat committed
13 14 15 16
    RoomListModel {
        id: roomListModel
    }

Black Hat's avatar
Black Hat committed
17 18 19 20 21 22 23 24 25
    RowLayout {
        anchors.fill: parent
        spacing: 0

        ListForm {
            id: roomListForm

            Layout.fillHeight: true
            Layout.preferredWidth:  {
Black Hat's avatar
Black Hat committed
26 27
                if (page.width > 560) {
                    return page.width * 0.4;
Black Hat's avatar
Black Hat committed
28 29 30
                } else {
                    return 80;
                }
31
            }
Black Hat's avatar
Black Hat committed
32
            Layout.maximumWidth: 360
Black Hat's avatar
Black Hat committed
33 34

            listModel: roomListModel
35 36 37 38

            onCurrentIndexChanged: {
                roomForm.setRoom(roomListModel.roomAt(currentIndex));
            }
39 40
        }

Black Hat's avatar
Black Hat committed
41 42
        RoomForm {
            id: roomForm
Black Hat's avatar
Black Hat committed
43

Black Hat's avatar
Black Hat committed
44 45
            Layout.fillWidth: true
            Layout.fillHeight: true
46

47 48

//            currentRoom: roomListForm.currentIndex != -1 ? roomListModel.roomAt(roomListForm.currentIndex) : null
Black Hat's avatar
Black Hat committed
49
        }
Black Hat's avatar
Black Hat committed
50 51
    }
}