[gnome-shell] st/theme-node: Default to right text-align in RTL



commit 35120dd69cde1411e3faa44e4136a2bf7aebc3cd
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Mar 20 15:22:31 2022 +0100

    st/theme-node: Default to right text-align in RTL
    
    When neither the theme node itself nor any of its parents specifies
    an explicit text direction, we default to aligning to the left.
    
    That's a good default for LTR locales, but for RTL aligning to the
    right is a better one.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2247>

 src/st/st-theme-node.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c
index e6fb80b11d..13dbca88fd 100644
--- a/src/st/st-theme-node.c
+++ b/src/st/st-theme-node.c
@@ -2649,6 +2649,9 @@ st_theme_node_get_text_align(StThemeNode *node)
     }
   if(node->parent_node)
     return st_theme_node_get_text_align(node->parent_node);
+
+  if (clutter_get_default_text_direction () == CLUTTER_TEXT_DIRECTION_RTL)
+    return ST_TEXT_ALIGN_RIGHT;
   return ST_TEXT_ALIGN_LEFT;
 }
 


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