mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-22 06:03:57 -06:00
Add toggle function to expandable popup
Also ensures that the machineSelector closes the popup on making a choice CURA-5785
This commit is contained in:
parent
f0b8c1e611
commit
eca9820fc4
2 changed files with 25 additions and 3 deletions
|
@ -40,6 +40,19 @@ Item
|
|||
// Is the "drawer" open?
|
||||
readonly property alias expanded: popup.visible
|
||||
|
||||
function togglePopup()
|
||||
{
|
||||
if(popup.visible)
|
||||
{
|
||||
popup.close()
|
||||
}
|
||||
else
|
||||
{
|
||||
popup.open()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onPopupItemChanged:
|
||||
{
|
||||
// Since we want the size of the popup to be set by the size of the content,
|
||||
|
@ -100,7 +113,7 @@ Item
|
|||
{
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
onClicked: popup.visible ? popup.close() : popup.open()
|
||||
onClicked: togglePopup()
|
||||
hoverEnabled: true
|
||||
onEntered: background.color = headerHoverColor
|
||||
onExited: background.color = headerBackgroundColor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue