[gnome-maps] osmEditDialog: Focus on added fields



commit 5b17fc8c259af7d9def6833422b5b36baed0ce1c
Author: Marcus Lundblad <ml update uu se>
Date:   Thu Jun 1 21:50:19 2017 +0200

    osmEditDialog: Focus on added fields
    
    Let newly added fields grab focus in the edit view. Also grab focus on the
    comment text area when clicking “Next”.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783253

 src/osmEditDialog.js |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/osmEditDialog.js b/src/osmEditDialog.js
index 26f27ad..a0537fa 100644
--- a/src/osmEditDialog.js
+++ b/src/osmEditDialog.js
@@ -496,6 +496,7 @@ const OSMEditDialog = new Lang.Class({
         this._backButton.visible = true;
         this._cancelButton.visible = false;
         this._isEditing = false;
+        this._commentTextView.grab_focus();
     },
 
     _onCancelClicked: function() {
@@ -642,6 +643,7 @@ const OSMEditDialog = new Lang.Class({
 
         this._editorGrid.attach(entry, 1, this._currentRow, 1, 1);
         entry.show();
+        entry.grab_focus();
 
         /* TODO: should we allow deleting the name field? */
         this._addOSMEditDeleteButton(fieldSpec);
@@ -670,6 +672,7 @@ const OSMEditDialog = new Lang.Class({
 
         this._editorGrid.attach(spinbutton, 1, this._currentRow, 1, 1);
         spinbutton.show();
+        spinbutton.grab_focus();
 
         this._addOSMEditDeleteButton(fieldSpec);
         this._currentRow++;
@@ -692,6 +695,7 @@ const OSMEditDialog = new Lang.Class({
 
         this._editorGrid.attach(combobox, 1, this._currentRow, 1, 1);
         combobox.show();
+        combobox.grab_focus();
 
         this._addOSMEditDeleteButton(fieldSpec);
         this._currentRow++;
@@ -716,6 +720,7 @@ const OSMEditDialog = new Lang.Class({
 
         let rows = fieldSpec.rows || 1;
         this._editorGrid.attach(addr, 1, this._currentRow, 1, rows);
+        addr.street.grab_focus();
         this._addOSMEditDeleteButton(fieldSpec);
         this._currentRow += rows;
     },


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