[openbox] Exit dialog buttons in theme

Carlos Pita carlosjosepita at gmail.com
Wed Jan 12 18:58:08 EST 2011


Hi,

I managed to keep backwards compatibility without really cluttering
the code so here is the patch
http://bugzilla.icculus.org/show_bug.cgi?id=4874 too.

Please keep in mind that this is my first piece of code for openbox
and that I'm not a die hard openbox user (yet), not to tell the patch
was not exhaustively tested. Anyway I think it's pretty much in a good
shape but any criticism will be welcome.

Basically the patch add the following theme options for controlling
buttons in osd prompts:

#### colors
#
# for the text inside the button
osd.button.unpressed.text.color
osd.button.pressed.text.color
osd.button.focused.text.color
#
# for the line art around the button
#  (if you don't wan't the box just make box.color = bg.color)
osd.button.pressed.box.color
osd.button.focused.box.color

#### textures
#
osd.button.unpressed.bg
osd.button.pressed.bg
osd.button.focused.bg

The buttons can be in three states:

  unpressed: neither clicked nor selected
  focused: selected but not clicked
  pressed: clicked (and of course selected)

I discarded the previous distinction between press and pfocus as in
fact it was only a formal distinction, in that both appearances
mimicked each other in every sense. It think that it was just
inherited from the way titlebar buttons are managed so I decided to
simplify it a bit.

All the options default in a way that preserves backwards compatibility:

osd.button.unpressed.text.color  -> osd.active.label.text.color
osd.button.pressed.text.color -> osd.active.label.text.color
osd.button.focused.text.color -> osd.active.label.text.color

osd.button.pressed.box.color ->  window.active.button.pressed.image.color
osd.button.focused.box.color -> window.active.button.hover.image.color

osd.button.unpressed.bg -> window.active.button.unpressed.bg
osd.button.pressed.bg -> window.active.button.pressed.bg
osd.button.focused.bg -> window.active.button.hover.bg

Notice that a good deal of locs where added to theme.c but in
compensation prompt.c is pretty much simpler now because the
appearances and textures are created while loading the theme.

Well, I think that's all for now. Hope you like it.

Best regards
--
Carlos



On Wed, Jan 12, 2011 at 4:12 PM, Carlos Pita <carlosjosepita at gmail.com> wrote:
> Hi,
>
> I'm writing a patch in order to add
>
> osd.button.pressed.bg
> osd.button.unpressed.bg
> osd.button.hover.bg
>
> options to the theme engine.
>
> If you think this could be eventually committed into the master please
> let me know if backwards compatibility with older themes is needed.
>
> Currently prompt.c is smarter than it could have been if it had relied
> on user provided textures from the beginning. One thing it does is to
> remove a_hover_focused_close, a_focused_pressed_close, etc. textures
> and just keep their colors for the prompt button lineart. Of course, I
> don't want to discard the new osd_hover_focused_buttton,
> osd_focused_pressed_button, etc, textures which are the entire point
> of the patch.
>
> Another thing I consider unnecessary given the flexibility that these
> new theme options bring is the need to draw a box around the selected
> prompt button: user configurable osd.button.hover.bg should be enough.
> So if backwards compatibility is unneeded I would just drop this
> functionality.
>
> So please let me know what you think before I move forward.
>
> Regards
> --
> Carlos
>
> On Sat, Jan 8, 2011 at 7:23 AM, Carlos Pita <carlosjosepita at gmail.com> wrote:
>> Hi,
>>
>> the fact that buttons in yes/no dialogs has styles given by
>> window.active.button.* means that their colors must be visible both on
>> top of window.active.title.bg.color and osd.bg.color. I've seen that a
>> good number of themes set window.active.title.bg.color=osd.bg.color
>> (explicitly or by default). That's fine, but what if you want a light
>> title bg but a dark osd bg. Chances are that buttons won't be clearly
>> visible either in the title or in the osd. Why don't you provide
>> separate settings for each case?
>>
>> Regards
>> --
>> Carlos
>>
>


More information about the openbox mailing list