Re: prelight, again



Paul Davis wrote:
Are there are any plans to allow disabling of prelight, globally, in
any future version of GTK?
Prelighting conflicts absolutely with the use of color to distinguish
widget state. For a simple demonstration, consider this style:
style "foo" {
           fg[NORMAL] = { 1.0, 0.0, 0.0 }
	   fg[ACTIVE] = { 0.0, 0.0, 1.0 }
       }

Consider what color the widget should appear in PRELIGHT. Should it be
red? Should it be blue? Some other color?

Thanks. We have had quite a lot of feedback (relatively speaking)
about this issue in ardour, where we make extensive use of style files
to define colors that distinguish widget (and ultimately "model" (as
in MVC)) states. People find it very distracting and annoying that
prelight always adopts *one* specific color, independent of the state
of the widget.

Maybe this wouldn't work for you, but I get around this problem by having a separate style for each state and flipping widgets between them with a gtk_widget_set_name(). For example:

# style for widgets with errors in them
style "error_style" = "default"
{
       bg[NORMAL] = "#C1665A"
       bg[PRELIGHT] = "#E0B6AF"
       bg[ACTIVE] = "#C1665A"
       bg[SELECTED] = "#C1665A"
       bg[INSENSITIVE] = "#884631"
}

# style for dirty widgets (need recalculation)
style "dirty_style" = "default"
{
       bg[NORMAL] = "#E0C39E"
       bg[PRELIGHT] = "#EFE0CD"
       bg[ACTIVE] = "#E0C39E"
       bg[SELECTED] = "#E0C39E"
       bg[INSENSITIVE] = "#B39169"
}

widget "*error_widget" style "error_style"
widget "*dirty_widget" style "dirty_style"

then on view refresh, my app looks at the model state and uses gtk_widget_set_name() to set how that widget should be rendered.

John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]