[rhythmbox] header: fix display of RTL track names in LTR locales (bug #518540)



commit b36fb6475b30820e08a46c6f3e4f6af88577b9bb
Author: Uri Sivan <tartif gmail com>
Date:   Sun Feb 21 16:01:51 2010 +1000

    header: fix display of RTL track names in LTR locales (bug #518540)
    
    We insert an LRM or RLM (according to the widget direction) to force the
    header text to be displayed in the correct direction even when the start
    of the text (the track title) has the opposite direction.

 widgets/rb-header.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/widgets/rb-header.c b/widgets/rb-header.c
index 5f6596a..9525169 100644
--- a/widgets/rb-header.c
+++ b/widgets/rb-header.c
@@ -482,9 +482,16 @@ rb_header_sync (RBHeader *header)
 
 		label_str = g_string_sized_new (100);
 
-		/* stick a right-to-left mark in the string for RTL display */
+		/* force the string to have the same direction as the widget.
+		 * this fixes the display when the head of the text (usually
+		 * the track name) has a different direction than the widget.
+		 */
 		if (gtk_widget_get_direction (GTK_WIDGET (header->priv->song)) == GTK_TEXT_DIR_RTL) {
+			/* insert a unicode RLM */
 			g_string_append (label_str, "\xE2\x80\x8F");
+		} else {
+			/* insert a unicode LRM */
+			g_string_append (label_str, "\xE2\x80\x8E");
 		}
 
 		append_and_free (label_str, TITLE_MARKUP (title));



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