Commit b650e35a authored by Ronan Abhamon's avatar Ronan Abhamon

feat(Collapse): use coding conventions

parent c28b3c55
...@@ -33,7 +33,6 @@ lupdate_only{ ...@@ -33,7 +33,6 @@ lupdate_only{
ui/components/scrollBar/*.qml \ ui/components/scrollBar/*.qml \
ui/components/select/*.qml \ ui/components/select/*.qml \
ui/components/timeline/*.qml \ ui/components/timeline/*.qml \
ui/style/collapse/*.qml \
ui/views/*.qml \ ui/views/*.qml \
ui/views/mainWindow/*.qml ui/views/mainWindow/*.qml
} }
......
...@@ -3,16 +3,18 @@ import QtQuick 2.7 ...@@ -3,16 +3,18 @@ import QtQuick 2.7
import 'qrc:/ui/components/form' import 'qrc:/ui/components/form'
import 'qrc:/ui/style' import 'qrc:/ui/style'
// ===================================================================
// A simple component to build collapsed item.
// =================================================================== // ===================================================================
Item { Item {
property bool isCollapsed: false property bool _isCollapsed: false
signal collapsed (bool collapsed) signal collapsed (bool collapsed)
function collapse () { function collapse () {
isCollapsed = !isCollapsed _isCollapsed = !_isCollapsed
collapsed(isCollapsed) collapsed(_isCollapsed)
rotate.start() rotate.start()
} }
...@@ -32,9 +34,9 @@ Item { ...@@ -32,9 +34,9 @@ Item {
direction: RotationAnimation.Clockwise direction: RotationAnimation.Clockwise
duration: CollapseStyle.animationDuration duration: CollapseStyle.animationDuration
from: isCollapsed ? 0 : 180 from: _isCollapsed ? 0 : 180
property: 'rotation' property: 'rotation'
target: button 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