Re: GtkEntry selection color when not focused
- From: Alex Larsson <alexl redhat com>
- To: Owen Taylor <otaylor redhat com>
- Cc: <gtk-devel-list gnome org>
- Subject: Re: GtkEntry selection color when not focused
- Date: Wed, 29 Aug 2001 19:17:25 -0400 (EDT)
On 29 Aug 2001, Owen Taylor wrote:
> > diff -u -p -r1.146 gtkentry.c
> > --- gtk/gtkentry.c 2001/07/19 18:47:03 1.146
> > +++ gtk/gtkentry.c 2001/08/29 19:19:33
> > @@ -2500,6 +2500,8 @@ gtk_entry_draw_text (GtkEntry *entry)
> > gint start_index = g_utf8_offset_to_pointer (entry->text, start_pos) - entry->text;
> > gint end_index = g_utf8_offset_to_pointer (entry->text, end_pos) - entry->text;
> > GdkRegion *clip_region = gdk_region_new ();
> > + GdkGC *text_gc;
> > + GdkGC *selection_gc;
> >
> > line = pango_layout_get_lines (layout)->data;
> >
> > @@ -2507,6 +2509,17 @@ gtk_entry_draw_text (GtkEntry *entry)
> >
> > pango_layout_get_extents (layout, NULL, &logical_rect);
> >
> > + if (GTK_WIDGET_HAS_FOCUS (entry))
> > + {
> > + selection_gc = widget->style->base_gc [GTK_STATE_SELECTED];
> > + text_gc = widget->style->text_gc [GTK_STATE_SELECTED];
> > + }
> > + else
> > + {
> > + selection_gc = widget->style->bg_gc [GTK_STATE_ACTIVE];
> > + text_gc = widget->style->fg_gc [GTK_STATE_ACTIVE];
> > + }
>
> Would it be better here to use base/text [GTK_STATE_ACTIVE]? --
> it might require some fixing of the current color settings, but it
> is better than overloading fg/bg [GTK_STATE_ACTIVE], which are used
> for pressed in buttons already...
Well, base/text [ACTIVE] is used for: check buttons, radio buttons, ctree
lines and clist lines. So changing that will be some work.
> Of course, that does run into the problem that the CList uses
> base/text[GTK_STATE_ACTIVE] for drawing the lines betweeen rows...
>
> Really confusing thing about using ACTIVE for this ... "active"
> is often used as a synonym for "focused" ... but
> NORMAL/INSENSTIVE/SELECTED are already in use, and PRELIGHT would
> be almost as confusing.
The whole style thing is really confused. People just pick states randomly
so that the colors match...
So, I don't really know much about styles, which one do you people thing
we should be using?
> I think it would be better to avoid this change ... just leave GtkText
> doing what it does now.
Ok.
/ Alex
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]