CURA-4870 Use the visible property instead of a Qt5.10 existing 'opened'

property.
This is needed to avoid a crashing for those that are using 5.10 running from
source.
This commit is contained in:
Diego Prado Gesto 2018-03-14 16:53:51 +01:00
parent 2fdd51fc23
commit e6c5bd28b2

View file

@ -16,7 +16,7 @@ Item
function switchPopupState() function switchPopupState()
{ {
popup.opened ? popup.close() : popup.open() popup.visible ? popup.close() : popup.open()
} }
SyncButton SyncButton
@ -28,15 +28,14 @@ Item
Popup Popup
{ {
// TODO Change once updating to Qt5.10 - This property is already in 5.10 but is manually implemented until upgrade // TODO Change once updating to Qt5.10 - The 'opened' property is in 5.10 but the behavior is now implemented with the visible property
property bool opened: false
id: popup id: popup
clip: true clip: true
closePolicy: Popup.CloseOnPressOutsideParent closePolicy: Popup.CloseOnPressOutsideParent
y: configurationSelector.height - UM.Theme.getSize("default_lining").height y: configurationSelector.height - UM.Theme.getSize("default_lining").height
x: configurationSelector.width - width x: configurationSelector.width - width
width: panelWidth width: panelWidth
visible: opened visible: false
padding: UM.Theme.getSize("default_lining").width padding: UM.Theme.getSize("default_lining").width
transformOrigin: Popup.Top transformOrigin: Popup.Top
contentItem: ConfigurationListView contentItem: ConfigurationListView
@ -60,7 +59,7 @@ Item
// This applies a default NumberAnimation to any changes a state change makes to x or y properties // This applies a default NumberAnimation to any changes a state change makes to x or y properties
NumberAnimation { property: "visible"; duration: 75; } NumberAnimation { property: "visible"; duration: 75; }
} }
onClosed: opened = false onClosed: visible = false
onOpened: opened = true onOpened: visible = true
} }
} }