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

Joey Morris rjmorris.list at zoho.com
Sat Mar 16 19:26:14 UTC 2013


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">
      <state name="active">
        <area>0,0,100%,100%</area>
        <!-- Add this completely transparent background element to force the
             background element to be defined earlier than the
             checkbox_outline element. This ensures that the checkbox_outline
             is drawn after (and thus on top of) the background, even in
             derived states below where background is overridden but
             checkbox_outline isn't. -->
        <shape name="background">
          <area>0,0,100%,100%</area>
          <type>box</type>
          <fill color="#000000" alpha="0"/>
        </shape>
        <shape name="checkbox_outline">
          <area>10,9,16,16</area>
          <type>box</type>
          <line color="#aaaaaa" width="1"/>
        </shape>
      </state>
      <state name="selected" from="active">
        <shape name="background">
          <area>0,0,100%,100%</area>
          <type>box</type>
          <fill color="#38527a"/>
        </shape>
      </state>
      <state name="disabled"/>
    </statetype>
    <statetype name="checkstate">
      <state type="full">
        <area>0,0,100%,100%</area>
        <shape name="checkbox_fill">
          <area>10,9,16,16</area>
          <type>box</type>
          <fill color="#aaaaaa"/>
        </shape>
      </state>
      <state type="half" from="full">
        <shape name="checkbox_fill">
          <area>10,17,16,8</area>
        </shape>
      </state>
      <state type="off"/>
    </statetype>
  </checkbox>




More information about the mythtv-theming mailing list