2001-04-18  Havoc Pennington  <hp@redhat.com>

        Close bug #50615:

	* gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
	the layout

	* gtk/gtktext.c: Use base/text instead of bg/fg throughout

	* gtk/gtkentry.c: Use base/text instead of bg/fg throughout

	* gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout

	* gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
	to blue for base, in addition to bg
This commit is contained in:
Havoc Pennington 2001-04-18 20:16:38 +00:00 committed by Havoc Pennington
parent c01a1c7363
commit f8ceea8b35
11 changed files with 138 additions and 25 deletions

View File

@ -1,3 +1,19 @@
2001-04-18 Havoc Pennington <hp@redhat.com>
Close bug #50615:
* gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
the layout
* gtk/gtktext.c: Use base/text instead of bg/fg throughout
* gtk/gtkentry.c: Use base/text instead of bg/fg throughout
* gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
* gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
to blue for base, in addition to bg
2001-04-18 Havoc Pennington <hp@redhat.com>
* tests/testgtk.c (create_image): allow shrinking the image window

View File

@ -1,3 +1,19 @@
2001-04-18 Havoc Pennington <hp@redhat.com>
Close bug #50615:
* gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
the layout
* gtk/gtktext.c: Use base/text instead of bg/fg throughout
* gtk/gtkentry.c: Use base/text instead of bg/fg throughout
* gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
* gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
to blue for base, in addition to bg
2001-04-18 Havoc Pennington <hp@redhat.com>
* tests/testgtk.c (create_image): allow shrinking the image window

View File

@ -1,3 +1,19 @@
2001-04-18 Havoc Pennington <hp@redhat.com>
Close bug #50615:
* gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
the layout
* gtk/gtktext.c: Use base/text instead of bg/fg throughout
* gtk/gtkentry.c: Use base/text instead of bg/fg throughout
* gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
* gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
to blue for base, in addition to bg
2001-04-18 Havoc Pennington <hp@redhat.com>
* tests/testgtk.c (create_image): allow shrinking the image window

View File

@ -1,3 +1,19 @@
2001-04-18 Havoc Pennington <hp@redhat.com>
Close bug #50615:
* gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
the layout
* gtk/gtktext.c: Use base/text instead of bg/fg throughout
* gtk/gtkentry.c: Use base/text instead of bg/fg throughout
* gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
* gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
to blue for base, in addition to bg
2001-04-18 Havoc Pennington <hp@redhat.com>
* tests/testgtk.c (create_image): allow shrinking the image window

View File

@ -1,3 +1,19 @@
2001-04-18 Havoc Pennington <hp@redhat.com>
Close bug #50615:
* gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
the layout
* gtk/gtktext.c: Use base/text instead of bg/fg throughout
* gtk/gtkentry.c: Use base/text instead of bg/fg throughout
* gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
* gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
to blue for base, in addition to bg
2001-04-18 Havoc Pennington <hp@redhat.com>
* tests/testgtk.c (create_image): allow shrinking the image window

View File

@ -1,3 +1,19 @@
2001-04-18 Havoc Pennington <hp@redhat.com>
Close bug #50615:
* gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
the layout
* gtk/gtktext.c: Use base/text instead of bg/fg throughout
* gtk/gtkentry.c: Use base/text instead of bg/fg throughout
* gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
* gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
to blue for base, in addition to bg
2001-04-18 Havoc Pennington <hp@redhat.com>
* tests/testgtk.c (create_image): allow shrinking the image window

View File

@ -1,3 +1,19 @@
2001-04-18 Havoc Pennington <hp@redhat.com>
Close bug #50615:
* gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
the layout
* gtk/gtktext.c: Use base/text instead of bg/fg throughout
* gtk/gtkentry.c: Use base/text instead of bg/fg throughout
* gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
* gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
to blue for base, in addition to bg
2001-04-18 Havoc Pennington <hp@redhat.com>
* tests/testgtk.c (create_image): allow shrinking the image window

View File

