[banshee] [NowPlaying] Double click toggles fullscreen



commit 76b28e1e6f49614f309eef14274a57a30747757a
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Mon Nov 16 19:21:35 2009 -0800

    [NowPlaying] Double click toggles fullscreen
    
    Only works for track info screen, not when video is playing back.
    Fixes BGO #577971

 .../Banshee.NowPlaying/NowPlayingContents.cs       |   14 +++++++++-----
 .../Banshee.NowPlaying/NowPlayingInterface.cs      |    9 +++++++++
 2 files changed, 18 insertions(+), 5 deletions(-)
---
diff --git a/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs b/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs
index 39e31a6..0a14b5f 100644
--- a/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs
+++ b/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs
@@ -33,16 +33,20 @@ using Banshee.Gui.Widgets;
 
 namespace Banshee.NowPlaying
 {
-    public class NowPlayingContents : Table, IDisposable
+    public class NowPlayingContents : EventBox, IDisposable
     {
+        private Table table;
         private Widget video_display;
         private bool video_display_initial_shown = false;
 
         private TrackInfoDisplay track_info_display;
 
-        public NowPlayingContents () : base (1, 1, false)
+        public NowPlayingContents ()
         {
-            NoShowAll = true;
+            VisibleWindow = false;
+            Child = table = new Table (1, 1, false) { Visible = true };
+
+            table.NoShowAll = true;
 
             video_display = new XOverlayVideoDisplay ();
 
@@ -51,12 +55,12 @@ namespace Banshee.NowPlaying
                 ivideo_display.IdleStateChanged += OnVideoDisplayIdleStateChanged;
             }
 
-            Attach (video_display, 0, 1, 0, 1,
+            table.Attach (video_display, 0, 1, 0, 1,
                 AttachOptions.Expand | AttachOptions.Fill,
                 AttachOptions.Expand | AttachOptions.Fill, 0, 0);
 
             track_info_display = new NowPlayingTrackInfoDisplay ();
-            Attach (track_info_display, 0, 1, 0, 1,
+            table.Attach (track_info_display, 0, 1, 0, 1,
                 AttachOptions.Expand | AttachOptions.Fill,
                 AttachOptions.Expand | AttachOptions.Fill, 0, 0);
         }
diff --git a/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs b/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs
index 99fe962..a8e8966 100644
--- a/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs
+++ b/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs
@@ -53,6 +53,15 @@ namespace Banshee.NowPlaying
             GtkElementsService service = ServiceManager.Get<GtkElementsService> ();
 
             contents = new NowPlayingContents ();
+            contents.ButtonPressEvent += (o, a) => {
+                if (a.Event.Type == Gdk.EventType.TwoButtonPress) {
+                    var iaservice = ServiceManager.Get<InterfaceActionService> ();
+                    var action = iaservice.ViewActions["FullScreenAction"] as Gtk.ToggleAction;
+                    if (action != null && action.Sensitive) {
+                        action.Active = !action.Active;
+                    }
+                }
+            };
 
             // This is my really sweet hack - it's where the video widget
             // is sent when the source is not active. This keeps the video



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