2019-04-21 20:56:59 +10:00
|
|
|
import QtQuick 2.7
|
2019-05-03 04:20:21 +10:00
|
|
|
import QtQuick.Layouts 1.3
|
2019-04-29 05:18:36 +10:00
|
|
|
import "../Base"
|
2019-04-21 20:56:59 +10:00
|
|
|
|
2019-05-03 04:20:21 +10:00
|
|
|
Column {
|
|
|
|
id: roomCategoryDelegate
|
|
|
|
width: roomCategoriesList.width
|
2019-05-07 11:37:34 +10:00
|
|
|
|
|
|
|
property int normalHeight: childrenRect.height // avoid binding loop
|
|
|
|
|
|
|
|
height: roomList.model.count > 0 ? normalHeight : 0
|
|
|
|
visible: roomList.model.count > 0
|
2019-04-21 20:56:59 +10:00
|
|
|
|
2019-05-03 04:20:21 +10:00
|
|
|
property string roomListUserId: userId
|
|
|
|
property bool expanded: true
|
2019-04-21 20:56:59 +10:00
|
|
|
|
2019-05-03 04:20:21 +10:00
|
|
|
HRowLayout {
|
|
|
|
width: parent.width
|
2019-04-21 20:56:59 +10:00
|
|
|
|
2019-05-03 04:20:21 +10:00
|
|
|
HLabel {
|
|
|
|
id: roomCategoryLabel
|
|
|
|
text: name
|
|
|
|
font.weight: Font.DemiBold
|
|
|
|
elide: Text.ElideRight
|
|
|
|
maximumLineCount: 1
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
2019-05-07 10:37:41 +10:00
|
|
|
ExpandButton {
|
|
|
|
expandableItem: roomCategoryDelegate
|
2019-05-17 05:53:17 +10:00
|
|
|
iconDimension: 12
|
2019-05-03 04:20:21 +10:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RoomList {
|
|
|
|
id: roomList
|
|
|
|
interactive: false // no scrolling
|
|
|
|
visible: height > 0
|
|
|
|
width: roomCategoriesList.width - accountList.Layout.leftMargin
|
|
|
|
height: childrenRect.height * (roomCategoryDelegate.expanded ? 1 : 0)
|
|
|
|
clip: heightAnimation.running
|
|
|
|
|
|
|
|
userId: roomListUserId
|
|
|
|
category: name
|
|
|
|
|
|
|
|
Behavior on height {
|
2019-05-15 05:15:10 +10:00
|
|
|
NumberAnimation {
|
|
|
|
id: heightAnimation
|
|
|
|
duration: HStyle.animationDuration
|
|
|
|
}
|
2019-05-03 04:20:21 +10:00
|
|
|
}
|
|
|
|
}
|
2019-04-21 20:56:59 +10:00
|
|
|
}
|