Skip to content

Commit

Permalink
[qml][settings] Add PanelItem for Accordion of settings
Browse files Browse the repository at this point in the history
  • Loading branch information
stdevMac committed Aug 21, 2019
1 parent 5ea7a90 commit 2ef64f1
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
Empty file added src/ui/Delegates/Accordion.qml
Empty file.
54 changes: 54 additions & 0 deletions src/ui/Delegates/PanelItem.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import QtQuick 2.7
import QtQuick.Layouts 1.2
import QtQuick.Controls.Material 2.12

Column {
id: root
property string title: "Accordion"
default property alias item: ld.sourceComponent
Rectangle {
width: columnSettings.width
height: 40
color: Material.color(Material.Blue)
MouseArea {
anchors.fill: parent
onClicked: info.show = !info.show
}
Text {
anchors.fill: parent
anchors.margins: 10
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: root.title
}
Text {
anchors{
right: parent.right
top: parent.top
bottom: parent.bottom
margins: 10
}
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: "^"
rotation: info.show ? 0 : "180"
}

}
Rectangle {
id: info
width: 200
height: show ? ld.height : 0
property bool show : false
// color: generalStackView.color // TODO Set proper color
clip: true
Loader {
id: ld
y: info.height - height
anchors.horizontalCenter: info.horizontalCenter
}
Behavior on height {
NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
}
}
}
Empty file.
Empty file.

0 comments on commit 2ef64f1

Please sign in to comment.