Kodi Community Forum
Container of static items default focus on second item? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Container of static items default focus on second item? (/showthread.php?tid=344899)



Container of static items default focus on second item? - cartman.dos - 2019-06-24

Hey,
I've got a container set with static items as its content.
For some weird reason Kodi insists on focusing the second item in the container as default.
I can't use 'defaultfocus' attribute because it also consists of dynamic items and it doesn't seem to work in conjunction (if dynamic items are not added as content it still puts focus on second item).

To clarify, when testing this container with just changing content to plugin based/xsp based, its default focus is on the first item, so i'm not sure how an excerpt of the specific code can be helpful here, it seems more of a global issue...

Ideas?


RE: Container of static items default focus on second item? - cscott1 - 2019-06-26

No idea but was hoping you were working on this. Your Categories widget is my only widget that doesn't have the slim list on the left on startup. Just thought I would help out by bumping this to the top where someone who might know will see it.


RE: Container of static items default focus on second item? - mardukL - 2019-06-26

i assume its multiple content.

May its focused the first 'visible' item.

did you test with

Quote:control.setfocus(**),0,absolute

?


RE: Container of static items default focus on second item? - cartman.dos - 2019-06-26

(2019-06-26, 20:39)mardukL Wrote: i assume its multiple content.

May its focused the first 'visible' item.

did you test with

Quote:control.setfocus(**),0,absolute

?

Yeah of course but I want to solve the root problem and not patch it. Also, I can't really use this method specifically since I don't know upfront which id the container will be assigned with...


RE: Container of static items default focus on second item? - mardukL - 2019-06-27

(2019-06-26, 21:46)cartman.dos Wrote:
(2019-06-26, 20:39)mardukL Wrote: i assume its multiple content.

May its focused the first 'visible' item.

did you test with

Quote:control.setfocus(**),0,absolute

?

Yeah of course but I want to solve the root problem and not patch it. Also, I can't really use this method specifically since I don't know upfront which id the container will be assigned with...

can you post a code snippet?

i assume that you have

<content>a</content>
<content>b</content>

in one container.

where content b is faster visible than a.

that is why b gets focused first.

but just thinking ;-)

other solution would a control.move(**,-1)

as onload action if possible


RE: Container of static items default focus on second item? - cartman.dos - 2019-06-27

(2019-06-27, 03:38)mardukL Wrote:
(2019-06-26, 21:46)cartman.dos Wrote:
(2019-06-26, 20:39)mardukL Wrote: i assume its multiple content.

May its focused the first 'visible' item.

did you test with


?

Yeah of course but I want to solve the root problem and not patch it. Also, I can't really use this method specifically since I don't know upfront which id the container will be assigned with... 

can you post a code snippet?

i assume that you have

<content>a</content>
<content>b</content>

in one container.

where content b is faster visible than a.

that is why b gets focused first.

but just thinking ;-)

other solution would a control.move(**,-1)

as onload action if possible 
Code:

<include>StaticWidget_Categories</include>
<content sortby="$PARAM[widgetSortBy]" sortorder="$PARAM[widgetSortOrder]" limit="$PARAM[widgetLimit]" target="$PARAM[widgetTarget]">plugin://script.skin.helper.widgets/?action=browsegenres&amp;mediatype=media</content>

The include definition is for example:
Code:

<content>
    <item id="1">
        <label>$LOCALIZE[31532]</label>
        <thumb>bingie/categories/topratedmovies.jpg</thumb>
        <property name="DBTYPE">category</property>
        <property name="path">special://skin/playlists/topratedmovies.xsp</property>
       <onclick>ActivateWindow(Videos,special://skin/playlists/topratedmovies.xsp,return)</onclick>
       <visible>true</visible>
    </item>

...
</content>

So the faster one is actually first, also for control.move I need an id upfront, unless I'm using something like sualfred's resetposition method, which i can  provide a long list of possible ids, but still not ideal :/


RE: Container of static items default focus on second item? - cartman.dos - 2019-07-04

Seems to be a gui engine bug when using focusposition with static items, issue has been reported.
https://github.com/xbmc/xbmc/issues/16348