Add soft animation to the entire popup and not only in the background.

This prevents the content to show before the background.

Contributes to CURA-5786.
This commit is contained in:
Diego Prado Gesto 2018-11-11 13:17:59 +01:00
parent f65b1f8fbc
commit 8a63a79896

View File

@ -7,16 +7,12 @@ import QtQuick.Controls 2.1
import UM 1.1 as UM import UM 1.1 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Button UM.RecolorImage
{ {
id: widget id: widget
implicitHeight: UM.Theme.getSize("section_icon").height //implicitHeight: UM.Theme.getSize("section_icon").height
implicitWidth: UM.Theme.getSize("section_icon").width //implicitWidth: UM.Theme.getSize("section_icon").width
background: UM.RecolorImage
{
id: moreInformationIcon
source: UM.Theme.getIcon("info") source: UM.Theme.getIcon("info")
width: UM.Theme.getSize("section_icon").width width: UM.Theme.getSize("section_icon").width
@ -25,10 +21,15 @@ Button
sourceSize.width: width sourceSize.width: width
sourceSize.height: height sourceSize.height: height
color: widget.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("text_medium") color: popup.opened ? UM.Theme.getColor("primary") : UM.Theme.getColor("text_medium")
}
onClicked: popup.opened ? popup.close() : popup.open() MouseArea
{
anchors.fill: parent
hoverEnabled: true
onEntered: popup.open()
onExited: popup.close()
}
Popup Popup
{ {
@ -39,6 +40,9 @@ Button
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
opacity: opened ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } }
contentItem: PrintJobInformation contentItem: PrintJobInformation
{ {
id: printJobInformation id: printJobInformation
@ -47,8 +51,6 @@ Button
background: UM.PointingRectangle background: UM.PointingRectangle
{ {
opacity: visible ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } }
color: UM.Theme.getColor("tool_panel_background") color: UM.Theme.getColor("tool_panel_background")
borderColor: UM.Theme.getColor("lining") borderColor: UM.Theme.getColor("lining")
borderWidth: UM.Theme.getSize("default_lining").width borderWidth: UM.Theme.getSize("default_lining").width