[banshee] MediaPanelContents: Improve layout and appearance
- From: Bertrand Lorentz <blorentz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] MediaPanelContents: Improve layout and appearance
- Date: Sat, 19 Oct 2013 20:20:06 +0000 (UTC)
commit 19bf100a7505ed41c3f71363e57a5e9e2a0f77ac
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date: Sat Oct 19 21:48:15 2013 +0200
MediaPanelContents: Improve layout and appearance
Remove the header, it was onyl useful when running as a MeeGo panel.
Don't use a custom color gradient for the background, just use the
default background.
Use Gtk.Grid instead of Gtk.Table, which is already deprecated.
.../Banshee.MediaPanel/MediaPanelContents.cs | 65 +++----------------
1 files changed, 11 insertions(+), 54 deletions(-)
---
diff --git a/src/Extensions/Banshee.MediaPanel/Banshee.MediaPanel/MediaPanelContents.cs
b/src/Extensions/Banshee.MediaPanel/Banshee.MediaPanel/MediaPanelContents.cs
index 7f95324..98d2ea2 100644
--- a/src/Extensions/Banshee.MediaPanel/Banshee.MediaPanel/MediaPanelContents.cs
+++ b/src/Extensions/Banshee.MediaPanel/Banshee.MediaPanel/MediaPanelContents.cs
@@ -46,7 +46,7 @@ using Banshee.Gui.Widgets;
namespace Banshee.MediaPanel
{
- public class MediaPanelContents : Table, ITrackModelSourceContents
+ public class MediaPanelContents : Grid, ITrackModelSourceContents
{
private ArtistListView artist_view;
private AlbumListView album_view;
@@ -63,7 +63,7 @@ namespace Banshee.MediaPanel
{
}
- public MediaPanelContents () : base (2, 2, false)
+ public MediaPanelContents () : base ()
{
BorderWidth = 5;
RowSpacing = 6;
@@ -71,7 +71,6 @@ namespace Banshee.MediaPanel
RedrawOnAllocate = true;
AppPaintable = true;
- BuildHeader ();
BuildLibrary ();
BuildNowPlaying ();
ConnectEvents ();
@@ -102,19 +101,6 @@ namespace Banshee.MediaPanel
#region UI Construction
- private void BuildHeader ()
- {
- Attach (new Label {
- Markup = String.Format ("<span font_desc=\"Droid Sans Bold\" " +
- "size=\"x-large\" foreground=\"#606eff\">{0}</span>",
- GLib.Markup.EscapeText (Catalog.GetString ("Media"))),
- Xalign = 0.0f
- },
- 0, 2, 0, 1,
- AttachOptions.Fill | AttachOptions.Expand,
- AttachOptions.Shrink, 12, 0);
- }
-
private void BuildLibrary ()
{
var box = new HeaderBox () { Title = Catalog.GetString ("Library") };
@@ -144,20 +130,19 @@ namespace Banshee.MediaPanel
// Build the Library Views
var views = new HBox () { Spacing = 5 };
views.PackStart (SetupView (artist_view = new ArtistListView () {
- Name = "meego-panel-artists",
+ Name = "media-panel-artists",
WidthRequest = 150,
DoNotRenderNullModel = true
}), false, false, 0);
views.PackStart (SetupView (album_view = new AlbumListView () {
- Name = "meego-panel-albums",
+ Name = "media-panel-albums",
DoNotRenderNullModel = true
}), true, true, 0);
box.PackStart (views, true, true, 0);
+ box.Hexpand = box.Vexpand = true;
+ box.Halign = box.Valign = Align.Fill;
- Attach (box, 0, 1, 1, 2,
- AttachOptions.Expand | AttachOptions.Fill,
- AttachOptions.Expand | AttachOptions.Fill,
- 0, 0);
+ Attach (box, 0, 0, 1, 1);
}
private void BuildNowPlaying ()
@@ -173,7 +158,7 @@ namespace Banshee.MediaPanel
};
track_view = new TerseTrackListView () {
- Name = "meego-panel-tracks",
+ Name = "media-panel-tracks",
WidthRequest = 220
};
track_view.ColumnController.Insert (new Column (null, "indicator",
@@ -183,11 +168,10 @@ namespace Banshee.MediaPanel
box.PackStartHighlighted (seek_slider, false, false, 0, HeaderBox.HighlightFlags.Background);
box.PackStart (SetupView (track_view), true, true, 0);
box.PackStartHighlighted (new PlaybackBox (), false, false, 0, HeaderBox.HighlightFlags.TopLine);
+ box.Vexpand = true;
+ box.Valign = Align.Fill;
- Attach (box, 1, 2, 1, 2,
- AttachOptions.Shrink,
- AttachOptions.Expand | AttachOptions.Fill,
- 0, 0);
+ Attach (box, 1, 0, 1, 1);
}
private ScrolledWindow SetupView (Widget view)
@@ -203,33 +187,6 @@ namespace Banshee.MediaPanel
#endregion
-#region Background Rendering
-
- protected override bool OnDrawn (Cairo.Context cr)
- {
- if (!Visible || !IsMapped) {
- return true;
- }
-
- RenderBackground (cr);
- base.OnDrawn (cr);
-
- return true;
- }
-
- private void RenderBackground (Cairo.Context cr)
- {
- var grad = new Cairo.LinearGradient (0, 0, 0, Allocation.Height);
- grad.AddColorStop (0, CairoExtensions.RgbToColor (0xffffff));
- grad.AddColorStop (1, CairoExtensions.RgbToColor (0xc3c3c3));
- cr.SetSource (grad);
- cr.Rectangle (0, 0, Allocation.Width, Allocation.Height);
- cr.Fill ();
- grad.Dispose ();
- }
-
-#endregion
-
#region Event Handlers
private void OnProgrammaticSearch (object o, EventArgs args)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]