[banshee] FilteredListSourceContents: Refactor the LayoutTop/LayoutLeft logic
- From: Bertrand Lorentz <blorentz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] FilteredListSourceContents: Refactor the LayoutTop/LayoutLeft logic
- Date: Sun, 6 Nov 2011 14:14:04 +0000 (UTC)
commit 38a14174f8216cc4a50a69b6f50ed4ef2440b266
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date: Sun Nov 6 15:10:20 2011 +0100
FilteredListSourceContents: Refactor the LayoutTop/LayoutLeft logic
Move the LayoutTop/LayoutLeft choice in a single method, instead of
duplicating it in two places.
.../CompositeTrackSourceContents.cs | 6 +----
.../FilteredListSourceContents.cs | 22 ++++++++++++-------
2 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs
index edce2ac..f21535d 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs
@@ -185,11 +185,7 @@ namespace Banshee.Sources.Gui
ClearFilterSelections ();
- if (BrowserPosition.Get ().Equals ("left")) {
- LayoutLeft ();
- } else {
- LayoutTop ();
- }
+ Layout ();
ArtistFilterType.Set (args.Current.Value == 1 ? "albumartist" : "artist");
}
diff --git a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
index 00523fa..20daec3 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
@@ -88,12 +88,7 @@ namespace Banshee.Sources.Gui
this.name = name;
InitializeViews ();
- string position = ForcePosition == null ? BrowserPosition.Get () : ForcePosition;
- if (position == "top") {
- LayoutTop ();
- } else {
- LayoutLeft ();
- }
+ string position = Layout ();
if (ForcePosition != null) {
return;
@@ -196,12 +191,23 @@ namespace Banshee.Sources.Gui
}
}
- protected void LayoutLeft ()
+ protected string Layout ()
+ {
+ string position = ForcePosition == null ? BrowserPosition.Get () : ForcePosition;
+ if (position == "top") {
+ LayoutTop ();
+ } else {
+ LayoutLeft ();
+ }
+ return position;
+ }
+
+ private void LayoutLeft ()
{
Layout (false);
}
- protected void LayoutTop ()
+ private void LayoutTop ()
{
Layout (true);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]