[mythtv-theming] can't override size of checkbox

Joey Morris rjmorris.list at zoho.com
Sat Mar 16 23:02:08 UTC 2013


Jonatan Lindblad <mythtv at comhem.se> wrote on Sat, Mar 16, 2013 at 10:03:33PM +0100:
> On 2013-03-16 20:26, Joey Morris wrote:
> >Jonatan Lindblad <mythtv at comhem.se> wrote on Sat, Mar 16, 2013 at 06:55:00PM +0100:
> >>On 2013-03-16 16:41, Joey Morris wrote:
> >>>I'm running 0.26-fixes. I've defined a checkbox widget in base.xml
> >>>that looks something like this:
> >>>
> >>>     <checkbox name="base_checkbox">
> >>>       <area>0,0,80,30</area>
> >>>       ...
> >>>     </checkbox>
> >>>
> >>>In recordings-ui.xml, I want to inherit from base_checkbox and
> >>>override the y-position and the width, so I tried this:
> >>>
> >>>     <checkbox name="titles" from="base_checkbox">
> >>>       <area>0,120,500,30</area>
> >>>     </checkbox>
> >>>
> >>>However, only the y-position was changed. The width was still 80. I
> >>>also tested the height, and I couldn't override that, either. I looked
> >>>at a few themes, and I could only find examples of people overriding
> >>>the checkbox's position, never its size. Is the inability to override
> >>>the size a design decision or a bug?
> >>
> >>It would help if you showed us the complete definition of
> >>base_checkbox, although I think you're simply not setting the area
> >>of the statetypes or their children to say 0,0,100%,100%.
> >
> >I've had problems in the past setting the area appropriately for
> >statetypes, so that very well could be the problem. Here's my full
> >base_checkbox:
> >
> >   <checkbox name="base_checkbox">
> >     <!-- It doesn't appear that the height and width can be overridden. -->
> >     <area>0,0,80,34</area>
> >     <statetype name="background">
> 
> Add <area>0,0,100%,100%</area> here and it should work.

That works. Thanks! I think I understand why it works. Can you tell me
if the following explanation is correct:

Because I didn't define an area for the statetype, it was assigned the
area from its parent, the base_checkbox, which was 0,0,80,34. When I
inherited from base_checkbox, I overrode the base_checkbox's area,
changing it to 0,120,500,34. However, that had no effect on the
statetype's area, which stayed at 0,0,80,34, thus constraining my
background shape to a width of 80.

By explicitly defining the area of the statetype to be 0,0,100%,100%,
it didn't need to get its area from the base_checkbox. If I had used
base_checkbox directly, the width of the statetype would have been
100% the width of the base_checkbox, or 80. When I inherited from
base_checkbox and changed its width to 500, the width of the statetype
was recomputed as 100% of 500.

Did I get that right?

The part I was confused about was that for some reason I thought the
statetype didn't actually have an area. I thought it was just a
container for widgets that do have areas. I also thought the same
thing about states, but I gave them areas anyway because it fixed some
things even though I didn't know why. But now I think I do, so thanks
for helping me out.



More information about the mythtv-theming mailing list