banshee r3747 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Gui



Author: scottp
Date: Thu Apr 10 07:10:00 2008
New Revision: 3747
URL: http://svn.gnome.org/viewvc/banshee?rev=3747&view=rev

Log:
* src/Core/Banshee.ThickClient/Banshee.Gui/InterfaceActionService.cs:
Added a ViewActions property.

* src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs: Handle
fullscreen toggling. This fixes BGO #526618.

Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/InterfaceActionService.cs

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs	Thu Apr 10 07:10:00 2008
@@ -36,6 +36,8 @@
 {
     public abstract class BaseClientWindow : Window
     {
+        private ToggleAction fullscreen_action;
+        
         private GtkElementsService elements_service;
         protected GtkElementsService ElementsService {
             get { return elements_service; }
@@ -60,7 +62,7 @@
             
             AddAccelGroup (action_service.UIManager.AccelGroup);
             
-            Initialize ();
+            InitializeWindow ();
         }
         
         public void ToggleVisibility ()
@@ -97,6 +99,20 @@
             }
         }
         
+        private void InitializeWindow ()
+        {
+            fullscreen_action = (ToggleAction)action_service.ViewActions["FullScreenAction"];
+            fullscreen_action.Activated += delegate {
+                if (fullscreen_action.Active) {
+                    Fullscreen ();
+                } else {
+                    Unfullscreen ();
+                }
+            };
+            
+            Initialize ();
+        }
+        
         protected abstract void Initialize ();
     
         protected virtual void ConfigureWindow ()
@@ -161,6 +177,8 @@
         
         protected override bool OnWindowStateEvent (Gdk.EventWindowState evnt)
         {
+            fullscreen_action.Active = (evnt.NewWindowState & Gdk.WindowState.Fullscreen) != 0;
+            
             if ((evnt.NewWindowState & Gdk.WindowState.Withdrawn) == 0) {
                 MaximizedSchema.Set ((evnt.NewWindowState & Gdk.WindowState.Maximized) != 0);
             }

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/InterfaceActionService.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/InterfaceActionService.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/InterfaceActionService.cs	Thu Apr 10 07:10:00 2008
@@ -211,6 +211,10 @@
             get { return source_actions; }
         }
         
+        public ViewActions ViewActions {
+            get { return view_actions; }
+        }
+        
         string IService.ServiceName {
             get { return "InterfaceActionService"; }
         }



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