banshee r5035 - in trunk/banshee: . src/Libraries/Hyena.Gui/Hyena.Data.Gui



Author: gburt
Date: Wed Feb 11 19:57:46 2009
New Revision: 5035
URL: http://svn.gnome.org/viewvc/banshee?rev=5035&view=rev

Log:
2009-02-11  Gabriel Burt  <gabriel burt gmail com>

	* src/Libraries/Hyena.Gui/Hyena.Data.Gui/Column.cs:
	* src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs: Patch from
	John Millikin (with some style fixups added in by me) that right-aligns
	the header text for right-aligned columns (BGO #560918)



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/Column.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/Column.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/Column.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/Column.cs	Wed Feb 11 19:57:46 2009
@@ -41,8 +41,8 @@
         private ColumnCell header_cell;
         private List<ColumnCell> cells = new List<ColumnCell> ();
         
-        private int minWidth = 0;
-        private int maxWidth = Int32.MaxValue;
+        private int min_width = 0;
+        private int max_width = Int32.MaxValue;
         
         public Column (ColumnDescription description) :
             this (description, new ColumnCellText (description.Property, true))
@@ -62,26 +62,32 @@
         public Column (string title, ColumnCell cell, double width, bool visible) 
             : this (null, title, cell, width, visible)
         {
-            this.header_cell = new ColumnHeaderCellText (HeaderCellDataHandler);
         }
         
-        public Column (ColumnCell header_cell, string title, ColumnCell cell, double width)
-            : this (header_cell, title, cell, width, true)
+        public Column (ColumnCell headerCell, string title, ColumnCell cell, double width)
+            : this (headerCell, title, cell, width, true)
         {
         }
         
-        public Column (ColumnCell header_cell, string title, ColumnCell cell, double width, bool visible)
-            : this (header_cell, title, cell, width, visible, 0, Int32.MaxValue)
+        public Column (ColumnCell headerCell, string title, ColumnCell cell, double width, bool visible)
+            : this (headerCell, title, cell, width, visible, 0, Int32.MaxValue)
         {
         }
         
-        public Column (ColumnCell header_cell, string title, ColumnCell cell, double width, bool visible, int minWidth, int maxWidth)
+        public Column (ColumnCell headerCell, string title, ColumnCell cell, double width, bool visible, int minWidth, int maxWidth)
             : base (cell.Property, title, width, visible)
         {
-            this.minWidth = minWidth;
-            this.maxWidth = maxWidth;
-            this.header_cell = header_cell;
-            PackStart(cell);
+            min_width = minWidth;
+            max_width = maxWidth;
+            header_cell = headerCell ?? new ColumnHeaderCellText (HeaderCellDataHandler);
+
+            ColumnCellText header_text = header_cell as ColumnCellText;
+            ColumnCellText cell_text = cell as ColumnCellText;
+            if (header_text != null && cell_text != null) {
+                header_text.Alignment = cell_text.Alignment;
+            }
+
+            PackStart (cell);
         }
         
         private Column HeaderCellDataHandler ()
@@ -166,21 +172,21 @@
         }
         
         public int MinWidth {
-            get { return minWidth; }
+            get { return min_width; }
             set {
-                minWidth = value;
-                if (value > maxWidth) {
-                    maxWidth = value;
+                min_width = value;
+                if (value > max_width) {
+                    max_width = value;
                 }
             }
         }
         
         public int MaxWidth {
-            get { return maxWidth; }
+            get { return max_width; }
             set {
-                maxWidth = value;
-                if (value < minWidth) {
-                    minWidth = value;
+                max_width = value;
+                if (value < min_width) {
+                    min_width = value;
                 }
             }
         }

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs	Wed Feb 11 19:57:46 2009
@@ -139,7 +139,7 @@
             set { text_format = value; }
         }
         
-        protected Pango.Alignment Alignment {
+        public Pango.Alignment Alignment {
             get { return alignment; }
             set { alignment = value; }
         }



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