From 95a08469f7eae5c6ef95470661678743e9a2ec93 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Mon, 27 Oct 2014 18:16:16 -0700 Subject: eosflexygrid: support RTL layouts Flip the horizontal cell allocation when in RTL. [endlessm/eos-sdk#2432] --- endless/eosflexygrid.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'endless/eosflexygrid.c') diff --git a/endless/eosflexygrid.c b/endless/eosflexygrid.c index 73b375e..7334fde 100644 --- a/endless/eosflexygrid.c +++ b/endless/eosflexygrid.c @@ -328,6 +328,7 @@ distribute_layout (GSequence *children, EosFlexyGridCell *cell = g_sequence_get (iter); EosFlexyShape shape = eos_flexy_grid_cell_get_shape (cell); GtkAllocation request = { 0, }; + GtkTextDirection text_dir = gtk_widget_get_direction (GTK_WIDGET (cell)); switch (shape) { @@ -364,6 +365,10 @@ distribute_layout (GSequence *children, max_height = MAX (max_height, request.y + request.height + spacing); + /* Flip horizontal allocation for RTL */ + if (text_dir == GTK_TEXT_DIR_RTL) + request.x = available_width - request.x - request.width; + if (allocate) gtk_widget_size_allocate (GTK_WIDGET (cell), &request); } -- cgit v1.2.3