Holes
Holes
This is a script that will move a panel to the opposite of the desktop, to give the illusion that it is a hole.
Check the video to better understanding. It is difficult to understand I know, but the fact is that both are panels, both are placed relative to the screen, not the desktop. That’s why it makes the illusion of holes, but they are panels!
It works also with zoom, and it move all the panels labeled “Hole” in the container.
It works also with panels inside folders, panels inside panels, etc. But to avoid misunderstanding the instructions says ‘desktop’ for the parent and ‘panels’ for the child panels it has.
Have in mind that you will be able to see only the main page of the panel, it’s recommended to check ‘use desktop size’ under layout on the panels settings. This will help you setting it.
Instructions:
– Copy/paste this script as a new one.
– Set it to run on the position change event of the desktop. Only the desktop, NOT the panels!
– Label the panels you want to as “Hole”, the others won’t work;
– [Optional] Disable the scrolling of the panels (Scroll direction: No scrolling at all)
– [Optional] Check the no scroll limit of the desktop, disable snap to pages and enable pinch to zoom and diagonal scrolling to move freely the panel.
These last two instructions are just optional, maybe you find an awesome way of using this script without them.
Pierre Hébert: This is the script that shows why you need to round the position, in case you want to test.
There is also another bad behavior that is shown when using this script. If you zoom the desktop, the panel will unzoom, but in edit mode the grid lines and the helpers are really really big, because the panel think it is really big (and it is, but not for the user). Not exactly a bug, but maybe you can think in this to give them an absolute size relative to the screen, not the container and their zoom.
——————————
//Vars
var desk =LL.getEvent().getContainer();
var scale = desk.getPositionScale();
var items=desk.getItems();
//for each item
for(var i=items.getLength()-1;i>=0;–i){
var panop = items.getAt(i);
if(panop.getLabel()!=”Hole” || panop.getType()!=”Panel”)continue;//only panels labeled “Hole”
var pan=panop.getContainer();
//Relative position
var posX= Math.round(panop.getPositionX())-desk.getPositionX();
var posY= Math.round(panop.getPositionY())-desk.getPositionY();
//The offset of the position if the panel has margins/borders/padding respectively
//if your pannels don’t have, you can comment this section to avoid extra operations
var prop=panop.getProperties().getBox(“i.box”); posX+=prop.getSize(“ml”)+prop.getSize(“bl”)+prop.getSize(“pl”); posY+=prop.getSize(“mt”)+prop.getSize(“bt”)+prop.getSize(“pt”);
//the final position
pan.setPosition( posX*scale , posY*scale ,1/scale,false);
}
]]>
< ![CDATA[
funny 😉
]]>
< ![CDATA[
Exactly funny and you are the Best
]]>
< ![CDATA[
Well, let’s just say I have good ideas 😉
]]>
< ![CDATA[
Im alway suprised at your creative idea, WOW~.
]]>
< ![CDATA[
problem… panel wallpaper doesnt perform as in the video. instead it shrinks/expands.
]]>
< ![CDATA[
also i cant just shrink 1 panel while leaving the others alone.
]]>
< ![CDATA[
Curtis Sylvester Jr. Did you label the panel ‘Hole’? Is the script set to run in the position change event of the desktop that contains the panel? (This is important)
Of course you can’t shrink only one panel! You are zooming the whole desktop ;)
]]>
< ![CDATA[
lol yes i did all that. in your video it looked like you were manipulating only one panel even though it looked like there were 2 or 3. but how did you get the panel to close on its wallpaper as opposed to shrinking it?
]]>
< ![CDATA[
The video start with one panel covering all the screen, then I unzoom to show it is a panel.
Why the content of the panel is not shrinked? The power of scripting 😉 the script is moving the panel
Oh, and there are two panels. The one with android pictures and the other with an item. At the end of the video it is shown how I can move both.
]]>
< ![CDATA[
ah i see. the one panel had its own background, no?
]]>
< ![CDATA[
no that was the object haha oops looked like a wallpaper
]]>
< ![CDATA[
The three android pictures? They are just icons
Yes XD, sorry if you get confused.
]]>
< ![CDATA[
the one inside the 1st panel you were playing with. looked like a wallpaper inside the panel and that the panel was closing on it but i tried to do that and it just shrunk the background hehe
]]>
< ![CDATA[
This is bad ass ! Now to think up a way to make use of it 🙂
]]>
< ![CDATA[
it really is
]]>
< ![CDATA[
Chris Chastain lol, I needed to search the meaning of that sentence. I only knew one definition! Now I know it has two different meanings 😉
]]>
< ![CDATA[
what are the meanings TrianguloY
]]>
< ![CDATA[
Well, I needed to search on Spanish forums. One is bad, the other is good. Let’s hope they were right!
]]>
< ![CDATA[
well the bad one is like a slang term while the other refers to “……being awsome”
]]>
< ![CDATA[
TrianguloY, ha! I guess I forget sometimes that people would not be familiar with some “colloquialisms” (I bet I misspelled that). Much compliments to you, I assure you!
But I knew Curtis Sylvester Jr. would translate for me! 😉
]]>
< ![CDATA[
Chris Chastain and how did you know? :p
]]>
< ![CDATA[
lol too cheeky to say.. this script is THE SHIT. i may use it in a lockscreen idea: “peek” at series of dynamic widgets that represent the state of distinct desktop configurations , hover more than 3 seconds and there you are (∩_∩)
]]>