[dia] Bug 632350 - Make Properties dialog entries activatable



commit c919a39c95a7a38d0bd9ea348a9132b1beddeab0
Author: Hans Breuer <hans breuer org>
Date:   Sun Jan 23 22:17:28 2011 +0100

    Bug 632350 - Make Properties dialog entries activatable
    
    Calls to gtk_entry_set_activates_default() enable the default OK
    button on Enter also when the focus is in one of the entry fields.

 lib/prop_inttypes.c |    3 ++-
 lib/prop_text.c     |    1 +
 lib/widgets.c       |    1 +
 3 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/lib/prop_inttypes.c b/lib/prop_inttypes.c
index 5416df2..f861495 100644
--- a/lib/prop_inttypes.c
+++ b/lib/prop_inttypes.c
@@ -62,7 +62,8 @@ charprop_copy(CharProperty *src)
 static WIDGET *
 charprop_get_widget(CharProperty *prop, PropDialog *dialog) 
 { 
-  GtkWidget *ret = gtk_entry_new();  
+  GtkWidget *ret = gtk_entry_new();
+  gtk_entry_set_activates_default(GTK_ENTRY(ret), TRUE);
   prophandler_connect(&prop->common, G_OBJECT(ret), "changed");
   return ret;
 }
diff --git a/lib/prop_text.c b/lib/prop_text.c
index 0542a28..6c3c596 100644
--- a/lib/prop_text.c
+++ b/lib/prop_text.c
@@ -86,6 +86,7 @@ static GtkWidget *
 stringprop_get_widget(StringProperty *prop, PropDialog *dialog) 
 { 
   GtkWidget *ret = gtk_entry_new();
+  gtk_entry_set_activates_default(GTK_ENTRY(ret), TRUE);
   prophandler_connect(&prop->common, G_OBJECT(ret), "changed");
   return ret;
 }
diff --git a/lib/widgets.c b/lib/widgets.c
index 63ce9e4..ba25a0b 100644
--- a/lib/widgets.c
+++ b/lib/widgets.c
@@ -1174,6 +1174,7 @@ dia_unit_spinner_new(GtkAdjustment *adjustment, DiaUnit adj_unit)
   }
   
   self = gtk_type_new(dia_unit_spinner_get_type());
+  gtk_entry_set_activates_default(GTK_ENTRY(self), TRUE);
   self->unit_num = adj_unit;
   
   gtk_spin_button_configure(GTK_SPIN_BUTTON(self),



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