How to control Panel container scrolling
#1
hello,
i'm trying to imitate MCE skin for Kodi but ive run into an issue which i cant seem to solve.

I have a panel container (movie posters) that has 2 rows and spans from left to right edge of the screen (width=1280px).

When i scroll from left to the right, i scroll through the posters but panel container does not move. This is ok, but unfortunately panel only moves when im at the very edge of the screen on the last poster.

Is there any way to control when panel scrolls ?
Reply
#2
You mean a fixed selection position ?
[Skin] KOver - V1.1.0 Stable (Repo version)
[WIP] ReKOver - Skinning tool project

If I've been helpful or you like my work, hit "THANK USER" button ;) ...
Reply
#3
it's not possible with panel containers i think.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#4
(2015-05-14, 10:43)Jayz2K Wrote: You mean a fixed selection position ?


doesnt really need to be fixed position ( though if its possible then please let me know ), i just want to be able to scroll panel container before i get to its edge.

i have 2 rows and 10 columns visible at all times. as it is, panel will scroll only when i get to the 11th column... meaning user doesnt really see the next item until actually scrolling to it.

in MCE focus position is restricted to positions 1-8 , meaning you always see at least two columns next to the focused item (until you reach the end of course ).
Reply
#5
(2015-05-14, 11:24)ronie Wrote: it's not possible with panel containers i think.

if its not possible with panel, is there any way to have 2 rows of posters with any other container ?
Reply
#6
You can sort of fake it. Check from 2:46.



Here's how I coded it - http://pastebin.com/cgeWmAaX
Reply
#7
Yes, thought about the animation trick. Otherwise if you want to keep it simple, you can set the container height 1 pixel less than the total height of listitems, here 10xlistitem height - 1. This will result the focused position always be the last-1. But only next one will be visible and when you reach the last one, it will result in a listitem space empty at the end. Less aesthetical than using animations but easier if the design is fine with this.
[Skin] KOver - V1.1.0 Stable (Repo version)
[WIP] ReKOver - Skinning tool project

If I've been helpful or you like my work, hit "THANK USER" button ;) ...
Reply
#8
(2015-05-14, 12:56)Hitcher Wrote: You can sort of fake it. Check from 2:46.



Here's how I coded it - http://pastebin.com/cgeWmAaX

Thanks but I did try this approach few days ago and it didnt work in my case
Reason for that ( i think ) is that looking through your code is that you do know maximum amount of columns you will have.

I do not ... i know i will always have 2 rows but amount of columns depends on amount of movies (posters).

Or am i wrong ?
Reply
#9
Not shure about this but maby "Control.Move(id,offset)" could help. (+Animations)

didnt used it as far, so not shure if it would work.

The Idea would be to use 3 panels with the same content |[panel1][panel2][panel3]|

the Middle one is the one with focus and use <onleft>Control.Move(id-panel1,offset_x)</onleft> + <onleft>Control.Move(id-panel3,offset_x2)</onleft> (and slightly different for "onright") so the panels right and left shows the content, the panel in the middle didnt cover.

+ an animation which slides all panels to the left as soon as the the first Item of the panel gets focus.
<animation condition="Control(panel2).HasFocus(3) | Control(panel2).HasFocus(4)" effect="slide" .... >Conditional</animation>

+ an animation which slides all panels to the right as soon as the the last Item of the panel gets focus.
(this gonna be a bit tricky i guess: possible you'll have to count the items of the panel first in a label control "Container(id).NumItems" and get the label of it by "get.Label" to use it in the "HasFocus"

or maby better ckeck for "Container(id).ListItemNoWrap(offset).Property" to see when the panel3 dont have items. (and use this to animate all panels)

<animation condition="IsEmpty(Container(panel2).ListItemNoWrap(3).label)" effect="slide" .... >Conditional</animation>
<animation condition="IsEmpty(Container(panel2).ListItemNoWrap(5).label)" effect="slide" .... >Conditional</animation>

(would/shoul work also viseversa to do the animations for the "left-slide".)

that way (in theory) you would have something kinde similar to a fixedlist with given "movement" (done via animations)

mfG.

----------------

EDIT:

to make it a bit easyer to understand: the Idea:

Code:
<onload> --- setFocus(panel2) -- </onload>

<control type="group">
<animation condition="IsEmpty(Container(panel2).ListItemNoWrap(3).label)" effect="slide" ..(right).. >Conditional</animation>
<animation condition="IsEmpty(Container(panel2).ListItemNoWrap(5).label)" effect="slide" ..(right).. >Conditional</animation>
<animation condition="IsEmpty(Container(panel2).ListItemNoWrap(-3).label)" effect="slide" ..(left).. >Conditional</animation>
<animation condition="IsEmpty(Container(panel2).ListItemNoWrap(-5).label)" effect="slide" ..(left).. >Conditional</animation>
  <control type="panel" ID[panel1]
  <posx>10</posx>
  ...
  </control>
  <control type="panel" ID[panel2]
  <posx>500</posx>
  <onleft>Control.Move(id-panel1,offset_x)</onleft>
  <onleft>Control.Move(id-panel3,offset_x2)</onleft>
  ...
  </control>
  <control type="panel" ID[panel3]
  <posx>1500</posx>
  ...
  </control>
</control>
Reply
#10
@wally007
You can try to lower the <width> of the panel a few pixels so when you navigate to the right, before you rich the age, the panel will scroll because the <width> it will be some pixels smaller than it should be.

Cheers
Nessus
Reply
#11
Thanks guys. I've implemented the workaround of -1 pixel than sum of itemlayout width and it works a bit better.

I was hoping there is something like fixedlist but for panel or maybe a way to control a focus within container and restrict it to certain width/columns/rows. Lets hope discussions with fixed panel in different thread lead to new container in the future.

thanks again.
Reply

Logout Mark Read Team Forum Stats Members Help
How to control Panel container scrolling0