(2019-07-05, 15:02)cartman.dos Wrote: (2019-07-05, 03:05)BiudreuN Wrote: (2019-07-05, 01:08)cartman.dos Wrote: Sure, glad to hear it worked. Now try transitioning to container.position instead of current item and about system.controlcurrentid you could leave that if control group of widgets has focus and also set property on focus in each widget container so it holds the current id/widget number so that you could use that to compare as fallback, this will be more stable.
Can write the code later if u want I'm writing from the phone so it's less convenient.
I find the use of "current item" more stable, since before I used "container.position" and it also count the title of the widget, and considering that I have thought of adding a scrollbar to the widgets, it would crash a little. With "current item" it gives me the exact item. Right now I have system.controlid comparing with the ID of the widgets, which I have placed them from lowest to highest number, and in that section it works very well, since in the menu are only the widgets. The problem appears when I open the dialog that acts as my menu (I have it that way since it keeps the wallpaper, description, etc ... of the content I had focused on) that makes them disappear. I was thinking about solutions, maybe when the menu is opened, as there will be no scrolling, at that moment it generates the opaque background that covers the rest of the widgets, or maybe I change the ID of the grouplist that I use for the menu buttons.
It's funny how a problem has been solved, creating a completely different one.
But I'm curious, how do you solve the issue of animations and the fade effect? Please, don't say voodoo.
Look maybe it's me having a brain-fart here but I'm having trouble understanding what's the new problem.
Quote:The problem appears when I open the dialog that acts as my menu that makes them disappear (?)
So I'm not clear on that one exactly. But my understanding is that losing focus on the widgets, since it is now on the dialog items, kills the fixed/fade animations?
A few things:
1) Having a menu as a dialog is very interesting, I'd very much like to see how that works. I have a huge issue with this one which I solved by doing bunch of ugly 'hacks'. I tried the path of menu as dialog but had focus issues and maybe gave up on the idea too soon.
2) If the issue is what I wrote above, then a fix could be to use container.position and a window prop as I suggested, because if your issue is losing focus on widgets, this cannot be bypassed as long as you're using currentitem.
I also have a top label and widget, so this counts as 2 items.
What you need to do is use container.position by jumps of 2.
If you want to add a scrollbar you can still do it and just place it OUTSIDE of the widgets' grouplist. The gui knows which one to control using the <pagecontrol> tag and scroll bar with a corresponding id.
Then, assuming your widgets' grouplist holds items structured by label+container, then you could use this code instead of the current item one:
xml:
<animation effect="slide" end="0,-310" time="200" reversible="true" condition="Integer.IsGreater(Container(2100).Position,2)">Conditional</animation>
<animation effect="slide" end="0,-310" time="200" reversible="true" condition="Integer.IsGreater(Container(2100).Position,4)">Conditional</animation>
<animation effect="slide" end="0,-310" time="200" reversible="true" condition="Integer.IsGreater(Container(2100).Position,6)">Conditional</animation>
<animation effect="slide" end="0,-310" time="200" reversible="true" condition="Integer.IsGreater(Container(2100).Position,8)">Conditional</animation>
<animation effect="slide" end="0,-310" time="200" reversible="true" condition="Integer.IsGreater(Container(2100).Position,10)">Conditional</animation>
<animation effect="slide" end="0,-310" time="200" reversible="true" condition="Integer.IsGreater(Container(2100).Position,12)">Conditional</animation>
<animation effect="slide" end="0,-310" time="200" reversible="true" condition="Integer.IsGreater(Container(2100).Position,14)">Conditional</animation>
<animation effect="slide" end="0,-310" time="200" reversible="true" condition="Integer.IsGreater(Container(2100).Position,16)">Conditional</animation>
I'm having it so that each animation adds up, but it can be done as a total and just using one, in this case I don't think it matters that much I just find this way cleaner.
Inside each widget set property for current widget num:
xml:
<control type="fixedlist" id="$PARAM[list_id]">
...
<onfocus>SetProperty(CurrentVisibleWidget,$PARAM[visible_widget],Home)</onfocus>
...
</control>
Then use as fallback check in the fade animation:
xml:
<animation effect="fade" start="100" end="0" time="200" reversible="true" condition="[ControlGroup(2100).HasFocus() + Integer.IsGreater(System.CurrentControlID,$PARAM[visible_widget])] | Integer.IsGreater(Window(Home).Property(CurrentVisibleWidget),$PARAM[visible_widget])">Conditional</animation>
So whenever first condition is not satisfied then it fallback to window property which is saved regardless of focus/window.
3)
Quote:But I'm curious, how do you solve the issue of animations and the fade effect? Please, don't say voodoo.
If you meant do you solve=did you solve, then voodoo yeah. Otherwise my brain just farted again
Yes, I'm sorry if I've made some grammatical error, I'm Spanish and I was pretty tired XD
And it is an interesting idea that you propose, I will try it in a moment. Meanwhile I have been fiddling with an idea that occurred to me:
Since the movement and fade animation are fixed, and only give problems when they lose the focus (As can happen when activating the powermenu or my dialog window that acts as a menu), I have created a second layer over the widgets, a replica from the bottom, which makes the remaining pieces disappear, because when I activate the menu window I do not need them to move. It does not spoil the animation. The only problem right now is to find the mode that fits well with the fade animation and does not have a "flicker". At the moment I have this "<visible> System.HasVisibleModalDialog </ visible>", but I'll be doing tests, I have to test your idea too. The use of "set property" is beyond my understanding, I have found very little information about it and I would love to study it more, because it will be of much use for the menu later on.
Regarding the use of the dialog, I thought of trying to maintain the image and data of the film, but without having to have it focused. Not taking a method and everything I found was too complicated for something so simple, I decided to take the easy route and create a personalized dialog that would act as a menu. Simply active, I have a "slide" animation to appear, and that's it.
Another problem that I am having is that having one fanart on another, even with the "diffuse", according to that fanart you notice a small black cut. It is not annoying in itself, but I have to see how I can improve that.
And look, that's the code that activates the menu, it's in the grouplist of the widgets:
xml:
<control type="fixedlist" id="$PARAM[list_id]">
<left>0</left>
<top>0</top>
<animation effect="fade" start="100" end="0" time="200" reversible="true" condition="[Integer.IsGreater(System.CurrentControlID,$PARAM[list_id])]">Conditional</animation>
<visible>Integer.IsGreater(Container($PARAM[list_id]).NumItems,0) | Container($PARAM[list_id]).IsUpdating</visible>
<onleft>ActivateWindow(1110)</onleft>
<height>230</height>
<movement>0</movement>
<preloaditems>2</preloaditems>
<orientation>horizontal</orientation>
<scrolltime tween="cubic" easing="out">500</scrolltime>
I warn you, do not put an "onback" because then it will not let you access anything in the menu, but if you want to be activated with an "onback", it is better that you do this:
<previouswindow>1110</previouswindow> putting the ID of the menu that you have created, at the beginning of "home" or from where you want to activate the menu.
And then I simply create an animation for the window, and it works wonderfully, without lag, without errors, and keeps the background and the previous info, as if I did not lose focus.
xml:
<animation type="WindowOpen" reversible="true">
<effect type="slide" start="0" end="500" time="500" tween="cubic" easing="out" />
<effect type="fade" start="0" end="100" time="200" tween="cubic" easing="out" />
</animation>
<animation type="WindowClose" reversible="true">
<effect type="slide" start="500" end="0" time="500" tween="cubic" easing="out" />
<effect type="fade" start="100" end="0" delay="200" time="500" tween="cubic" easing="out" />
</animation>