2017-05-16, 10:21
(2017-05-16, 06:32)Jeroen Wrote: I use single mode for my vertical menu, and use:
Code:<onunload>RunScript(script.skinshortcuts,type=hidesubmenu&mainmenuID=9000)</onunload>
so that on a return to the homescreen, the previously opened submenu is collapsed. However, focus is not given to the main menu item the previously opened submenu belongs too. Instead, focus is given to the main menu item that is in the position where the submenu item would have been if the submenu would not have been collapsed.
Tried using Control.Move(ID,-1) to work around it, but then this causes an issue with main menu items with no submenu
Hopefully this makes sense..
Just spitballing ideas here, but maybe you could use a groupoverride to add an additional onclick that sets a window property based upon menu position. Then you could use a number of onload conditions that setfocus to the appropriate position based upon the value of the property.
e.g.
Code:
overrides.xml
<groupoverride group="mainmenu" condition="true">SetProperty(FocusPos,$INFO[Container(ID).Position],home)</groupoverride>
Home.xml
<onload condition="Integer.IsEqual(Window(Home).Property(FocusPos),0)">SetFocus(ID,0)</onload>
<onload condition="Integer.IsEqual(Window(Home).Property(FocusPos),1)">SetFocus(ID,1)</onload>
<onload condition="Integer.IsEqual(Window(Home).Property(FocusPos),2)">SetFocus(ID,2)</onload>
etc.
Not sure if this will work (and it's definitely hacky).