Re: [Banshee-List] [PATCH] Add the actual compact mode



Can you please follow the guidelines on http://banshee-project.org/contribute/write-code/ to submit your patches to Bugzilla? The mailing list is hard to use to manage patches.


On Sun, Aug 17, 2008 at 9:10 AM, Ivan N. Zlatev <contact i-nz net> wrote:
---
 .../Banshee.NowPlaying/FullscreenWindow.cs         |    5 +++++
 .../Banshee.NowPlaying/NowPlayingInterface.cs      |   18 ++++++++++++++++++
 .../Resources/ActiveSourceUI.xml                   |    1 +
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs b/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs
index f32e8b2..5d3cbcf 100644
--- a/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs
+++ b/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs
@@ -75,6 +75,8 @@ namespace Banshee.NowPlaying
            uint slow_seek = player.Length > 0 ? (uint)(player.Length * 0.05) : fixed_seek; // 5% or fixed

            switch (evnt.Key) {
+                case Gdk.Key.H:
+                case Gdk.Key.h:
                case Gdk.Key.Escape:
                    Hide ();
                    return true;
@@ -145,6 +147,9 @@ namespace Banshee.NowPlaying

        protected override void OnHidden ()
        {
+            if (cursor_update_position_timeout_id > 0)
+                GLib.Source.Remove (cursor_update_position_timeout_id);
+            ShowCursor ();
            base.OnHidden ();
            DestroyControls ();
            parent.RemoveNotification ("is-active", ParentActiveNotification);
diff --git a/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs b/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs
index fd94499..d146ed4 100644
--- a/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs
+++ b/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs
@@ -49,6 +49,15 @@ namespace Banshee.NowPlaying

        public NowPlayingInterface ()
        {
+
+            InterfaceActionService uia_service = ServiceManager.Get<InterfaceActionService> ();
+            uia_service.SourceActions.AddImportant (
+                new ActionEntry ("CompactModeAction", Stock.LeaveFullscreen,
+                    Catalog.GetString ("Compact"), null,
+                    Catalog.GetString ("Displays the video in a minimalistic video window"),
+                    OnCompactMode)
+            );
+
            GtkElementsService service = ServiceManager.Get<GtkElementsService> ();

            contents = new NowPlayingContents ();
@@ -96,6 +105,14 @@ namespace Banshee.NowPlaying
            }
        }

+        private void OnCompactMode (object o, EventArgs args)
+        {
+            MoveVideoExternal (false);
+            video_window.AutoShowPlaybackControls = false;
+            video_window.ShowAll ();
+            ServiceManager.Get<GtkElementsService> ().PrimaryWindow.Hide ();
+        }
+
        protected override void OnRealized ()
        {
            base.OnRealized ();
@@ -149,6 +166,7 @@ namespace Banshee.NowPlaying

        private void OnFullscreenWindowHidden (object o, EventArgs args)
        {
+            ServiceManager.Get<GtkElementsService> ().PrimaryWindow.Show ();
            MoveVideoInternal ();
            DisableFullscreenAction ();
        }
diff --git a/banshee/src/Extensions/Banshee.NowPlaying/Resources/ActiveSourceUI.xml b/banshee/src/Extensions/Banshee.NowPlaying/Resources/ActiveSourceUI.xml
index 6b938de..f1b8a5a 100644
--- a/banshee/src/Extensions/Banshee.NowPlaying/Resources/ActiveSourceUI.xml
+++ b/banshee/src/Extensions/Banshee.NowPlaying/Resources/ActiveSourceUI.xml
@@ -2,6 +2,7 @@
    <toolbar name="HeaderToolbar">
        <placeholder name="SourceActions">
            <toolitem action="" />
+            <toolitem action="" />
        </placeholder>
    </toolbar>
 </ui>
--
1.5.6.5

_______________________________________________
Banshee-list mailing list
Banshee-list gnome org
http://mail.gnome.org/mailman/listinfo/banshee-list



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