Kodi Community Forum

Full Version: Focus inheritance?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Suppose I have a bunch of controls of various types, some focusable and some not, all adjacent (no gaps). Underneath them all is an invisible button (which is obviously focusable).

If I move the mouse from a button onto an adjacent non-focusable thing (like an image or label) will the button underneath get the focus? Or will nothing?

I'm seeing inconsistent behaviour. Sometimes it works and sometimes it doesn't (as tested by putting a different image for texturefocus on the underlying button). Also, if the thing moved into is a disabled button, it never seems to pass focus to the underlying button. Should it?
That would stop the real buttons from getting the focus, wouldn't it?
I guess I am confused with what your trying to do... So you want all the buttons to get focus as u move the mouse? .. if so put the on top of the images? Not sure what u want to achieve.
(2017-05-12, 07:41)aegidius Wrote: [ -> ]Also, if the thing moved into is a disabled button, it never seems to pass focus to the underlying button. Should it?

No, it's still a button - just hide it if it's disabled.
(2017-05-12, 11:58)smitchell6879 Wrote: [ -> ]I guess I am confused with what your trying to do... So you want all the buttons to get focus as u move the mouse? .. if so put the on top of the images? Not sure what u want to achieve.

It's the side menu in Estuary. The way it's written, the visibility of the group is driven by one of its controls having the focus. As soon as you move the mouse onto a non-focusable object like a label, the menu goes away, so it's useless with the mouse.

I'm trying to keep it visible as long as the mouse is anywhere within the area of the menu. So I changed the underlying black background to a button, so that could take the focus when I moved the mouse between controls. It seems to work fine on the addon browser, file browser etc. but still doesn't work on the PVR side menus.

Really, a simple mouse-is-in-rectangle condition would do just fine for visibility, then I wouldn't have to worry about focus at all. Is there such a thing?
Take a look at Aeon Nox 5' side menu. I use a window property so it doesn't lose focus when you hover the mouse elsewhere.
Thanks, that nailed it!
I committed a change to do that, and to dismiss the side menu with a back button in the top left corner. If I've missed any screens or the thing sticks around when it shouldn't, someone (or I) will find it eventually :-). .