[Banshee-List] [PATCH] Add a AutoShowPlaybackControls property which is set to true when fullscreened.



---
 .../Banshee.NowPlaying/FullscreenWindow.cs         |   20 +++++++++++++++++---
 .../Banshee.NowPlaying/NowPlayingInterface.cs      |    4 +++-
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs b/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs
index 38f0352..f32e8b2 100644
--- a/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs
+++ b/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs
@@ -42,6 +42,7 @@ namespace Banshee.NowPlaying
         private Gtk.Window parent;
         private FullscreenControls controls;
         private InterfaceActionService action_service;
+        private bool auto_show_controls;
         
         public FullscreenWindow (Window parent) : base (WindowType.Toplevel)
         {
@@ -50,6 +51,7 @@ namespace Banshee.NowPlaying
             
             this.parent = parent;
             this.action_service = ServiceManager.Get<InterfaceActionService> ();
+            this.auto_show_controls = false;
             
             AddAccelGroup (action_service.UIManager.AccelGroup);
         }
@@ -92,12 +94,14 @@ namespace Banshee.NowPlaying
                 case Gdk.Key.Right:
                 case Gdk.Key.rightarrow:
                     player.Position += mod ? fast_seek : slow_seek;
-                    ShowControls ();
+                    if (auto_show_controls)
+                        ShowControls ();
                     break;
                 case Gdk.Key.Left:
                 case Gdk.Key.leftarrow:
                     player.Position -= mod ? fast_seek : slow_seek;
-                    ShowControls ();
+                    if (auto_show_controls)
+                        ShowControls ();
                     break;
             }
             
@@ -127,11 +131,14 @@ namespace Banshee.NowPlaying
         protected override void OnShown ()
         {
             base.OnShown ();
+
             if (Child != null) {
                 Child.Show ();
             }
             
-            OnHideCursorTimeout ();
+            if (auto_show_controls)
+                OnHideCursorTimeout ();
+
             HasFocus = true;
             parent.AddNotification ("is-active", ParentActiveNotification);
         }
@@ -201,6 +208,10 @@ namespace Banshee.NowPlaying
             }
         }
      
+        public bool AutoShowPlaybackControls {
+            get { return auto_show_controls; }
+            set { auto_show_controls = value; }
+        }
 #endregion
         
 #region Mouse Cursor Logic
@@ -217,6 +228,9 @@ namespace Banshee.NowPlaying
         
         protected override bool OnMotionNotifyEvent (Gdk.EventMotion evnt)
         {
+            if (!auto_show_controls)
+                return base.OnMotionNotifyEvent (evnt);
+
             if (cursor_is_hidden) {
                 if (Math.Abs (hide_cursor_x - evnt.X) > CursorShowMovementThreshold || 
                     Math.Abs (hide_cursor_y - evnt.Y) > CursorShowMovementThreshold) {
diff --git a/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs b/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs
index 5be2011..fd94499 100644
--- a/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs
+++ b/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs
@@ -42,7 +42,7 @@ namespace Banshee.NowPlaying
     {   
         private NowPlayingSource source;
         private Hyena.Widgets.RoundedFrame frame;
-        private Gtk.Window video_window;
+        private FullscreenWindow video_window;
         private FullscreenAdapter fullscreen_adapter;
         private ScreensaverManager screensaver;
         private NowPlayingContents contents;
@@ -157,11 +157,13 @@ namespace Banshee.NowPlaying
         {
             if (fullscreen) {
                 MoveVideoExternal (true);
+                video_window.AutoShowPlaybackControls = true;
                 video_window.Show ();
                 fullscreen_adapter.Fullscreen (video_window, true);
                 screensaver.Inhibit ();
             } else {
                 screensaver.UnInhibit ();
+                video_window.AutoShowPlaybackControls = false;
                 fullscreen_adapter.Fullscreen (video_window, false);
                 video_window.Hide ();
             }
-- 
1.5.6.5



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