From: John Darrington Date: Sun, 30 Nov 2008 02:27:30 +0000 (+0900) Subject: Improve drawing of active cell border X-Git-Tag: v0.7.1~95 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d2bec58576acd3fe7dd53b29bfbf3ddf5948ec9;p=pspp-builds.git Improve drawing of active cell border --- diff --git a/lib/gtksheet/gtksheet.c b/lib/gtksheet/gtksheet.c index b908693e..194bf25e 100644 --- a/lib/gtksheet/gtksheet.c +++ b/lib/gtksheet/gtksheet.c @@ -1709,7 +1709,7 @@ gtk_sheet_style_set (GtkWidget *widget, } -#define BORDER_WIDTH 4 +#define BORDER_WIDTH 2 static void gtk_sheet_realize (GtkWidget *widget) @@ -2951,10 +2951,10 @@ gtk_sheet_draw_border (GtkSheet *sheet, GtkSheetRange new_range) gdk_draw_rectangle (sheet->sheet_window, sheet->xor_gc, FALSE, - area.x - BORDER_WIDTH / 2, - area.y - BORDER_WIDTH / 2, - area.width + BORDER_WIDTH, - area.height + BORDER_WIDTH); + area.x, + area.y, + area.width + 1, + area.height + 1); } @@ -4537,6 +4537,12 @@ gtk_sheet_size_allocate_entry (GtkSheet *sheet) rectangle_from_cell (sheet, sheet->active_cell.row, sheet->active_cell.col, &entry_alloc); + entry_alloc.width -= BORDER_WIDTH; + entry_alloc.height -= BORDER_WIDTH; + entry_alloc.x += BORDER_WIDTH / 2; + entry_alloc.y += BORDER_WIDTH / 2; + + gtk_widget_set_size_request (sheet->entry_widget, entry_alloc.width, entry_alloc.height); gtk_widget_size_allocate (sheet->entry_widget, &entry_alloc); @@ -4556,6 +4562,13 @@ create_sheet_entry (GtkSheet *sheet) gtk_widget_size_request (sheet->entry_widget, NULL); + if ( GTK_IS_ENTRY (sheet->entry_widget)) + { + g_object_set (sheet->entry_widget, + "has-frame", FALSE, + NULL); + } + if (GTK_WIDGET_REALIZED (sheet)) { gtk_widget_set_parent_window (sheet->entry_widget, sheet->sheet_window);