When setting styles, remove unecessary explicits draws and clears.

Fri Feb 12 15:47:20 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcalender.c gtk/gtkentry.c gtk/gtkhandlebox.c
	  gtk/gtknotebook.c gtk/gtktext.c  gtk/gtkviewport.c
	  gtk/gtkwidget.c:

	 When setting styles, remove unecessary explicits draws
	 and clears.

	* gtk/gtkrange.c: Ugly fix so the steps get the
	 correct background.
This commit is contained in:
Owen Taylor 1999-02-16 04:29:00 +00:00 committed by Owen Taylor
parent 3a5883b7e4
commit fd2c0c5651
17 changed files with 102 additions and 50 deletions

View File

@ -1,3 +1,15 @@
Fri Feb 12 15:47:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c gtk/gtkentry.c gtk/gtkhandlebox.c
gtk/gtknotebook.c gtk/gtktext.c gtk/gtkviewport.c
gtk/gtkwidget.c:
When setting styles, remove unecessary explicits draws
and clears.
* gtk/gtkrange.c: Ugly fix so the steps get the
correct background.
Mon Feb 15 22:55:50 1999 Owen Taylor <otaylor@redhat.com>
* NEWS: Updated for 1.1.16.

View File

@ -1,3 +1,15 @@
Fri Feb 12 15:47:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c gtk/gtkentry.c gtk/gtkhandlebox.c
gtk/gtknotebook.c gtk/gtktext.c gtk/gtkviewport.c
gtk/gtkwidget.c:
When setting styles, remove unecessary explicits draws
and clears.
* gtk/gtkrange.c: Ugly fix so the steps get the
correct background.
Mon Feb 15 22:55:50 1999 Owen Taylor <otaylor@redhat.com>
* NEWS: Updated for 1.1.16.

View File

@ -1,3 +1,15 @@
Fri Feb 12 15:47:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c gtk/gtkentry.c gtk/gtkhandlebox.c
gtk/gtknotebook.c gtk/gtktext.c gtk/gtkviewport.c
gtk/gtkwidget.c:
When setting styles, remove unecessary explicits draws
and clears.
* gtk/gtkrange.c: Ugly fix so the steps get the
correct background.
Mon Feb 15 22:55:50 1999 Owen Taylor <otaylor@redhat.com>
* NEWS: Updated for 1.1.16.

View File

@ -1,3 +1,15 @@
Fri Feb 12 15:47:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c gtk/gtkentry.c gtk/gtkhandlebox.c
gtk/gtknotebook.c gtk/gtktext.c gtk/gtkviewport.c
gtk/gtkwidget.c:
When setting styles, remove unecessary explicits draws
and clears.
* gtk/gtkrange.c: Ugly fix so the steps get the
correct background.
Mon Feb 15 22:55:50 1999 Owen Taylor <otaylor@redhat.com>
* NEWS: Updated for 1.1.16.

View File

@ -1,3 +1,15 @@
Fri Feb 12 15:47:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c gtk/gtkentry.c gtk/gtkhandlebox.c
gtk/gtknotebook.c gtk/gtktext.c gtk/gtkviewport.c
gtk/gtkwidget.c:
When setting styles, remove unecessary explicits draws
and clears.
* gtk/gtkrange.c: Ugly fix so the steps get the
correct background.
Mon Feb 15 22:55:50 1999 Owen Taylor <otaylor@redhat.com>
* NEWS: Updated for 1.1.16.

View File

@ -1,3 +1,15 @@
Fri Feb 12 15:47:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c gtk/gtkentry.c gtk/gtkhandlebox.c
gtk/gtknotebook.c gtk/gtktext.c gtk/gtkviewport.c
gtk/gtkwidget.c:
When setting styles, remove unecessary explicits draws
and clears.
* gtk/gtkrange.c: Ugly fix so the steps get the
correct background.
Mon Feb 15 22:55:50 1999 Owen Taylor <otaylor@redhat.com>
* NEWS: Updated for 1.1.16.

View File

@ -1,3 +1,15 @@
Fri Feb 12 15:47:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c gtk/gtkentry.c gtk/gtkhandlebox.c
gtk/gtknotebook.c gtk/gtktext.c gtk/gtkviewport.c
gtk/gtkwidget.c:
When setting styles, remove unecessary explicits draws
and clears.
* gtk/gtkrange.c: Ugly fix so the steps get the
correct background.
Mon Feb 15 22:55:50 1999 Owen Taylor <otaylor@redhat.com>
* NEWS: Updated for 1.1.16.

View File

@ -2562,8 +2562,6 @@ gtk_calendar_set_background (GtkWidget *widget)
gdk_window_set_background (widget->window,
BACKGROUND_COLOR (widget));
}
if (GTK_WIDGET_DRAWABLE (widget))
gdk_window_clear (widget->window);
}
static void

View File

