Re: Button background colors



On Thu, Jun 15, 2006 at 11:27:35AM +0200, Jose Hevia wrote:
> 2006/6/15, David Ne?as (Yeti) <yeti physics muni cz>:
> > On Wed, Jun 14, 2006 at 07:08:31PM -0700, Anna wrote:
> > >
> > > I use gtk_widget_modify_bg() without trouble.  piece of a function:
> >
> > It works for people who use a decent Gtk+ theme.  But themes
> > and theme engines can easily make similar things stop working.
> > Try just
> >
> > style "default" {
> >    bg_pixmap[NORMAL] = "someimage"
> > }
> > widget_class "*" style "default"
> >
> > in your gtkrc.
> >
> > I am afraid the requirement of particular colors goes
> > directly against themeability.  One cannot have both.
> >
> > Yeti
> 
> At first, I agreed with this. Now I know that it's possible to make an
> intelligent program that knows witch colors are you using and take
> action from it.
> 
> 80 per cent of themes are almost white for buttons, I like dark ones.
> This could be detected by the program and decide:
> If you are using bright themes {select this colors.}
> else {select the other ones.}
> based in contrast between them
> 
> Themeability is very important for Gtk, but using colors like scalable
> icons (look at these films with the "red button") without having to
> bother with complexity gives gtk a lot of power to give it away.

I have a "widget" (actually, a dialog with database interface) that
allows users to create button background colors, and apply that "theme"
to a "class" of buttons in the application.  This was an important
element to have in my app because the buttons, from the GTK+ point of
view, are all more or less the same, and are created on-the-fly at the
user's bequest.  The user is allowed to group the buttons in any way
they see fit.  It works quite well with two great benefits:  it gets
around inflexabilities in themes and makes button color selection
accessible to users who don't know how to use a text editor...  much
less use a syntax to create a complex theme.

- Anna




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