moment/harmonyqml/components/SidePane/RoomCategoryDelegate.qml
miruka 55e701c24d Improve sidePane expand toggle buttons
Animate them, use an icon that makes more sense, have a componant file
2019-05-06 20:37:41 -04:00

48 lines
1.1 KiB
QML

import QtQuick 2.7
import QtQuick.Layouts 1.3
import "../Base"
Column {
id: roomCategoryDelegate
width: roomCategoriesList.width
height: roomList.model.rowCount() > 0 ? childrenRect.height : 0
visible: roomList.model.rowCount() > 0
property string roomListUserId: userId
property bool expanded: true
HRowLayout {
width: parent.width
HLabel {
id: roomCategoryLabel
text: name
font.weight: Font.DemiBold
elide: Text.ElideRight
maximumLineCount: 1
Layout.fillWidth: true
}
ExpandButton {
expandableItem: roomCategoryDelegate
}
}
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 {
NumberAnimation { id: heightAnimation; duration: 100 }
}
}
}