[gbrainy] RTL support for answer area



commit c5a99f6da6a173aabfd6ffc510e0b14101aab1ce
Author: Jordi Mas <jmas softcatala org>
Date:   Fri Apr 29 00:02:21 2011 +0200

    RTL support for answer area

 src/Clients/Classical/Widgets/GameDrawingArea.cs |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/Clients/Classical/Widgets/GameDrawingArea.cs b/src/Clients/Classical/Widgets/GameDrawingArea.cs
index ac93e76..1e0a651 100644
--- a/src/Clients/Classical/Widgets/GameDrawingArea.cs
+++ b/src/Clients/Classical/Widgets/GameDrawingArea.cs
@@ -184,12 +184,28 @@ namespace gbrainy.Clients.Classical.Widgets
 				double width_str, height_str;
 				cr.MeasureString (Solution, max_width - icon_size, true, out width_str, out height_str);
 				cr.Color = new Color (1, 1, 1);
-				cr.DrawStringWithWrapping (scaled_margin + icon_size + text_margin,
+
+				double x_text, x_icon;
+
+				if (Direction == Gtk.TextDirection.Rtl)
+				{
+					x_text = 0;
+					x_icon = max_width - icon_size;
+
+				}
+				else
+				{
+					x_text = scaled_margin + icon_size + text_margin;
+					x_icon = 0;
+				}
+				
+
+				cr.DrawStringWithWrapping (x_text,
 					(1 - box_height - scaled_margin - text_margin) + ((box_height - height_str) / 2),
 					Solution, max_width - icon_size);
 				cr.Stroke ();
 
-				DrawSolutionIcon (cr, 0, 1 - box_height);
+				DrawSolutionIcon (cr, x_icon, 1 - box_height);
 				cr.Restore ();
 			}
 			cr.UseMarkup = false;



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