[banshee] [TrackEditorDialog] Only show tabs if there is more than one



commit 527edeeae686774fabba792a98c3ce79ffee410e
Author: William Friesen <wfriesen gmail com>
Date:   Sun Dec 5 21:55:37 2010 +1100

    [TrackEditorDialog] Only show tabs if there is more than one
    
    Fixes bgo#615797.
    
    Signed-off-by: Bertrand Lorentz <bertrand lorentz gmail com>

 .../Banshee.Gui.TrackEditor/TrackEditorDialog.cs   |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
index 949489b..89d7d85 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
@@ -132,6 +132,8 @@ namespace Banshee.Gui.TrackEditor
             LoadModifiers ();
 
             LoadTrackToEditor ();
+
+            HideSingleTab ();
         }
 
 #region UI Building
@@ -453,6 +455,24 @@ namespace Banshee.Gui.TrackEditor
             }
         }
 
+        private void HideSingleTab ()
+        {
+            int visible_pages = 0;
+            foreach (ITrackEditorPage page in pages) {
+                if (page.Widget.Visible) {
+                       visible_pages++;
+                }
+            }
+            if (visible_pages == 1) {
+                notebook.ShowTabs = false;
+                notebook.ShowBorder = false;
+                var container = notebook.CurrentPageWidget as Container;
+                if (container != null) {
+                    container.BorderWidth = 0;
+                }
+            }
+        }
+
         private void LoadCoverArt (TrackInfo current_track)
         {
             if (current_track == null)



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