[gnumeric] Make buttons 1 and 2 behave similarly when selecting cells. [#700792]
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Make buttons 1 and 2 behave similarly when selecting cells. [#700792]
- Date: Mon, 27 May 2013 04:40:31 +0000 (UTC)
commit bb82e2db510ceb0c59d1dba13ad75c93cdf8d734
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Sun May 26 22:38:46 2013 -0600
Make buttons 1 and 2 behave similarly when selecting cells. [#700792]
2013-05-26 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/item-grid.c (item_grid_button_pressed): make buttons 1 and 2
behave the same as far as cell selection is concerned. This fixes
bug #700792
(item_grid_button_released): ditto
ChangeLog | 7 +++++++
NEWS | 1 +
src/item-grid.c | 21 ++++++++++++---------
3 files changed, 20 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5db4133..314c996 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2013-05-15 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * src/item-grid.c (item_grid_button_pressed): make buttons 1 and 2
+ behave the same as far as cell selection is concerned. This fixes
+ bug #700792
+ (item_grid_button_released): ditto
+
+2013-05-15 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* src/sheet.c (sheet_get_extent): add argument to indicate whether
to include hidden cells
(cb_sheet_get_extent): handle hidden cells setting
diff --git a/NEWS b/NEWS
index aadf5a2..c4229b0 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Andreas:
* Fix editing of hyperlinks. [#700732]
* Fix conditional formatting crash. [#700969]
* Do not include hidden cells in automatic print range. [#700994]
+ * Make buttons 1 and 2 behave similarly when selecting cells. [#700792]
Darrell Tangman:
* Update documentation for Edit and Insert menus. [#700596]
diff --git a/src/item-grid.c b/src/item-grid.c
index a4e51b5..c973890 100644
--- a/src/item-grid.c
+++ b/src/item-grid.c
@@ -963,22 +963,26 @@ item_grid_button_pressed (GocItem *item, int button, double x_, double y_)
if (button == 1 && !sheet_selection_is_allowed (sheet, &pos))
return TRUE;
- /* button 1 will always change the selection, the other buttons will
+ /* Button == 1 is used to trigger hyperlinks (and possibly similar */
+ /* special cases. Otherwise button == 2 should behave exactly like */
+ /* button == 1. See bug #700792 */
+
+ /* buttons 1 and 2 will always change the selection, the other buttons will
* only effect things if the target is not already selected. */
already_selected = sv_is_pos_selected (sv, pos.col, pos.row);
- if (button == 1 || !already_selected) {
+ if (button == 1 || button == 2 || !already_selected) {
if (!(event->state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK)))
sv_selection_reset (sv);
- if (event->button != 1 || !(event->state & GDK_SHIFT_MASK) ||
+ if ((event->button != 1 && event->button != 2)
+ || !(event->state & GDK_SHIFT_MASK) ||
sv->selections == NULL) {
sv_selection_add_pos (sv, pos.col, pos.row,
(already_selected && (event->state & GDK_CONTROL_MASK)) ?
GNM_SELECTION_MODE_REMOVE :
GNM_SELECTION_MODE_ADD);
sv_make_cell_visible (sv, pos.col, pos.row, FALSE);
- } else if (event->button != 2)
- sv_selection_extend_to (sv, pos.col, pos.row);
+ } else sv_selection_extend_to (sv, pos.col, pos.row);
sheet_update (sheet);
}
@@ -986,7 +990,8 @@ item_grid_button_pressed (GocItem *item, int button, double x_, double y_)
return TRUE; /* we already ignored the button release */
switch (button) {
- case 1: {
+ case 1:
+ case 2: {
guint32 double_click_time;
/*
@@ -1013,8 +1018,6 @@ item_grid_button_pressed (GocItem *item, int button, double x_, double y_)
break;
}
- case 2: break;
-
case 3: scg_context_menu (scg, event, FALSE, FALSE);
break;
default :
@@ -1128,7 +1131,7 @@ item_grid_button_released (GocItem *item, int button, G_GNUC_UNUSED double x_, G
ItemGridSelectionType selecting = ig->selecting;
GdkEventButton *event = (GdkEventButton *) goc_canvas_get_cur_event (item->canvas);
- if (button != 1)
+ if (button != 1 && button != 2)
return FALSE;
gnm_pane_slide_stop (pane);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]