Implement a hack to keep the text direction left-to-right

This commit is contained in:
Christian Dywan 2009-05-22 04:01:56 +02:00
parent 551843da1d
commit 16912f4cdf

View file

@ -514,6 +514,17 @@ midori_view_class_init (MidoriViewClass* class)
static void static void
midori_view_update_title (MidoriView* view) midori_view_update_title (MidoriView* view)
{ {
/* If left-to-right text is combined with right-to-left text the default
behaviour of Pango can result in awkwardly aligned text. For example
"‪بستيان نوصر (hadess) | An era comes to an end - Midori" becomes
"hadess) | An era comes to an end - Midori) بستيان نوصر". So to prevent
this we insert an LRE character before the title which indicates that
we want left-to-right but retains the direction of right-to-left text. */
if (view->title && !g_str_has_prefix (view->title, ""))
{
gchar* new_title = g_strconcat ("", view->title, NULL);
katze_assign (view->title, new_title);
}
#define title midori_view_get_display_title (view) #define title midori_view_get_display_title (view)
if (view->tab_label) if (view->tab_label)
{ {