[banshee] [SourceView] Use GConf props for padding/height
- From: Gabriel Burt <gburt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee] [SourceView] Use GConf props for padding/height
- Date: Tue, 10 Nov 2009 00:24:40 +0000 (UTC)
commit 5a4642ea79d2381d822125e00f78607c304117ba
Author: Gabriel Burt <gabriel burt gmail com>
Date: Mon Nov 9 16:16:27 2009 -0800
[SourceView] Use GConf props for padding/height
.../Banshee.Sources.Gui/SourceRowRenderer.cs | 10 ++++++++--
.../Banshee.Sources.Gui/SourceView.cs | 13 ++++++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
index f53d07e..1736eab 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
@@ -87,6 +87,12 @@ namespace Banshee.Sources.Gui
set { padding = value; }
}
+ private int row_height = 22;
+ public int RowHeight {
+ get { return row_height; }
+ set { row_height = value; }
+ }
+
public SourceRowRenderer ()
{
}
@@ -123,7 +129,7 @@ namespace Banshee.Sources.Gui
width = 0;
}
- height = (int)Math.Max (22, text_h) + Padding;
+ height = (int)Math.Max (RowHeight, text_h) + Padding;
}
protected override void Render (Gdk.Drawable drawable, Widget widget, Gdk.Rectangle background_area,
@@ -145,7 +151,7 @@ namespace Banshee.Sources.Gui
bool hide_counts = source.Count <= 0;
- Pixbuf icon = SourceIconResolver.ResolveIcon (source);
+ Pixbuf icon = SourceIconResolver.ResolveIcon (source, RowHeight);
if (state == StateType.Insensitive) {
// Code ported from gtk_cell_renderer_pixbuf_render()
diff --git a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs
index 66961a4..2d0c4fd 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs
@@ -36,6 +36,7 @@ using Mono.Unix;
using Hyena.Gui.Theming;
using Hyena.Gui.Theatrics;
+using Banshee.Configuration;
using Banshee.ServiceStack;
using Banshee.Sources;
using Banshee.Playlist;
@@ -92,7 +93,8 @@ namespace Banshee.Sources.Gui
focus_column = new TreeViewColumn ();
renderer = new SourceRowRenderer ();
- renderer.Padding = 5;
+ renderer.RowHeight = RowHeight.Get ();
+ renderer.Padding = RowPadding.Get ();
focus_column.PackStart (renderer, true);
focus_column.SetCellDataFunc (renderer, new CellLayoutDataFunc (SourceRowRenderer.CellDataHandler));
AppendColumn (focus_column);
@@ -468,5 +470,14 @@ namespace Banshee.Sources.Gui
#endregion
+#region Property Schemas
+
+ private static SchemaEntry<int> RowHeight = new SchemaEntry<int> (
+ "player_window", "source_view_row_height", 22, "The height of each source row in the SourceView. 22 is the default.", "");
+
+ private static SchemaEntry<int> RowPadding = new SchemaEntry<int> (
+ "player_window", "source_view_row_padding", 5, "The padding between sources in the SourceView. 5 is the default.", "");
+
+#endregion
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]