diff --git a/ChangeLog b/ChangeLog index b52ae5a7ef..a8a0c4228a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +Thu Aug 6 16:49:25 1998 Owen Taylor + + * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a + drawing area, draw in an expose handler. + + * gtk/gtknotebook.c (gtk_notebook_expose): Check for + empty current page. + +Wed Aug 5 16:13:15 1998 Owen Taylor + + * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved + creation of GC's so that they will be set before + they are used for map events (why are they used there?) + + * gtk/gtkwidget.c: Fixed mistake that caused widgets to + be queued in multiple times in the queue. + +Wed Aug 5 14:23:52 1998 Owen Taylor + + * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set + clip rects (or do anything) for shadow_none. + +Wed Aug 5 13:14:57 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Restored paint function. + Yes, it was needed. draw() and expose() are _not_ + identical.su + + Tue Aug 4 19:12:14 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index b52ae5a7ef..a8a0c4228a 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,32 @@ +Thu Aug 6 16:49:25 1998 Owen Taylor + + * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a + drawing area, draw in an expose handler. + + * gtk/gtknotebook.c (gtk_notebook_expose): Check for + empty current page. + +Wed Aug 5 16:13:15 1998 Owen Taylor + + * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved + creation of GC's so that they will be set before + they are used for map events (why are they used there?) + + * gtk/gtkwidget.c: Fixed mistake that caused widgets to + be queued in multiple times in the queue. + +Wed Aug 5 14:23:52 1998 Owen Taylor + + * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set + clip rects (or do anything) for shadow_none. + +Wed Aug 5 13:14:57 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Restored paint function. + Yes, it was needed. draw() and expose() are _not_ + identical.su + + Tue Aug 4 19:12:14 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b52ae5a7ef..a8a0c4228a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,32 @@ +Thu Aug 6 16:49:25 1998 Owen Taylor + + * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a + drawing area, draw in an expose handler. + + * gtk/gtknotebook.c (gtk_notebook_expose): Check for + empty current page. + +Wed Aug 5 16:13:15 1998 Owen Taylor + + * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved + creation of GC's so that they will be set before + they are used for map events (why are they used there?) + + * gtk/gtkwidget.c: Fixed mistake that caused widgets to + be queued in multiple times in the queue. + +Wed Aug 5 14:23:52 1998 Owen Taylor + + * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set + clip rects (or do anything) for shadow_none. + +Wed Aug 5 13:14:57 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Restored paint function. + Yes, it was needed. draw() and expose() are _not_ + identical.su + + Tue Aug 4 19:12:14 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index b52ae5a7ef..a8a0c4228a 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,32 @@ +Thu Aug 6 16:49:25 1998 Owen Taylor + + * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a + drawing area, draw in an expose handler. + + * gtk/gtknotebook.c (gtk_notebook_expose): Check for + empty current page. + +Wed Aug 5 16:13:15 1998 Owen Taylor + + * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved + creation of GC's so that they will be set before + they are used for map events (why are they used there?) + + * gtk/gtkwidget.c: Fixed mistake that caused widgets to + be queued in multiple times in the queue. + +Wed Aug 5 14:23:52 1998 Owen Taylor + + * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set + clip rects (or do anything) for shadow_none. + +Wed Aug 5 13:14:57 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Restored paint function. + Yes, it was needed. draw() and expose() are _not_ + identical.su + + Tue Aug 4 19:12:14 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b52ae5a7ef..a8a0c4228a 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,32 @@ +Thu Aug 6 16:49:25 1998 Owen Taylor + + * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a + drawing area, draw in an expose handler. + + * gtk/gtknotebook.c (gtk_notebook_expose): Check for + empty current page. + +Wed Aug 5 16:13:15 1998 Owen Taylor + + * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved + creation of GC's so that they will be set before + they are used for map events (why are they used there?) + + * gtk/gtkwidget.c: Fixed mistake that caused widgets to + be queued in multiple times in the queue. + +Wed Aug 5 14:23:52 1998 Owen Taylor + + * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set + clip rects (or do anything) for shadow_none. + +Wed Aug 5 13:14:57 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Restored paint function. + Yes, it was needed. draw() and expose() are _not_ + identical.su + + Tue Aug 4 19:12:14 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b52ae5a7ef..a8a0c4228a 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,32 @@ +Thu Aug 6 16:49:25 1998 Owen Taylor + + * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a + drawing area, draw in an expose handler. + + * gtk/gtknotebook.c (gtk_notebook_expose): Check for + empty current page. + +Wed Aug 5 16:13:15 1998 Owen Taylor + + * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved + creation of GC's so that they will be set before + they are used for map events (why are they used there?) + + * gtk/gtkwidget.c: Fixed mistake that caused widgets to + be queued in multiple times in the queue. + +Wed Aug 5 14:23:52 1998 Owen Taylor + + * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set + clip rects (or do anything) for shadow_none. + +Wed Aug 5 13:14:57 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Restored paint function. + Yes, it was needed. draw() and expose() are _not_ + identical.su + + Tue Aug 4 19:12:14 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b52ae5a7ef..a8a0c4228a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,32 @@ +Thu Aug 6 16:49:25 1998 Owen Taylor + + * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a + drawing area, draw in an expose handler. + + * gtk/gtknotebook.c (gtk_notebook_expose): Check for + empty current page. + +Wed Aug 5 16:13:15 1998 Owen Taylor + + * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved + creation of GC's so that they will be set before + they are used for map events (why are they used there?) + + * gtk/gtkwidget.c: Fixed mistake that caused widgets to + be queued in multiple times in the queue. + +Wed Aug 5 14:23:52 1998 Owen Taylor + + * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set + clip rects (or do anything) for shadow_none. + +Wed Aug 5 13:14:57 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Restored paint function. + Yes, it was needed. draw() and expose() are _not_ + identical.su + + Tue Aug 4 19:12:14 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index cab7324e04..698d1a987f 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -1790,7 +1790,8 @@ gtk_notebook_expose (GtkWidget *widget, notebook = GTK_NOTEBOOK (widget); gtk_notebook_paint (widget, &event->area); - if (gtk_widget_intersect (notebook->cur_page->tab_label, + if (notebook->cur_page && + gtk_widget_intersect (notebook->cur_page->tab_label, &event->area, &child_area)) gtk_widget_draw_focus (widget); diff --git a/gtk/gtktooltips.c b/gtk/gtktooltips.c index 4bcae6bdcf..f3e6508918 100644 --- a/gtk/gtktooltips.c +++ b/gtk/gtktooltips.c @@ -20,6 +20,7 @@ #include #include +#include "gtkdrawingarea.h" #include "gtkmain.h" #include "gtkwidget.h" #include "gtkwindow.h" @@ -44,6 +45,9 @@ static void gtk_tooltips_set_active_widget (GtkTooltips *tooltips, GtkWidget *widget); static gint gtk_tooltips_timeout (gpointer data); static void gtk_tooltips_create_window (GtkTooltips *tooltips); +static gint gtk_tooltips_expose (GtkTooltips *tooltips, + GdkEventExpose *event); + static void gtk_tooltips_draw_tips (GtkTooltips *tooltips); static GtkDataClass *parent_class; @@ -171,10 +175,19 @@ gtk_tooltips_destroy (GtkObject *object) static void gtk_tooltips_create_window (GtkTooltips *tooltips) { + GtkWidget *darea; + tooltips->tip_window = gtk_window_new (GTK_WINDOW_POPUP); gtk_widget_ref (tooltips->tip_window); gtk_window_set_policy (GTK_WINDOW (tooltips->tip_window), FALSE, FALSE, TRUE); - gtk_widget_realize (tooltips->tip_window); + + darea = gtk_drawing_area_new (); + gtk_container_add (GTK_CONTAINER (tooltips->tip_window), darea); + gtk_widget_show (darea); + + gtk_signal_connect_object (GTK_OBJECT (darea), "expose_event", + GTK_SIGNAL_FUNC (gtk_tooltips_expose), + GTK_OBJECT (tooltips)); } static void @@ -374,10 +387,55 @@ gtk_tooltips_set_colors (GtkTooltips *tooltips, tooltips->background = background; } +static gint +gtk_tooltips_expose (GtkTooltips *tooltips, GdkEventExpose *event) +{ + GtkWidget *darea; + GtkStyle *style; + gint y, baseline_skip, gap; + GtkTooltipsData *data; + GList *el; + + darea = GTK_BIN (tooltips->tip_window)->child; + style = darea->style; + + gap = (style->font->ascent + style->font->descent) / 4; + if (gap < 2) + gap = 2; + baseline_skip = style->font->ascent + style->font->descent + gap; + + data = tooltips->active_tips_data; + + gtk_paint_flat_box(style, darea->window, + GTK_STATE_NORMAL, GTK_SHADOW_OUT, + NULL, GTK_WIDGET(darea), "tooltip", + 0, 0, -1, -1); + + y = style->font->ascent + 4; + + for (el = data->row; el; el = el->next) + { + if (el->data) + { + /* gdk_draw_string (tooltips->tip_window->window, style->font, + tooltips->gc, 4, y, el->data);*/ + gtk_paint_string (style, darea->window, + GTK_STATE_NORMAL, + NULL, GTK_WIDGET(darea), "tooltip", + 4, y, el->data); + y += baseline_skip; + } + else + y += baseline_skip / 2; + } + + return FALSE; +} + static void gtk_tooltips_draw_tips (GtkTooltips * tooltips) { - GtkWidget *widget; + GtkWidget *widget, *darea; GtkStyle *style; gint gap, x, y, w, h, scr_w, scr_h, baseline_skip; GtkTooltipsData *data; @@ -388,7 +446,8 @@ gtk_tooltips_draw_tips (GtkTooltips * tooltips) else if (GTK_WIDGET_VISIBLE (tooltips->tip_window)) gtk_widget_hide (tooltips->tip_window); - style = tooltips->tip_window->style; + darea = GTK_BIN (tooltips->tip_window)->child; + style = darea->style; widget = tooltips->active_tips_data->widget; @@ -403,6 +462,7 @@ gtk_tooltips_draw_tips (GtkTooltips * tooltips) if (gap < 2) gap = 2; baseline_skip = style->font->ascent + style->font->descent + gap; + w = data->width; h = 8 - gap; for (el = data->row; el; el = el->next) @@ -462,29 +522,8 @@ gtk_tooltips_draw_tips (GtkTooltips * tooltips) gdk_draw_rectangle (tooltips->tip_window->window, tooltips->gc, FALSE, 0, 0, w, h); */ - gtk_paint_flat_box(tooltips->tip_window->style, - tooltips->tip_window->window, - GTK_STATE_NORMAL, GTK_SHADOW_OUT, - NULL, GTK_WIDGET(tooltips->tip_window), "tooltip", - 0, 0, w, h); + - y = style->font->ascent + 4; - - for (el = data->row; el; el = el->next) - { - if (el->data) - { -/* gdk_draw_string (tooltips->tip_window->window, style->font, - tooltips->gc, 4, y, el->data);*/ - gtk_paint_string (tooltips->tip_window->style, tooltips->tip_window->window, - GTK_STATE_NORMAL, - NULL, GTK_WIDGET(tooltips), "tooltip", - 4, y, el->data); - y += baseline_skip; - } - else - y += baseline_skip / 2; - } } static gint