From b717f1b265d6614ad3b0868b60fded79029b3d3a Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 8 Sep 2010 20:56:36 +0200 Subject: filechooserentry: Connect to draw event --- gtk/gtkfilechooserentry.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'gtk/gtkfilechooserentry.c') diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c index 70f76a66d9..54c69cecde 100644 --- a/gtk/gtkfilechooserentry.c +++ b/gtk/gtkfilechooserentry.c @@ -882,26 +882,23 @@ gtk_file_chooser_entry_unmap (GtkWidget *widget) } static gboolean -completion_feedback_window_expose_event_cb (GtkWidget *widget, - GdkEventExpose *event, - gpointer data) +completion_feedback_window_draw_cb (GtkWidget *widget, + cairo_t *cr, + gpointer data) { /* Stolen from gtk_tooltip_paint_window() */ GtkFileChooserEntry *chooser_entry = GTK_FILE_CHOOSER_ENTRY (data); - GtkAllocation allocation; - gtk_widget_get_allocation (chooser_entry->completion_feedback_window, &allocation); - - gtk_paint_flat_box (gtk_widget_get_style (chooser_entry->completion_feedback_window), - gtk_widget_get_window (chooser_entry->completion_feedback_window), + gtk_cairo_paint_flat_box (gtk_widget_get_style (chooser_entry->completion_feedback_window), + cr, GTK_STATE_NORMAL, GTK_SHADOW_OUT, - NULL, chooser_entry->completion_feedback_window, "tooltip", 0, 0, - allocation.width, allocation.height); + gtk_widget_get_allocated_width (widget), + gtk_widget_get_allocated_height (widget)); return FALSE; } @@ -954,8 +951,8 @@ create_completion_feedback_window (GtkFileChooserEntry *chooser_entry) gtk_container_add (GTK_CONTAINER (chooser_entry->completion_feedback_window), alignment); gtk_widget_show (alignment); - g_signal_connect (chooser_entry->completion_feedback_window, "expose-event", - G_CALLBACK (completion_feedback_window_expose_event_cb), chooser_entry); + g_signal_connect (chooser_entry->completion_feedback_window, "draw", + G_CALLBACK (completion_feedback_window_draw_cb), chooser_entry); g_signal_connect (chooser_entry->completion_feedback_window, "realize", G_CALLBACK (completion_feedback_window_realize_cb), chooser_entry); /* FIXME: connect to motion-notify-event, and *show* the cursor when the mouse moves */ -- cgit v1.2.1