X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpspp-sheet-view.c;h=cd4999301f6539a13d95dc21d5c32e050108b503;hb=171bd1341565bf922cd3361e564d3d02b18c9547;hp=534409ebb583cbabce8d709bd6590182a7fe9b55;hpb=0b0ca44889e637251cb5f2dbf3c7fdc4ec8b9bd7;p=pspp diff --git a/src/ui/gui/pspp-sheet-view.c b/src/ui/gui/pspp-sheet-view.c index 534409ebb5..cd4999301f 100644 --- a/src/ui/gui/pspp-sheet-view.c +++ b/src/ui/gui/pspp-sheet-view.c @@ -3766,22 +3766,25 @@ pspp_sheet_view_draw_grid_lines (PsppSheetView *tree_view, for (list = tree_view->priv->columns; list; list = list->next, i++) { PsppSheetViewColumn *column = list->data; - - /* We don't want a line for the last column */ - if (i == n_visible_columns - 1) - break; + gint x; if (! column->visible) continue; current_x += column->width; - if (current_x - 1 >= event->area.x - && current_x - 1 < event->area.x + event->area.width) + /* Generally the grid lines should fit within the column, but for the + last visible column we put it just past the end of the column. + (Otherwise horizontal grid lines sometimes stick out by one pixel.) */ + x = current_x; + if (i != n_visible_columns - 1) + x--; + + if (x >= event->area.x && x < event->area.x + event->area.width) gdk_draw_line (event->window, tree_view->priv->grid_line_gc[GTK_WIDGET(tree_view)->state], - current_x - 1, min_y, - current_x - 1, max_y - min_y); + x, min_y, + x, max_y - min_y); } } @@ -4165,7 +4168,7 @@ pspp_sheet_view_bin_expose (GtkWidget *widget, background_area.x + background_area.width, background_area.y); - if (y_offset + max_height >= event->area.height) + if (y_offset + max_height <= event->area.height) gdk_draw_line (event->window, tree_view->priv->grid_line_gc[widget->state], background_area.x, background_area.y + max_height, @@ -6606,7 +6609,9 @@ pspp_sheet_view_focus_column (PsppSheetView *tree_view, if (!focus_column->button) { pspp_sheet_view_column_set_need_button (focus_column, TRUE); - g_return_if_fail (focus_column->button != NULL); + // g_return_if_fail (focus_column->button != NULL); + if (focus_column->button == NULL) + return; } if (GTK_CONTAINER (tree_view)->focus_child != focus_column->button) @@ -8553,9 +8558,9 @@ send_focus_change (GtkWidget *widget, g_object_ref (widget); if (in) - GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS); - else - GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS); + GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS); + else + GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS); fevent->focus_change.type = GDK_FOCUS_CHANGE; fevent->focus_change.window = g_object_ref (widget->window);