[metacity/gnome-3-22] libmetacity: fix inverted button layout
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity/gnome-3-22] libmetacity: fix inverted button layout
- Date: Sun, 16 Oct 2016 20:22:46 +0000 (UTC)
commit 1482ce23422b500a58c3022d2317c75d4b621a73
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun Oct 16 23:12:47 2016 +0300
libmetacity: fix inverted button layout
libmetacity/meta-button-layout.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/libmetacity/meta-button-layout.c b/libmetacity/meta-button-layout.c
index 4679cbf..01a6045 100644
--- a/libmetacity/meta-button-layout.c
+++ b/libmetacity/meta-button-layout.c
@@ -189,14 +189,16 @@ meta_button_layout_new (const gchar *str,
gint i;
rtl_layout = g_new0 (MetaButtonLayout, 1);
+
rtl_layout->left_buttons = g_new0 (MetaButton, layout->n_right_buttons);
- rtl_layout->right_buttons = g_new0 (MetaButton, layout->n_left_buttons);
+ for (i = 0; i < layout->n_right_buttons; i++)
+ rtl_layout->left_buttons[i] = layout->right_buttons[layout->n_right_buttons - i - 1];
+ rtl_layout->n_left_buttons = layout->n_right_buttons;
+ rtl_layout->right_buttons = g_new0 (MetaButton, layout->n_left_buttons);
for (i = 0; i < layout->n_left_buttons; i++)
- rtl_layout->right_buttons[i] = rtl_layout->left_buttons[layout->n_left_buttons - i];
-
- for (i = 0; i < layout->n_right_buttons; i++)
- rtl_layout->left_buttons[i] = rtl_layout->right_buttons[layout->n_right_buttons - i];
+ rtl_layout->right_buttons[i] = layout->left_buttons[layout->n_left_buttons - i - 1];
+ rtl_layout->n_right_buttons = layout->n_left_buttons;
meta_button_layout_free (layout);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]