From a598b06496179722d26ad6eb77eb016672b1c54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 25 Oct 2012 18:51:43 +0200 Subject: [PATCH] messageTray: Fix close button position in RTL locales https://bugzilla.gnome.org/show_bug.cgi?id=686879 --- js/ui/messageTray.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 34ffc89a0..6d51b458d 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -242,7 +242,10 @@ function makeCloseButton() { closeButton.connect('style-changed', function() { let themeNode = closeButton.get_theme_node(); - closeButton.translation_x = themeNode.get_length('-shell-close-overlap-x'); + + // libcroco doesn't support negative units + let direction = closeButton.get_text_direction() == Clutter.TextDirection.RTL ? -1 : 1; + closeButton.translation_x = direction * themeNode.get_length('-shell-close-overlap-x'); // libcroco doesn't support negative units closeButton.translation_y = -themeNode.get_length('-shell-close-overlap-y');