Kodi Community Forum

Full Version: label <scroll> problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a list that is controlled by a hidden button for movement and as such is never focused, so in order for the labels in the focused layout to scroll I use a label with <scroll> set to true like so:

Code:
<control type="label">
  <left>48</left>
  <width>338</width>
  <top>572</top>
  <height>60</height>
  <align>center</align>
  <font>ItemLabelSecondary</font>
  <textcolor>TextBright</textcolor>
  <scrollsuffix>  •  </scrollsuffix>
  <scroll>true</scroll>
  <label>$INFO[ListItem.label]</label>
</control>

Something weird I've just noticed is that the label scrolls from start to end exactly 3 times then stops and will never scroll again, even if I change to the next list item and then back again. The only way to get it to scroll again is to back out of the window and open it again. I'm using Kodi 18.8

Is this a bug or is there some control tag I'm missing to set the number of repeats for scrolling?
Sorry, I didn't quite explain the problem right. My issue isn't that the label only scrolls 3 times, I was aware that they only scroll 3 times, I wasn't aware it was a bug though. 

The issue is that in a normal list that has focus the label of the focused item scrolls 3 times then stops, but then if you move focus to the next item in the list and then back to the previous item you get 3 more scrolls again and so on. However when controlling a list using a hidden button and control.move you get the initial 3 scrolls but then moving to the next item and back again doesn't reset the scrolling so you don't get another 3.
Probably only resets when a Focus animation would normally trigger.

You could try bouncing focus to the list to do the movement instead

e.g.
xml:

<control type="button" id="1234">
<onleft>SetProperty(1234Move,Left)</onleft>
<onleft>SetFocus(5678)</onleft>
[...]
</control>
<control type="list" id="5678">
<onfocus condition="String.IsEqual(Window.Property(1234Move),Left)">Action(Left)</onfocus>
<onfocus>AlarmClock(refocus,SetFocus(1234),00:00,silent)</onfocus>
[...]
</control>

Might also be possible to skip the window prop part and use Control.Move instead but also do the focus bounce. e.g.
xml:

<control type="button" id="1234">
<onleft>Control.Move(5678,-1)</onleft>
<onleft>SetFocus(5678)</onleft>
[...]
</control>
<control type="list" id="5678">
<onfocus>SetFocus(1234)</onfocus>
[...]
</control>