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>
This commit is contained in:
Florian Müllner 2022-03-20 15:22:31 +01:00 committed by Marge Bot
parent 421591359f
commit 35120dd69c

View File

@ -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;
}