Bug 4874 - Separate colors for osd and window buttons
Status: CLOSED FIXED
Alias: None
Product: Openbox
Classification: Unclassified
Component: general
Version: 3.4.11.2
Hardware: PC Linux
: P3 enhancement
Assignee: Dana Jansens
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2011-01-12 00:50 EST by carlosjosepita
Modified: 2011-01-25 13:47:54 EST
1 user (show)

See Also:


Attachments
Separate-theme-options-for-osd-prompt-buttons.patch (14.15 KB, application/octet-stream)
2011-01-12 18:54 EST, carlosjosepita

Description carlosjosepita 2011-01-12 00:50:03 EST
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. 

Please provide separate settings for each case.
Comment 1 carlosjosepita 2011-01-12 18:54:06 EST
Created attachment 2554 [details]
Separate-theme-options-for-osd-prompt-buttons.patch


This 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
Comment 2 Dana Jansens 2011-01-25 12:06:27 EST
Thanks, will reply on the ML but I've applied it to my git tree.  I made one super minor change in the theme code.  The patch is really great. :)
Comment 3 Dana Jansens 2011-01-25 13:47:54 EST
You can see the little addition I made afterwards here: http://git.openbox.org/?p=dana/openbox.git;a=commit;h=ea2382414c17d47aff3b85ee4fc20b42f2b1a89e

Just so that it's explicit about what is being copied from where, in hopes the code will be a bit more self-documenting.  I realize the code is pretty confusing here anyways tho :)