I’ve created a weather forecast panel on the left side of my screen as shown in the pictures.
I’ve created a weather forecast panel on the left side of my screen as shown in the pictures. The Dates are always showing and I can slide the weather onto the screen. The problem is, this leaves a large section of dead screen space on the right side of the calendar, under the panel, when the weather is not showing. Is there a way to dynamically change the layer of the panel? Maybe move it to the top layer when I slide it out and move it back when i slide it back?
P.S. This is still a work in progress so forgive me for the 2 random icons in the middle 🙂
]]>« Hey pierre how about adding dynamic calender and weather? (Previous Post)
(Next Post) Page Bookmark: Fade »
< ![CDATA[
I am not sure what dead space you’re referring to, but can’t you change the visibility instead of the layer?
]]>
< ![CDATA[
Bogdan Tautu I might be explaining myself poorly. Anything I place directly to the right of the calendar is beneath the panel that contains the calendar. I can’t interact with anything in that space. That’s what I mean by “Dead space”
As a disclaimer, I’ve only had LLX for about a week, so if there is a better way to do this, I’m all ears. How would changing the visibility work in this case?
]]>
< ![CDATA[
the panel that contains the calendar is not resized when you hide the weather?
]]>
< ![CDATA[
No. I didn’t know that was an option. It’s just a panel with a scroll.
]]>
< ![CDATA[
How would I do that? I’m having trouble finding a way myself
]]>
< ![CDATA[
on the snap event of the stop point (if you don’t have one, add one) that triggers when you hide the weather, run a script to resize (and scroll the content if necessary)
]]>
< ![CDATA[
I guess there is a better way to do that.
Perhaps I can adapt my folder script to work with panels…
]]>
< ![CDATA[
Before I start, let me say, I know next to nothing about JavaScript. I took a couple programming classes but they were C++ and Visual Basic.
From what I’m reading, I’ll need to detach the panel from the grid (not as part of the script). Then the script will have to increase the panel size when I swipe the weather on to the screen and decrease the size when I swipe it back off the screen. This will be using the item.set size()?
What unit does setSize use? And how would I tell it which item to apply the change to?
]]>
< ![CDATA[
1. I don’t think it’s necessary to detach from grid if the grid is the same size as the calendar
2. if you detach then yes; but it will require resolution specific coordinates or some math. if you use grid then item.setCell(left, top, right, bottom); and you have 2 different values for the right position
]]>
< ![CDATA[
If you want to start scripting (JavaScript is not really difficult and I guess you will adapt soon) the best is to see the pinned post if you didn’t saw it before. It has a link to the scripting reference that will tell you exactly what you need and what you can do.
Then you can also go to the ‘scripts’ section in this community, or directly to the wiki page, to see examples.
Answering your questions: it uses pixels and you need to take the item and put it before with a dot, for example this will set the size to 100,100 to an item named ‘Item’ (if any) in the current desktop:
LL.getCurrentDesktop().getItemByLabel(“Item”).setSize(100,100);
]]>
< ![CDATA[
Bogdan Tautu Grid same size as calendar? Does this mean my desktop and panel have the same cell size? Because they do
]]>
< ![CDATA[
Second question: I’m assuming item.setCell() is absolute. Where is 0?
]]>
< ![CDATA[
You need to set the position/size of the panel in desktop space, panel grid size does not matter.
Coordinate 0, 0 is always in the top left (where the home icon is in edit mode)
If you want to have width of 1 cell you set left to X and right to X+1. In your case X is 0.
]]>
< ![CDATA[
LL.getCurrentDesktop().getItemByLabel(“CalendarPanel”).setCell(0,7,5,18)
I added this script to a stop point in my panel and reduced my panel to 2 cells wide. When I dragged the panel out, it changed the width to 5 cells. I copied the same script, replacing the 5 with a 2, into another stop point. That one doesn’t work. It never cuts the width back down to 2
]]>
< ![CDATA[
perhaps both stop points trigger? Or one of them does not. Try to place alert s in the script to see which one executes. Try and tweak the stop point options.
]]>
< ![CDATA[
I’m getting there. Not they’re both working but it’s kind of hit and miss. They’re not being very consistent
]]>
< ![CDATA[
Set stop points to snap.
Try and tweak the stop points.
]]>
< ![CDATA[
Just remembered you can change the layer of the item using setItemZIndex
]]>
< ![CDATA[
I’ll try that out too. See if that has any less lag than the Panel Resizing. It works, there is just a tiny bit of lag before it takes effect.
Thanks Bogdan Tautu and TrianguloY
]]>