2import QtQuick.Controls.Suru 2.2
3import Lomiri.Components 1.3
4import Dekko.Components 1.0
5import Dekko.Lomiri.Constants 1.0
9 default property alias content: content.data
10 property alias iconName: ai.name
11 property alias text: l.text
12 property alias countText: countLable.text
13 property int maxHeight
14 readonly property int expandedHeight: internalHeight > maxHeight ? maxHeight : internalHeight
15 readonly property int internalHeight: header.height + content.height
16 readonly property int collapsedHeight: expandingPanel.visible ? header.height : 0
17 readonly property bool expanded: state === "expanded"
18 color: Suru.backgroundColor
22 acceptedButtons: Qt.LeftButton | Qt.RightButton
23 onClicked: mouse.accepted =
true
24 onWheel: wheel.accepted =
true
43 onClicked: d.isExpanded = !d.isExpanded
47 height:
Style.defaultIconSize
51 leftMargin:
Style.defaultSpacing
52 verticalCenter: parent.verticalCenter
60 leftMargin:
Style.smallSpacing
61 verticalCenter: parent.verticalCenter
63 text: qsTr(
"Attachments")
70 leftMargin:
Style.smallSpacing
71 verticalCenter: parent.verticalCenter
73 visible: countLable.text
75 aspect: LomiriShape.Flat
76 color: Suru.secondaryBackgroundColor
78 width: countLable.width < height ? height : countLable.width +
Style.smallSpacing
81 anchors.margins: units.gu(0.5)
82 anchors.centerIn: parent
92 rightMargin:
Style.defaultSpacing
93 verticalCenter: parent.verticalCenter
95 color: LomiriColors.ash
96 rotation: expandingPanel.expanded ? 180 : 0
97 height:
Style.defaultSpacing; width: height
98 state: expandingPanel.expanded ?
"rotated" :
"normal"
102 PropertyChanges { target: icon; rotation: 180 }
106 PropertyChanges { target: icon; rotation: 0 }
109 transitions: Transition {
111 duration: LomiriAnimation.FastDuration
112 direction: icon.state ===
"normal" ? RotationAnimation.Clockwise : RotationAnimation.Counterclockwise
122 bottom: parent.bottom
126 contentHeight: content.height
140 property bool isExpanded:
false
144 LomiriNumberAnimation{}
147 state: d.isExpanded ?
"expanded" :
"collapsed"
152 target: expandingPanel
153 height: collapsedHeight
159 target: expandingPanel
160 height: expandedHeight