[pitivi] viewer: Focus back the timeline when using the buttons



commit ea0149f3f19f58509f05c29249990ecacbd976a5
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Tue Jan 14 16:42:49 2014 +0100

    viewer: Focus back the timeline when using the buttons
    
    This means the button will lose focus when it's activated. The goal is
    for the timeline actions to remain enabled, as they are disabled when
    the timeline or ruler loses focus.

 pitivi/mainwindow.py |    3 +++
 pitivi/viewer.py     |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index 3fd6e13..d1c4cd6 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -544,6 +544,9 @@ class PitiviMainWindow(Gtk.Window, Loggable):
         self._fullscreenToolbarDirection = None
         return False
 
+    def focusTimeline(self):
+        self.timeline_ui.grab_focus()
+
 ## Missing Plugin Support
 
     def _installPlugins(self, details, missingPluginsCallback):
diff --git a/pitivi/viewer.py b/pitivi/viewer.py
index 0f5bd10..81a55e0 100644
--- a/pitivi/viewer.py
+++ b/pitivi/viewer.py
@@ -339,21 +339,26 @@ class ViewerContainer(Gtk.VBox, Loggable):
 
     def _playButtonCb(self, unused_button, unused_playing):
         self.app.current_project.pipeline.togglePlayback()
+        self.app.gui.focusTimeline()
 
     def _goToStartCb(self, unused_button):
         self.seeker.seek(0)
+        self.app.gui.focusTimeline()
 
     def _backCb(self, unused_button):
         # Seek backwards one second
         self.seeker.seekRelative(0 - Gst.SECOND)
+        self.app.gui.focusTimeline()
 
     def _forwardCb(self, unused_button):
         # Seek forward one second
         self.seeker.seekRelative(Gst.SECOND)
+        self.app.gui.focusTimeline()
 
     def _goToEndCb(self, unused_button):
         end = self.app.current_project.pipeline.getDuration()
         self.seeker.seek(end)
+        self.app.gui.focusTimeline()
 
     ## public methods for controlling playback
 


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