From: John Darrington Date: Thu, 16 Apr 2009 13:06:31 +0000 (+0800) Subject: Improve the style handling of the column/row title buttons. X-Git-Tag: sav-api~657 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=0014b99626818f82389cc2b824eb334c232bcb50 Improve the style handling of the column/row title buttons. It seems that the style of the button wasn't `attached' before it was used. Further, use of the "buttondefault" detail on gtk_paint_box made wierd looking buttons with some themes. I don't pretend to fully understand all this, but these changes seem to be an improvement. --- diff --git a/lib/gtk-contrib/psppire-sheet.c b/lib/gtk-contrib/psppire-sheet.c index 3db8fd5bd0..bb99d1e328 100644 --- a/lib/gtk-contrib/psppire-sheet.c +++ b/lib/gtk-contrib/psppire-sheet.c @@ -1981,6 +1981,9 @@ psppire_sheet_realize (GtkWidget *widget) gtk_widget_set_parent_window (sheet->button, sheet->sheet_window); gtk_widget_set_parent (sheet->button, GTK_WIDGET (sheet)); + sheet->button->style = gtk_style_attach (sheet->button->style, + sheet->sheet_window); + sheet->cursor_drag = gdk_cursor_new_for_display (display, GDK_PLUS); @@ -4796,8 +4799,9 @@ draw_button (PsppireSheet *sheet, GdkWindow *window, gtk_paint_box (sheet->button->style, window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, - &allocation, GTK_WIDGET (sheet->button), - "buttondefault", + &allocation, + GTK_WIDGET (sheet->button), + NULL, allocation.x, allocation.y, allocation.width, allocation.height); @@ -4813,7 +4817,7 @@ draw_button (PsppireSheet *sheet, GdkWindow *window, gtk_paint_box (sheet->button->style, window, button->state, shadow_type, &allocation, GTK_WIDGET (sheet->button), - "button", + NULL, allocation.x, allocation.y, allocation.width, allocation.height); @@ -4831,7 +4835,7 @@ draw_button (PsppireSheet *sheet, GdkWindow *window, shadow_type, NULL, GTK_WIDGET (sheet), - "button", + NULL, points, 2, TRUE);