Kodi Community Forum

Full Version: hitrect in a list?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
According to the wiki hitrect should be available to focusable controls but I can't get it to work for a list.

I've tried it in the list control and also the focusedlayout items but it still wont reach beyond the list's dimensions.

Am I doing something wrong or does it not work for all controls?

Thanks.
Hitrect is used to find where the initial mouse events are to be sent - i.e. the topmost control who's hitrect is under the mouse is the one that receives events.

How various events are actually done (eg whether or not a particular item in a list gets focused) is then determined by the size of the items (or some other criteria on the control itself) rather than any hitrect.

What is it you're trying to do?

Cheers,
Jonathan
It's not majorly important but here's what I was trying to achieve.

For all the controls in XeeBo I used a grouplist that contained the actual buttons (red) that had a larger hitrect (blue) so I could then use autowidth labels to keep everything evenly spaced while having a large hit area for mouse/touch screen use.

Now that I've added multiple views for Weather.com+ I used a list control with static content to mimic a spincontrol in place of a button. Now though it only uses the smaller hit area (red) which is why I was hoping to use hitrect to increase the size.

Thanks.

Image
I would modify ButtonFO with adding some empty pixels to the right, that would go below label (10 days). It would be compatible with Dharma, too.

That's not to say that somewhat modified hitrect would not be useful. I could use it to with scrollbars.
pecinko Wrote:I would modify ButtonFO with adding some empty pixels to the right, that would go below label (10 days). It would be compatible with Dharma, too.

Because its a grouplist the label would just get moved further right (defined by the <itemgap> control).

I thought I could get around it by using a button like the other controls and get it to send a click to the list but that doesn't work either.
Hitcher Wrote:Because its a grouplist the label would just get moved further right (defined by the <itemgap> control).

I thought I could get around it by using a button like the other controls and get it to send a click to the list but that doesn't work either.

Could label "10 Day" be "merged" with "i" icon on the left into a single button?
Then it wont be able to use autowidth as that's only available for labels not buttons - do you see my dilemma?
I feel your pain.

All I can think of is using hidden buttons but that I would not like to code.
Thanks, solved it by moving the list control out of the grouplist and making it wider so it lies underneath the grouplist.
Which bit in the screenshot above is the list with static content? The red bit?
Yes and I'm using control.getlabel for the autowidth label next to it.