@ -2263,9 +2263,6 @@ gtk_entry_style_set (GtkWidget *widget,
gtk_entry_update_ic_attr (widget);
#endif
}
if (GTK_WIDGET_DRAWABLE (widget))
gtk_widget_queue_clear(widget);
}
static void

View File

@ -445,8 +445,6 @@ gtk_handle_box_style_set (GtkWidget *widget,
widget->state);
gtk_style_set_background (widget->style, hb->bin_window, widget->state);
gtk_style_set_background (widget->style, hb->float_window, widget->state);
if (GTK_WIDGET_DRAWABLE (widget))
gdk_window_clear (widget->window);
}
}

View File

@ -1396,7 +1396,6 @@ gtk_notebook_style_set (GtkWidget *widget,
gdk_window_clear (widget->window);
}
gtk_widget_queue_draw (widget);
gtk_notebook_set_shape (GTK_NOTEBOOK(widget));
}

View File

@ -49,10 +49,12 @@ struct _GtkPaned
GdkWindow *handle;
GdkRectangle groove_rectangle;
GdkGC *xor_gc;
/*< public >*/
guint16 handle_size;
guint16 gutter_size;
/*< private >*/
gint child1_size;
gint last_allocation;
gint min_position;

View File

@ -1561,10 +1561,21 @@ gtk_range_style_set (GtkWidget *widget,
if (range->slider)
gtk_style_set_background (widget->style, range->slider, GTK_STATE_NORMAL);
/* The backgrounds of the step_forw and step_back never actually
* get drawn in draw calls, so we call gdk_window_clear() here
* so they get the correct colors. This is a hack. OWT.
*/
if (range->step_forw)
gtk_style_set_background (widget->style, range->step_forw, GTK_STATE_ACTIVE);
{
gtk_style_set_background (widget->style, range->step_forw, GTK_STATE_ACTIVE);
gdk_window_clear (range->step_forw);
}
if (range->step_back)
gtk_style_set_background (widget->style, range->step_back, GTK_STATE_ACTIVE);
{
gtk_style_set_background (widget->style, range->step_back, GTK_STATE_ACTIVE);
gdk_window_clear (range->step_back);
}
}
}

View File

@ -1427,9 +1427,6 @@ gtk_text_style_set (GtkWidget *widget,
if (text->current_font)
text_font_unref (text->current_font);
text->current_font = get_text_font (widget->style->font);
if (GTK_WIDGET_DRAWABLE (widget))
gdk_window_clear (widget->window);
}
static void

View File

@ -838,10 +838,5 @@ gtk_viewport_style_set (GtkWidget *widget,
gtk_style_set_background (widget->style, viewport->bin_window, GTK_STATE_NORMAL);
gtk_style_set_background (widget->style, widget->window, widget->state);
if (GTK_WIDGET_DRAWABLE (widget))
{
gdk_window_clear (widget->window);
gdk_window_clear (viewport->bin_window);
}
}
}

View File

@ -3456,11 +3456,7 @@ gtk_widget_style_set (GtkWidget *widget,
{
if (GTK_WIDGET_REALIZED (widget) &&
!GTK_WIDGET_NO_WINDOW (widget))
{
gtk_style_set_background (widget->style, widget->window, widget->state);
if (GTK_WIDGET_DRAWABLE (widget))
gdk_window_clear (widget->window);
}
gtk_style_set_background (widget->style, widget->window, widget->state);
}
static void

View File

@ -103,8 +103,6 @@ static void gtk_window_paint (GtkWidget *widget,
GdkRectangle *area);
static gint gtk_window_expose (GtkWidget *widget,
GdkEventExpose *event);
static void gtk_window_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void gtk_window_unset_transient_for (GtkWindow *window);
static void gtk_window_transient_parent_realized (GtkWidget *parent,
GtkWidget *window);
@ -196,7 +194,6 @@ gtk_window_class_init (GtkWindowClass *klass)
widget_class->focus_in_event = gtk_window_focus_in_event;
widget_class->focus_out_event = gtk_window_focus_out_event;
widget_class->client_event = gtk_window_client_event;
widget_class->style_set = gtk_window_style_set;
widget_class->draw = gtk_window_draw;
widget_class->expose_event = gtk_window_expose;
@ -1696,25 +1693,3 @@ gtk_window_draw (GtkWidget *widget,
if (GTK_WIDGET_CLASS (parent_class)->draw)
(* GTK_WIDGET_CLASS (parent_class)->draw) (widget, area);
}
static void
gtk_window_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
GdkRectangle area;
if (GTK_WIDGET_REALIZED (widget) &&
!GTK_WIDGET_NO_WINDOW (widget))
{
gtk_style_set_background (widget->style, widget->window, widget->state);
area.x = 0;
area.y = 0;
area.width = widget->allocation.width;
area.height = widget->allocation.height;
gtk_window_draw(widget, &area);
if (GTK_WIDGET_DRAWABLE (widget))
gdk_window_clear (widget->window);
}
}