Hide expand arrows when rooms are filtering
Any account with matching rooms is expanded until there is no more active filter.
This commit is contained in:
parent
c5d5768f2e
commit
bfbcc73c43
|
@ -8,9 +8,10 @@ Column {
|
||||||
spacing: theme.spacing / 2
|
spacing: theme.spacing / 2
|
||||||
|
|
||||||
opacity:
|
opacity:
|
||||||
paneToolBar.roomFilter && roomList.model.count < 1 ? 0.35 : 1
|
paneToolBar.roomFilter && roomList.model.count < 1 ? 0.3 : 1
|
||||||
Behavior on opacity { HNumberAnimation {} }
|
Behavior on opacity { HNumberAnimation {} }
|
||||||
|
|
||||||
|
property bool forceExpand: paneToolBar.roomFilter && roomList.model.count
|
||||||
property bool expanded: true
|
property bool expanded: true
|
||||||
readonly property var modelItem: model
|
readonly property var modelItem: model
|
||||||
|
|
||||||
|
@ -59,6 +60,7 @@ Column {
|
||||||
|
|
||||||
ExpandButton {
|
ExpandButton {
|
||||||
id: expandButton
|
id: expandButton
|
||||||
|
opacity: paneToolBar.roomFilter ? 0 : 1
|
||||||
expandableItem: accountDelegate
|
expandableItem: accountDelegate
|
||||||
Layout.preferredHeight: row.height
|
Layout.preferredHeight: row.height
|
||||||
}
|
}
|
||||||
|
@ -69,7 +71,9 @@ Column {
|
||||||
id: roomList
|
id: roomList
|
||||||
visible: height > 0
|
visible: height > 0
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: childrenRect.height * (accountDelegate.expanded ? 1 : 0)
|
height:
|
||||||
|
childrenRect.height *
|
||||||
|
(accountDelegate.expanded || accountDelegate.forceExpand ? 1 : 0)
|
||||||
clip: heightAnimation.running
|
clip: heightAnimation.running
|
||||||
|
|
||||||
userId: modelItem.user_id
|
userId: modelItem.user_id
|
||||||
|
|
|
@ -10,10 +10,14 @@ HUIButton {
|
||||||
backgroundColor: "transparent"
|
backgroundColor: "transparent"
|
||||||
onClicked: expandableItem.expanded = ! expandableItem.expanded
|
onClicked: expandableItem.expanded = ! expandableItem.expanded
|
||||||
|
|
||||||
|
visible: opacity > 0
|
||||||
|
opacity: expandableItem.forceExpand ? 0 : 1
|
||||||
|
Behavior on opacity { HNumberAnimation {} }
|
||||||
|
|
||||||
iconTransform: Rotation {
|
iconTransform: Rotation {
|
||||||
origin.x: expandButton.iconDimension / 2
|
origin.x: expandButton.iconDimension / 2
|
||||||
origin.y: expandButton.iconDimension / 2
|
origin.y: expandButton.iconDimension / 2
|
||||||
angle: expandableItem.expanded ? 90 : 180
|
angle: expandableItem.expanded || expandableItem.forceExpand ? 90 : 180
|
||||||
Behavior on angle { HNumberAnimation {} }
|
Behavior on angle { HNumberAnimation {} }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user