Commit b650e35a authored by Ronan's avatar Ronan
Browse files

feat(Collapse): use coding conventions

parent c28b3c55
......@@ -33,7 +33,6 @@ lupdate_only{
ui/components/scrollBar/*.qml \
ui/components/select/*.qml \
ui/components/timeline/*.qml \
ui/style/collapse/*.qml \
ui/views/*.qml \
ui/views/mainWindow/*.qml
}
......
......@@ -3,16 +3,18 @@ import QtQuick 2.7
import 'qrc:/ui/components/form'
import 'qrc:/ui/style'
// ===================================================================
// A simple component to build collapsed item.
// ===================================================================
Item {
property bool isCollapsed: false
property bool _isCollapsed: false
signal collapsed (bool collapsed)
function collapse () {
isCollapsed = !isCollapsed
collapsed(isCollapsed)
_isCollapsed = !_isCollapsed
collapsed(_isCollapsed)
rotate.start()
}
......@@ -32,9 +34,9 @@ Item {
direction: RotationAnimation.Clockwise
duration: CollapseStyle.animationDuration
from: isCollapsed ? 0 : 180
from: _isCollapsed ? 0 : 180
property: 'rotation'
target: button
to: isCollapsed ? 180 : 0
to: _isCollapsed ? 180 : 0
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment