[gnome-weather] New dialog: fix activation behavior



commit 4776cd2d231b65c5491cbcff3c11f9b5cc08dad8
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Fri Mar 15 23:54:39 2013 +0100

    New dialog: fix activation behavior
    
    If we don't set the default response, pressing enter has no effect.
    At the same time, convert some property setters to JS conventions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695761

 src/window.js |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/window.js b/src/window.js
index bd55d83..f2525a9 100644
--- a/src/window.js
+++ b/src/window.js
@@ -279,16 +279,17 @@ const MainWindow = new Lang.Class({
         let grid = builder.get_object('location-dialog-content');
 
         let find_icon = Gio.ThemedIcon.new_with_default_fallbacks("edit-find-symbolic");
-        let entry = new GWeather.LocationEntry({ top: this._world });
-        entry.set_size_request(400, -1);
+        let entry = new GWeather.LocationEntry({ top: this._world,
+                                                 width_request: 400,
+                                                 activates_default: true });
         entry.set_icon_from_gicon(Gtk.EntryIconPosition.SECONDARY, find_icon);
-        entry.set_activates_default(true);
 
         grid.attach(entry, 0, 1, 1, 1);
         dialog.get_content_area().add(grid);
 
         dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL);
         dialog.add_button(Gtk.STOCK_ADD, Gtk.ResponseType.OK);
+        dialog.set_default_response(Gtk.ResponseType.OK);
 
         dialog.connect('response', Lang.bind(this, function(dialog, response) {
             dialog.destroy();


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