[banshee] GrabFocus on the current entry on TrackEditor fwd/back, so its contents is selected



commit b89b8d377e3fd7a19e00ab977dab9f57dac41138
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Mon May 11 10:10:36 2009 -0500

    GrabFocus on the current entry on TrackEditor fwd/back, so its contents is selected
---
 .../Banshee.Gui.TrackEditor/TrackEditorDialog.cs   |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
index 099bb66..0943eb5 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
@@ -397,8 +397,21 @@ namespace Banshee.Gui.TrackEditor
                 nav_backward_button.Sensitive = CanGoBackward;
                 nav_forward_button.Sensitive = CanGoForward;
             }
+
+            // If there was a widget focused already (eg the Title entry), GrabFocus on it,
+            // which causes its text to be selected, ready for editing.
+            Widget child = FocusChild;
+            while (child != null) {
+                Container container = child as Container;
+                if (container != null) {
+                    child = container.FocusChild;
+                } else if (child != null) {
+                    child.GrabFocus ();
+                    child = null;
+                }
+            }
         }
-        
+
         public void ForeachNonCurrentTrack (EditorTrackOperationClosure closure)
         {
             for (int i = 0; i < TrackCount; i++) {



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