diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-07-14 14:47:23 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-07-14 14:48:32 -0400 |
commit | 115d0cdc07e073dd2c1b331aca2215d8ac8ed1ce (patch) | |
tree | 10462d234cff1c85b27204b503f5efed7edf736e /gtk/gtkshortcutssection.c | |
parent | 38cce2bb181e54143bef1c3510cd81331e40468e (diff) | |
download | gtk+-115d0cdc07e073dd2c1b331aca2215d8ac8ed1ce.tar.gz |
Fix shortcuts section reflow
When this code was ported from gtk_container_get_children
to the dom api, we inadvertendly inverted the order of the
list in one place. With the dom api, we can just avoid
reversing lists altogether, so do that.
Fixes: #2928
Diffstat (limited to 'gtk/gtkshortcutssection.c')
-rw-r--r-- | gtk/gtkshortcutssection.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c index 7aef6791f5..5f5be70582 100644 --- a/gtk/gtkshortcutssection.c +++ b/gtk/gtkshortcutssection.c @@ -543,21 +543,20 @@ gtk_shortcuts_section_reflow_groups (GtkShortcutsSection *self) { GtkWidget *column; - for (column = gtk_widget_get_first_child (page); + for (column = gtk_widget_get_last_child (page); column != NULL; - column = gtk_widget_get_next_sibling (column)) + column = gtk_widget_get_prev_sibling (column)) { GtkWidget *group; - for (group = gtk_widget_get_first_child (column); + for (group = gtk_widget_get_last_child (column); group != NULL; - group = gtk_widget_get_next_sibling (group)) + group = gtk_widget_get_prev_sibling (group)) { groups = g_list_prepend (groups, group); } } } - groups = g_list_reverse (groups); /* create new pages */ current_page = NULL; @@ -642,7 +641,6 @@ gtk_shortcuts_section_reflow_groups (GtkShortcutsSection *self) child != NULL; child = gtk_widget_get_prev_sibling (child)) content = g_list_prepend (content, child); - content = g_list_reverse (content); n = 0; for (g = g_list_last (content); g; g = g->prev) |