Commit fe236ca4 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(Collapse): fix broken function

parent b650e35a
......@@ -35,6 +35,7 @@
<file>ui/scripts/utils.js</file>
<file>ui/style/qmldir</file>
<file>ui/style/collapse/Style.qml</file>
<file>ui/style/Constants.qml</file>
<file>ui/views/newCall.qml</file>
<file>ui/views/manageAccounts.qml</file>
<file>ui/views/mainWindow/mainWindow.qml</file>
......
......@@ -8,16 +8,20 @@ import 'qrc:/ui/style'
// ===================================================================
Item {
property bool _isCollapsed: false
property bool _collapsed: false
signal collapsed (bool collapsed)
function collapse () {
_isCollapsed = !_isCollapsed
collapsed(_isCollapsed)
_collapsed = !_collapsed
collapsed(_collapsed)
rotate.start()
}
function isCollapsed () {
return _collapsed
}
ActionButton {
id: button
......@@ -34,9 +38,9 @@ Item {
direction: RotationAnimation.Clockwise
duration: CollapseStyle.animationDuration
from: _isCollapsed ? 0 : 180
from: _collapsed ? 0 : 180
property: 'rotation'
target: button
to: _isCollapsed ? 180 : 0
to: _collapsed ? 180 : 0
}
}
import QtQuick 2.0
import 'qrc:/ui/style'
// ===================================================================
// Helper to handle button click outside a component.
// ===================================================================
......@@ -67,7 +69,7 @@ Item {
MouseArea {
anchors.fill: parent
propagateComposedEvents: true
z: 9999999999 // Ugly! But it's necessary in some cases...
z: Constants.zMax
onPressed: {
// Propagate event.
......
module Style
singleton CollapseStyle 1.0 collapse/Style.qml
\ No newline at end of file
singleton Constants 1.0 Constants.qml
singleton CollapseStyle 1.0 collapse/Style.qml
......@@ -37,7 +37,7 @@ ApplicationWindow {
Layout.fillHeight: parent.height
id: collapse
onCollapsed: mainWindowStates.state = collapsed
onCollapsed: mainWindowStates.state = isCollapsed()
? 'collapsed'
: ''
}
......@@ -70,7 +70,7 @@ ApplicationWindow {
onMenuClosed: content.enabled = true
onMenuOpened: {
if (!collapse.isCollapsed) {
if (!collapse.isCollapsed()) {
collapse.collapse()
}
content.enabled = false
......
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