correctly emit appletRemoved
applet remove animation At the moment is possible only to animate the disappearance of the background, the applet is immediately deleted. how could be possible to animate the applet as well? (the graphic object should get to live more than Applet* and AppletScript* themselves)
This commit is contained in:
parent
44b92bec42
commit
a139247403
@ -534,7 +534,7 @@ void Containment::addApplet(Applet *applet, const QPointF &pos)
|
||||
|
||||
connect(applet, SIGNAL(configNeedsSaving()), this, SIGNAL(configNeedsSaving()));
|
||||
connect(applet, SIGNAL(releaseVisualFocus()), this, SIGNAL(releaseVisualFocus()));
|
||||
connect(applet, SIGNAL(appletDeleted(Plasma::Applet*)), this, SLOT(appletDestroyed(Plasma::Applet*)));
|
||||
connect(applet, SIGNAL(appletDeleted(Plasma::Applet*)), this, SLOT(appletDeleted(Plasma::Applet*)));
|
||||
connect(applet, SIGNAL(statusChanged(Plasma::ItemStatus)), this, SLOT(checkStatus(Plasma::ItemStatus)));
|
||||
connect(applet, SIGNAL(activate()), this, SIGNAL(activate()));
|
||||
|
||||
|
@ -172,6 +172,12 @@ void AppletPrivate::cleanUpAndDelete()
|
||||
|
||||
resetConfigurationObject();
|
||||
|
||||
if (isContainment) {
|
||||
// prematurely emit our destruction if we are a Containment,
|
||||
// giving Corona a chance to remove this Containment from its collection
|
||||
emit q->QObject::destroyed(q);
|
||||
}
|
||||
|
||||
q->deleteLater();
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,11 @@ Item {
|
||||
height: large + frame.margins.top + frame.margins.bottom
|
||||
|
||||
property alias applet: appletContainer.children
|
||||
onAppletChanged: {
|
||||
if (appletContainer.children.length == 0) {
|
||||
killAnim.running = true
|
||||
}
|
||||
}
|
||||
|
||||
property int small: 90
|
||||
property int large: 400
|
||||
@ -102,6 +107,16 @@ Item {
|
||||
running: visible
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
SequentialAnimation {
|
||||
id: killAnim
|
||||
NumberAnimation {
|
||||
target: frame
|
||||
properties: "scale"
|
||||
to: 0
|
||||
duration: 250
|
||||
}
|
||||
ScriptAction { script: frame.destroy()}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user