[gtk/rtl-margins] Flip margin-start and -end in RTL




commit d89ff7181941d202d257337f8de4ee1da7cbcbea
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jan 15 14:56:21 2021 -0500

    Flip margin-start and -end in RTL
    
    We lost this at some point, but the widget margins
    are still meant to be relative to the text direction.
    
    Fixes: #3583

 gtk/gtkwidget.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 6efcdccc4a..45a3720b18 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3900,7 +3900,10 @@ gtk_widget_allocate (GtkWidget    *widget,
   priv->allocated_height = height;
   priv->allocated_size_baseline = baseline;
 
-  adjusted.x = priv->margin.left;
+  if (_gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
+    adjusted.x = priv->margin.left;
+  else
+    adjusted.x = priv->margin.right;
   adjusted.y = priv->margin.top;
   adjusted.width = width - priv->margin.left - priv->margin.right;
   adjusted.height = height - priv->margin.top - priv->margin.bottom;


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