[gbrainy/gbrainy-17x] Several small fixes



commit 68b65b50cdd9e7ef3031ed1a9d3cc445a494856a
Author: Jordi Mas <jmas softcatala org>
Date:   Thu Jan 6 11:17:06 2011 +0100

    Several small fixes

 src/Clients/Classical/Dialogs/PreferencesDialog.cs |    3 ---
 src/Clients/Classical/Widgets/GameDrawingArea.cs   |    4 ++--
 src/Clients/Classical/gbrainy.cs                   |   20 ++++++++++++++++++--
 src/Core/Libraries/CairoContext.cs                 |    2 +-
 4 files changed, 21 insertions(+), 8 deletions(-)
---
diff --git a/src/Clients/Classical/Dialogs/PreferencesDialog.cs b/src/Clients/Classical/Dialogs/PreferencesDialog.cs
index b0bea97..2f1cb53 100644
--- a/src/Clients/Classical/Dialogs/PreferencesDialog.cs
+++ b/src/Clients/Classical/Dialogs/PreferencesDialog.cs
@@ -67,9 +67,6 @@ namespace gbrainy.Clients.Classical.Dialogs
 			themes_combobox.PackStart (layout_cell, true);
 			themes_combobox.SetCellDataFunc (layout_cell, ComboBoxCellFunc);
 
-
-			Theme [] themes = ThemeManager.Themes;
-
 			foreach (Theme theme in ThemeManager.Themes)
 				store.AppendValues (Catalog.GetString(theme.LocalizedName), theme);
 
diff --git a/src/Clients/Classical/Widgets/GameDrawingArea.cs b/src/Clients/Classical/Widgets/GameDrawingArea.cs
index e846577..1944fe3 100644
--- a/src/Clients/Classical/Widgets/GameDrawingArea.cs
+++ b/src/Clients/Classical/Widgets/GameDrawingArea.cs
@@ -22,7 +22,6 @@ using Gtk;
 using Cairo;
 
 using gbrainy.Core.Main;
-//using gbrainy.Core.Platform;
 
 namespace gbrainy.Clients.Classical.Widgets
 {
@@ -80,6 +79,7 @@ namespace gbrainy.Clients.Classical.Widgets
 				OffsetY = 0;
 
 			// Draw a background taking all the area
+			double line_space = cr.FontLineSpace;
 			cr.Save ();
 			{
 				const double text_margin = 0.015;
@@ -109,7 +109,7 @@ namespace gbrainy.Clients.Classical.Widgets
 				cr.Stroke ();
 			}
 
-			cr.FontLineSpace = 0.018;
+			cr.FontLineSpace = line_space;
 			cr.Restore ();
 
 			// Draw the game area
diff --git a/src/Clients/Classical/gbrainy.cs b/src/Clients/Classical/gbrainy.cs
index bfcac6b..6b73b33 100755
--- a/src/Clients/Classical/gbrainy.cs
+++ b/src/Clients/Classical/gbrainy.cs
@@ -126,16 +126,32 @@ namespace gbrainy.Clients.Classical
 
 			if (toolbar != null)
 			{
+				Box box;
+				
 				switch (toolbar.Orientation) {
 				case Gtk.Orientation.Vertical:
-					main_hbox.Remove (toolbar);
+					box = main_hbox;
 					break;
 				case Gtk.Orientation.Horizontal:
-					framework_vbox.Remove (toolbar);
+				{
+					box = framework_vbox;
 					break;
+				}
 				default:
 					throw new InvalidOperationException ();
 				}
+				
+				bool contained = false;
+				foreach (var ch in box.AllChildren)
+				{
+					if (ch == toolbar)
+					{
+						contained = true;
+						break;
+					}
+				}
+				if (contained == true)
+					box.Remove (toolbar);
 			}
 			toolbar.Orientation = (Gtk.Orientation) Preferences.GetIntValue (Preferences.ToolbarOrientationKey);
 
diff --git a/src/Core/Libraries/CairoContext.cs b/src/Core/Libraries/CairoContext.cs
index b351c88..c9d414d 100644
--- a/src/Core/Libraries/CairoContext.cs
+++ b/src/Core/Libraries/CairoContext.cs
@@ -60,7 +60,7 @@ namespace gbrainy.Core.Libraries
 			FontLineSpace = def_linespace;
 		}
 
-		public string FontFace {
+		new public string FontFace {
 			set {
 				if (String.IsNullOrEmpty (value) == true)
 					return;



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