Mailing List Archive

buttonlist and active/inactive/selected states
I'm currently working on a theme. In the Watch Recordings screen, I
have a few questions about implementing the button lists.

Previously in 0.21, the lists would be drawn as follows. When a list
was focused, the selected item would be drawn in the "selected" state
(well...."selected" function, as it was referred to back then), and
all other items would be drawn in "active" state. When the list lost
focus, the selected item would continue to be in the "selected" state,
however the rest of the items would revert to the "inactive" state.
This was handy because when the list was not selected, you could make
all the non-selected items switch to a dimmer color, so your focus
would only be on the selected item (everything else could appear as if
disabled).

Now, with 0.22 buttonlists I'm finding this behavior is a bit
different. All of the non-selected items remain in the "active" state
whether the list is focused or not. However, the selected item
switched between "selected" and "inactive" states. So in other words,
when the list is NOT focused, the selected item is "inactive" and
everything else is "active". That seems backward to me. Is this a bug?
If not, what's the reasoning behind that?

I can understand wanting to add an alternate state for the selected
item, but not at the expense of non-selected items. Is there some way
to work around this (perhaps a 4th state I'm unaware of, even though
the docs suggest only 3 states)?


FYI, here is the code I'm using to generate the buttonlist:

<buttonlist name="groups">
<area>0,100,330,380</area>
<buttonarea>20,20,290,340</buttonarea>
<wrapstyle>selection</wrapstyle>
<scrollstyle>free</scrollstyle>
<layout>vertical</layout>
<spacing>3</spacing>
<statetype name="buttonitem">
<state name="active">
<area>0,0,290,40</area>
<imagetype name="buttonbackground" />
<textarea name="name" from="basetextarea">
<area>10,0,270,40</area>
</textarea>
</state>
<state name="selected" from="active">
<imagetype name="buttonbackground">
<filename>ui/selectbar_left_panel_2.png</filename>
</imagetype>
<textarea name="name">
<font>yellow_small</font>
</textarea>
</state>
<state name="inactive" from="active">
<textarea name="name">
<font>darkgray_small</font>
</textarea>
</state>
</statetype>
</buttonlist>


--
Ron
_______________________________________________
mythtv-theming mailing list
mythtv-theming@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-theming
Re: buttonlist and active/inactive/selected states [ In reply to ]
On Tue, Dec 8, 2009 at 6:17 PM, Ronald Frazier <ron@ronfrazier.net> wrote:
> I'm currently working on a theme. In the Watch Recordings screen,  I
> have a few questions about implementing the button lists.
>
> Previously in 0.21, the lists would be drawn as follows. When a list
> was focused, the selected item would be drawn in the "selected" state
> (well...."selected" function, as it was referred to back then), and
> all other items would be drawn in "active" state. When the list lost
> focus, the selected item would continue to be in the "selected" state,
> however the rest of the items would revert to the "inactive" state.
> This was handy because when the list was not selected, you could make
> all the non-selected items switch to a dimmer color, so your focus
> would only be on the selected item (everything else could appear as if
> disabled).
>
> Now, with 0.22 buttonlists I'm finding this behavior is a bit
> different. All of the non-selected items remain in the "active" state
> whether the list is focused or not. However, the selected item
> switched between "selected" and "inactive" states. So in other words,
> when the list is NOT focused, the selected item is "inactive" and
> everything else is "active". That seems backward to me. Is this a bug?
> If not, what's the reasoning behind that?
>
> I can understand wanting to add an alternate state for the selected
> item, but not at the expense of non-selected items. Is there some way
> to work around this (perhaps a 4th state I'm unaware of, even though
> the docs suggest only 3 states)?

As the docs suggest, there are only three states-- the fourth you are
looking for no longer exists. It would probably be a fairly easy
thing to add if you were looking for a MythUI project.

Robert
_______________________________________________
mythtv-theming mailing list
mythtv-theming@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-theming
Re: buttonlist and active/inactive/selected states [ In reply to ]
> As the docs suggest, there are only three states

OK. Just wasn't sure if there was something else undocumented. For
instance, the docs suggest "jobstate" statetype has valid states of
"recording" and "transcoding". However, looking at the other themes,
it appears there is also a "commflagging" state (though I haven't yet
verified it actually works). I'm wondering if there is also a state
for other user jobs.

Also, on the topic of undocumented things, I see that a <font> element
can have a "state" property, and the valid values I see are disabled,
error, warning, normal, running, and selected. Any documentation on
where these can be used (I've discovered that "running" is set when in
the "Watch Recording" screen for shows that are recording. I didn't
see anything at all in the wiki (I'd add it myself, but I barely
understand what it can do, so I'm probably not the best person to do
that).


> -- the fourth you are
> looking for no longer exists.  It would probably be a fairly easy
> thing to add if you were looking for a MythUI project.

Perhaps. Before making this email, I tried looking at the UI code, to
see if I could perhaps reverse engineer the answer to my question
before asking it, but I couldn't make heads or tails of how it worked.
I'll look into it later. I can live with it for now. Not a big deal,
but it's the first 0.21 behavior I've encountered that I couldn't
replicate in 0.22, and thought it was just as simple as me doing
something wrong.

--
Ron
_______________________________________________
mythtv-theming mailing list
mythtv-theming@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-theming