[gnumeric] Implement double click for graph sheets. [#712216]



commit eefc11df00d5d21671b35ab680f52b577d292267
Author: Jean Brefort <jean brefort normalesup org>
Date:   Wed Nov 13 16:51:37 2013 +0100

    Implement double click for graph sheets. [#712216]

 ChangeLog          |    6 ++++++
 NEWS               |    3 +++
 src/sheet-object.c |   14 ++++++++++++++
 3 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 84db12c..9738c43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-13  Jean Brefort  <jean brefort normalesup org>
+
+       * src/sheet-object.c (sheet_object_view_button2_pressed),
+       (sheet_object_view_class_init): implement double click for graph sheets.
+       [#712216]
+
 2013-11-12  Morten Welinder  <terra gnome org>
 
        * src/wbc-gtk.c (cb_sheet_label_button_press): Don't stop signal
diff --git a/NEWS b/NEWS
index 3256e5b..d9cf94c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 Gnumeric 1.12.9
 
+Jean
+       * Implement double click for graph sheets. [#712216]
+
 Morten:
        * Minor improvement to history dialog.
        * Fix drop-down sizing (gtk+ regression).  [#710749]
diff --git a/src/sheet-object.c b/src/sheet-object.c
index 8e8b336..1100c9f 100644
--- a/src/sheet-object.c
+++ b/src/sheet-object.c
@@ -1451,6 +1451,19 @@ sheet_object_view_button_pressed (GocItem *item, int button, double x, double y)
        return TRUE;
 }
 
+static gboolean
+sheet_object_view_button2_pressed (GocItem *item, int button, double x, double y)
+{
+       if (button == 1 && !IS_GNM_PANE (item->canvas)) {
+               SheetControl *sc = SHEET_CONTROL (g_object_get_data (G_OBJECT (item->canvas), 
"sheet-control"));
+               SheetObject *so = (SheetObject *) g_object_get_qdata (G_OBJECT (item), sov_so_quark);
+
+               if (sc && sheet_object_can_edit (so))
+                       sheet_object_get_editor (so, sc);
+       }
+       return TRUE;
+}
+
 static void
 sheet_object_view_finalize (GObject *obj)
 {
@@ -1470,6 +1483,7 @@ sheet_object_view_class_init (GocItemClass *item_klass)
 
        item_klass->enter_notify = sheet_object_view_enter_notify;
        item_klass->button_pressed = sheet_object_view_button_pressed;
+       item_klass->button2_pressed = sheet_object_view_button2_pressed;
 }
 
 GSF_CLASS (SheetObjectView, sheet_object_view,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]