diff options
author | Cosimo Cecchi <cosimo@endlessm.com> | 2014-10-27 18:16:16 -0700 |
---|---|---|
committer | Cosimo Cecchi <cosimo@endlessm.com> | 2014-10-27 18:16:16 -0700 |
commit | 95a08469f7eae5c6ef95470661678743e9a2ec93 (patch) | |
tree | 7649dc39f10071a05e7959abf01bb317b4328e37 /endless/eosflexygrid.c | |
parent | 72fbe1cd2fe49a7982e248181a20f1651131e089 (diff) |
eosflexygrid: support RTL layouts
Flip the horizontal cell allocation when in RTL.
[endlessm/eos-sdk#2432]
Diffstat (limited to 'endless/eosflexygrid.c')
-rw-r--r-- | endless/eosflexygrid.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); } |