[gnumeric] enable acceptance of tab label editing by button event



commit 887f560164dce089e100cd10d058fb66c7c341c0
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu Aug 4 13:48:17 2011 -0600

    enable acceptance of tab label editing by button event
    
    2011-08-04  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* widget-editable-label.c (el_button_press_event): enable acitivation
    	by button event

 NEWS                                |    2 +-
 src/widgets/ChangeLog               |    5 +++++
 src/widgets/widget-editable-label.c |   13 +++++++------
 3 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/NEWS b/NEWS
index 642c8e8..d8f89cd 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,7 @@ Andreas:
 	* Use formatting attributes whenever we format numbers. 
 	[#584380][#651561]
 	* Clarify the distinction beween open/save and import/export.
-	* FIx enabling of modify comment or hyperlink. [#655877]
+	* Fix enabling of modify comment or hyperlink. [#655877]
 
 Jean:
 	* Make things build against gtk+-3.0.
diff --git a/src/widgets/ChangeLog b/src/widgets/ChangeLog
index 075c82c..c022ca8 100644
--- a/src/widgets/ChangeLog
+++ b/src/widgets/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-04  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* widget-editable-label.c (el_button_press_event): enable acitivation
+	by button event
+
 2011-08-04  Jean Brefort  <jean brefort normalesup org>
 
 	* gnm-notebook.c (gnm_notebook_init): make it scrollable.
diff --git a/src/widgets/widget-editable-label.c b/src/widgets/widget-editable-label.c
index 6177e35..af38ae7 100644
--- a/src/widgets/widget-editable-label.c
+++ b/src/widgets/widget-editable-label.c
@@ -167,12 +167,13 @@ el_button_press_event (GtkWidget *widget, GdkEventButton *button)
 {
 	EditableLabel *el = EDITABLE_LABEL (widget);
 
-	/* if (button->window != gtk_widget_get_window (widget)) { */
-	/* 	/\* Accept the name change *\/ */
-	/* 	el_entry_activate (GTK_ENTRY (el), NULL); */
-	/* 	gdk_event_put ((GdkEvent *)button); */
-	/* 	return TRUE; */
-	/* } */
+	if (gtk_editable_get_editable (GTK_EDITABLE (el)) && 
+	    button->window != gtk_widget_get_window (widget)) {
+		/* Accept the name change */
+		el_entry_activate (GTK_ENTRY (el), NULL);
+		gdk_event_put ((GdkEvent *)button);
+		return TRUE;
+	}
 
 	if (button->type == GDK_2BUTTON_PRESS) {
 		editable_label_start_editing (el);



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