@ -846,7 +846,7 @@ gtk_entry_realize_cursor_gc (GtkEntry *entry)
gdk_gc_set_rgb_fg_color (entry->cursor_gc, cursor_color);
}
else
entry->cursor_gc = gdk_gc_ref (GTK_WIDGET (entry)->style->bg_gc[GTK_STATE_SELECTED]);
entry->cursor_gc = gdk_gc_ref (GTK_WIDGET (entry)->style->base_gc[GTK_STATE_SELECTED]);
}
static void
@ -2372,17 +2372,17 @@ gtk_entry_draw_text (GtkEntry *entry)
rect.width = (ranges[2*i + 1] - ranges[2*i]) / PANGO_SCALE;
rect.height = logical_rect.height / PANGO_SCALE;
gdk_draw_rectangle (entry->text_area, widget->style->bg_gc [GTK_STATE_SELECTED], TRUE,
gdk_draw_rectangle (entry->text_area, widget->style->base_gc [GTK_STATE_SELECTED], TRUE,
rect.x, rect.y, rect.width, rect.height);
gdk_region_union_with_rect (clip_region, &rect);
}
gdk_gc_set_clip_region (widget->style->fg_gc [GTK_STATE_SELECTED], clip_region);
gdk_draw_layout (entry->text_area, widget->style->fg_gc [GTK_STATE_SELECTED],
gdk_gc_set_clip_region (widget->style->text_gc [GTK_STATE_SELECTED], clip_region);
gdk_draw_layout (entry->text_area, widget->style->text_gc [GTK_STATE_SELECTED],
x, y,
layout);
gdk_gc_set_clip_region (widget->style->fg_gc [GTK_STATE_SELECTED], NULL);
gdk_gc_set_clip_region (widget->style->text_gc [GTK_STATE_SELECTED], NULL);
gdk_region_destroy (clip_region);
g_free (ranges);
@ -2416,7 +2416,7 @@ gtk_entry_draw_cursor (GtkEntry *entry,
xoffset + strong_x, text_area_height - INNER_BORDER);
if (weak_x != strong_x)
gdk_draw_line (entry->text_area, widget->style->fg_gc[GTK_STATE_NORMAL],
gdk_draw_line (entry->text_area, widget->style->text_gc[GTK_STATE_NORMAL],
xoffset + weak_x, INNER_BORDER,
xoffset + weak_x, text_area_height - INNER_BORDER);
}

View File

@ -409,7 +409,8 @@ gtk_style_init (GtkStyle *style)
style->text[i] = style->fg[i];
style->base[i] = style->white;
}
style->base[GTK_STATE_SELECTED] = gtk_default_selected_bg;
style->base[GTK_STATE_INSENSITIVE] = gtk_default_prelight_bg;
style->text[GTK_STATE_INSENSITIVE] = gtk_default_insensitive_fg;
@ -3913,7 +3914,7 @@ gtk_default_draw_layout (GtkStyle *style,
g_return_if_fail (window != NULL);
if (area)
gdk_gc_set_clip_rectangle (style->fg_gc[state_type], area);
gdk_gc_set_clip_rectangle (style->text_gc[state_type], area);
if (state_type == GTK_STATE_INSENSITIVE)
{
@ -3921,17 +3922,17 @@ gtk_default_draw_layout (GtkStyle *style,
ins = get_insensitive_layout (layout);
gdk_draw_layout (window, style->fg_gc[state_type], x, y, ins);
gdk_draw_layout (window, style->text_gc[state_type], x, y, ins);
g_object_unref (G_OBJECT (ins));
}
else
{
gdk_draw_layout (window, style->fg_gc[state_type], x, y, layout);
gdk_draw_layout (window, style->text_gc[state_type], x, y, layout);
}
if (area)
gdk_gc_set_clip_rectangle (style->fg_gc[state_type], NULL);
gdk_gc_set_clip_rectangle (style->text_gc[state_type], NULL);
}
static void

View File

@ -1452,7 +1452,7 @@ clear_focus_area (GtkText *text, gint area_x, gint area_y, gint area_width, gint
gc = text->bg_gc;
}
else
gc = widget->style->bg_gc[widget->state];
gc = widget->style->base_gc[widget->state];
gdk_draw_rectangle (GTK_WIDGET (text)->window, gc, TRUE,
area_x, area_y, area_width, area_height);
@ -4896,9 +4896,9 @@ draw_line (GtkText* text,
(mark.index < selection_end_pos))
{
if (old_editable->has_selection)
fg_gc = GTK_WIDGET(text)->style->fg_gc[GTK_STATE_SELECTED];
fg_gc = GTK_WIDGET(text)->style->text_gc[GTK_STATE_SELECTED];
else
fg_gc = GTK_WIDGET(text)->style->fg_gc[GTK_STATE_ACTIVE];
fg_gc = GTK_WIDGET(text)->style->text_gc[GTK_STATE_ACTIVE];
}
else
{

View File

@ -250,7 +250,7 @@ render_layout_line (GdkDrawable *drawable,
if (selected)
{
fg_gc = render_state->widget->style->fg_gc[GTK_STATE_SELECTED];
fg_gc = render_state->widget->style->text_gc[GTK_STATE_SELECTED];
}
else
{
@ -517,7 +517,7 @@ render_para (GdkDrawable *drawable,
selection_end_index > line->length + byte_offset) /* All selected */
{
gdk_draw_rectangle (drawable,
render_state->widget->style->bg_gc[GTK_STATE_SELECTED],
render_state->widget->style->base_gc[GTK_STATE_SELECTED],
TRUE,
x + line_display->left_margin,
selection_y,
@ -548,11 +548,11 @@ render_para (GdkDrawable *drawable,
selection_height,
selection_start_index, selection_end_index);
gdk_gc_set_clip_region (render_state->widget->style->fg_gc [GTK_STATE_SELECTED], clip_region);
gdk_gc_set_clip_region (render_state->widget->style->bg_gc [GTK_STATE_SELECTED], clip_region);
gdk_gc_set_clip_region (render_state->widget->style->text_gc [GTK_STATE_SELECTED], clip_region);
gdk_gc_set_clip_region (render_state->widget->style->base_gc [GTK_STATE_SELECTED], clip_region);
gdk_draw_rectangle (drawable,
render_state->widget->style->bg_gc[GTK_STATE_SELECTED],
render_state->widget->style->base_gc[GTK_STATE_SELECTED],
TRUE,
x + PANGO_PIXELS (line_rect.x),
selection_y,
@ -564,8 +564,8 @@ render_para (GdkDrawable *drawable,
y + PANGO_PIXELS (baseline),
TRUE);
gdk_gc_set_clip_region (render_state->widget->style->fg_gc [GTK_STATE_SELECTED], NULL);
gdk_gc_set_clip_region (render_state->widget->style->bg_gc [GTK_STATE_SELECTED], NULL);
gdk_gc_set_clip_region (render_state->widget->style->text_gc [GTK_STATE_SELECTED], NULL);
gdk_gc_set_clip_region (render_state->widget->style->base_gc [GTK_STATE_SELECTED], NULL);
gdk_region_destroy (clip_region);
@ -575,7 +575,7 @@ render_para (GdkDrawable *drawable,
(line_display->direction == GTK_TEXT_DIR_RTL && selection_end_index > byte_offset + line->length)))
{
gdk_draw_rectangle (drawable,
render_state->widget->style->bg_gc[GTK_STATE_SELECTED],
render_state->widget->style->base_gc[GTK_STATE_SELECTED],
TRUE,
x + line_display->left_margin,
selection_y,
@ -595,7 +595,7 @@ render_para (GdkDrawable *drawable,
PANGO_PIXELS (line_rect.x) - PANGO_PIXELS (line_rect.width);
gdk_draw_rectangle (drawable,
render_state->widget->style->bg_gc[GTK_STATE_SELECTED],
render_state->widget->style->base_gc[GTK_STATE_SELECTED],
TRUE,
x + PANGO_PIXELS (line_rect.x) + PANGO_PIXELS (line_rect.width),
selection_y,
@ -786,9 +786,9 @@ gtk_text_layout_draw (GtkTextLayout *layout,
GdkGC *gc;
if (cursor->is_strong)
gc = widget->style->bg_gc[GTK_STATE_SELECTED];
gc = widget->style->base_gc[GTK_STATE_SELECTED];
else
gc = widget->style->fg_gc[GTK_STATE_NORMAL];
gc = widget->style->text_gc[GTK_STATE_NORMAL];
gdk_draw_line (drawable, gc,
line_display->x_offset + cursor->x - x_offset,