Hi, I’m using TrianguloY script fadein found in another post.
Hi, I’m using TrianguloY script fadein found in another post. Works fine but when moving desktop the widget reappear, I don’t know why
Attached code and video
—————-
var e = LL.getEvent();
var d = e.getContainer();
var it=d.getItemById(0x000032);
var time=500;
var FPS=20;
var step=1000/FPS;
delta=255/(time*FPS/1000);
setTimeout(function(){fadein(it,255,time);},step);
//fade in
function fadein(it,alpha,time){
if(alpha<0){
return;
}
alpha-=delta;
it.getProperties().edit().setInteger(“i.alpha”,alpha).commit();
setTimeout(function(){fadein(it,alpha,time);},step);
}
]]>
< ![CDATA[
What do you have in the position change event of the desktop?
]]>
< ![CDATA[
Nothing.
BTW the clock is a zopper widget.
]]>
< ![CDATA[
Could you try with another zooper widget in another desktop to see if it happens the same? (Remember to change the id)
]]>
< ![CDATA[
TrianguloY fails too with a stock widget from zooper and anther desktop.
I just try changing alpha value but not fading with another script to 100 for example, and this maintain even when moving the desktop.
I’m going to try with another widget different than Zooper in order to test if this is specific for zooper o for widgets.
]]>
< ![CDATA[
fails too with a 1weather widget in the same way.
I tried too with a shorcut to an app and the same history, when moving the desktop the app shortcut reappear again.
]]>
< ![CDATA[
I can confirm the bug. However I don’t know why.
Calling Pierre Hébert to check if it is a bug in the launcher or the script have something wrong
]]>
< ![CDATA[
You need to add after “alpha-=delta;”
if(alpha<0) alpha=0;
Otherwise you will have a negative alpha value and unexpected results.
]]>
< ![CDATA[
Ah! >_<
My fault.
Use this little modified script with Pierre fix
———————
var e = LL.getEvent();
var d = e.getContainer();
var it= e.getItem();//change this with the original value
var time=500;
var FPS=20;
var step=1000/FPS;
delta=255/(time*FPS/1000);
setTimeout(function(){fadein(it,255,time);},step);
//fade in
function fadein(it,alpha,time){
alpha-=delta;
if(alpha<0) alpha=0;
it.getProperties().edit().setInteger(“i.alpha”,alpha).commit();
if(alpha>0)setTimeout(function(){fadein(it,alpha,time);},step);
}
]]>
< ![CDATA[
and now is working thanks TrianguloY and Pierre Hébert
]]>