[gtk+] headerbar: don't use GTK_PACK_* as indices into array



commit 78eccd0db9e79fac187d4fd82f1ce8b5b7e3a2a2
Author: Ray Strode <rstrode redhat com>
Date:   Thu Jun 23 09:16:40 2016 -0400

    headerbar: don't use GTK_PACK_* as indices into array
    
    The size allocation code maintains an array of two elements,
    to track the allocation of children packed into the two sides
    of a header bar. Sometimes this array is indexed with 0 and 1,
    and sometimes its indexed with GTK_PACK_START and GTK_PACK_END.
    The latter happen to have the values 0 and 1, respectively, but
    that's not really obvious.
    
    For clarity, this commit changes the code to index those arrays
    consistently, sticking to 0 and 1 across the board.

 gtk/gtkheaderbar.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index b133587..fb427d1 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -1124,8 +1124,8 @@ gtk_header_bar_allocate_contents (GtkCssGadget        *gadget,
         }
     }
 
-  side[GTK_PACK_START] += start_width;
-  side[GTK_PACK_END] += end_width;
+  side[0] += start_width;
+  side[1] += end_width;
 
   /* We don't enforce css borders on the center widget, to make
    * title/subtitle combinations fit without growing the header


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