[banshee] [Banshee.ThickClient] Fix BansheeDialog alignment



commit c0ccd05ed2f2eaa9a35890599d5d8789ef806d4e
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Thu May 13 13:17:06 2010 -0700

    [Banshee.ThickClient] Fix BansheeDialog alignment
    
    The ActionArea buttons were not aligned with the content of the dialog.
    This fixes the alignment issue in the Open Location, Import, and
    Preferences dialogs, but breaks workarounds in the Track Editor.

 .../Banshee.Gui.Dialogs/BansheeDialog.cs           |   22 +++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/BansheeDialog.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/BansheeDialog.cs
index d7912c2..d198c48 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/BansheeDialog.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/BansheeDialog.cs
@@ -41,6 +41,8 @@ namespace Banshee.Gui.Dialogs
             get { return accel_group; }
         }
 
+        private VBox inner_vbox;
+
         public BansheeDialog () : this (null, null)
         {
         }
@@ -52,7 +54,23 @@ namespace Banshee.Gui.Dialogs
         public BansheeDialog (string title, Window parent) : base ()
         {
             Title = title ?? String.Empty;
-            BorderWidth = 12;
+
+            // Below is the widget hierarchy.  The ActionArea has a BorderWidth
+            // of 5, set in Gtk.Dialog apparently.  So we set the overall
+            // dialog's BorderWidth to 7 to total 12, and create an inner_vbox
+            // with a BorderWidth of 5 as well, so that the ActionArea and the
+            // VBox (actually inner_vbox) are aligned.
+            //
+            // Dialog
+            //   VBox
+            //     inner_vbox
+            //     ActionArea
+            BorderWidth = 7;
+            base.VBox.BorderWidth = 0;
+
+            inner_vbox = new VBox () { Spacing = 12, BorderWidth = 5, Visible = true };
+            base.VBox.PackStart (inner_vbox, false, false, 0);
+
             Visible = false;
             HasSeparator = false;
 
@@ -74,6 +92,8 @@ namespace Banshee.Gui.Dialogs
             AddAccelGroup (accel_group);
         }
 
+        public new VBox VBox { get { return inner_vbox; } }
+
         public new ResponseType Run ()
         {
             return (ResponseType)base.Run ();



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