From: John Darrington Date: Sun, 30 Nov 2008 03:06:40 +0000 (+0900) Subject: Fixed problem when double clicking on column header X-Git-Tag: v0.7.1~94 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3fb5df541147f31335d86850d5f4dd2568c5c72;p=pspp-builds.git Fixed problem when double clicking on column header --- diff --git a/lib/gtksheet/gtksheet.c b/lib/gtksheet/gtksheet.c index 194bf25e..010778c7 100644 --- a/lib/gtksheet/gtksheet.c +++ b/lib/gtksheet/gtksheet.c @@ -2582,8 +2582,6 @@ change_active_cell (GtkSheet *sheet, gint row, gint col) gtk_sheet_range_draw (sheet, &r); } - - sheet->range.row0 = row; sheet->range.col0 = col; sheet->range.rowi = row; diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index e08f414d..d0a6b808 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -123,22 +123,27 @@ static void popup_cases_menu (GtkSheet *sheet, gint row, static gboolean on_data_column_clicked (PsppireDataEditor *de, gint col, gpointer data) { - + GtkSheetRange visible_range; gint current_row, current_column; - gtk_notebook_set_current_page (GTK_NOTEBOOK (de), PSPPIRE_DATA_EDITOR_VARIABLE_VIEW); + gtk_notebook_set_current_page (GTK_NOTEBOOK (de), + PSPPIRE_DATA_EDITOR_VARIABLE_VIEW); gtk_sheet_get_active_cell (GTK_SHEET (de->var_sheet), ¤t_row, ¤t_column); gtk_sheet_set_active_cell (GTK_SHEET (de->var_sheet), col, current_column); - return FALSE; -} + gtk_sheet_get_visible_range (GTK_SHEET (de->var_sheet), &visible_range); + if ( col < visible_range.row0 || col > visible_range.rowi) + gtk_sheet_moveto (GTK_SHEET (de->var_sheet), col, current_column, 0.5, 0.5); + return FALSE; +} + /* Callback which occurs when the var sheet's row title button is double clicked */ @@ -159,10 +164,7 @@ on_var_row_clicked (PsppireDataEditor *de, gint row, gpointer data) gtk_sheet_get_visible_range (GTK_SHEET (de->data_sheet[0]), &visible_range); if ( row < visible_range.col0 || row > visible_range.coli) - { - gtk_sheet_moveto (GTK_SHEET (de->data_sheet[0]), - -1, row, 0, 0); - } + gtk_sheet_moveto (GTK_SHEET (de->data_sheet[0]), -1, row, 0.5, 0.5); return FALSE; }