[gtk/matthiasc/for-master: 2/2] colorchooser: Fix the add_palette api




commit fd7d61887c0014f4e8f54c24969b113b948cd9c4
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Aug 24 17:20:17 2020 -0400

    colorchooser: Fix the add_palette api
    
    When adding a custom palette, we need to arrange
    for the custom section to stay at the bottom.
    
    Maybe there should be a way to turn off custom
    colors, too.

 gtk/gtkcolorchooserwidget.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gtk/gtkcolorchooserwidget.c b/gtk/gtkcolorchooserwidget.c
index 087e8df056..408b3eaebd 100644
--- a/gtk/gtkcolorchooserwidget.c
+++ b/gtk/gtkcolorchooserwidget.c
@@ -314,6 +314,7 @@ add_palette (GtkColorChooserWidget  *cc,
   gtk_grid_set_row_spacing (GTK_GRID (grid), 2);
   gtk_grid_set_column_spacing (GTK_GRID (grid), 4);
   gtk_box_append (GTK_BOX (cc->palette), grid);
+  
 
   left = 0;
   right = colors_per_line - 1;
@@ -807,6 +808,9 @@ gtk_color_chooser_widget_add_palette (GtkColorChooser *chooser,
 
   remove_default_palette (cc);
   add_palette (cc, orientation, colors_per_line, n_colors, colors, NULL);
+
+  gtk_box_reorder_child_after (GTK_BOX (cc->palette), cc->custom_label, gtk_widget_get_last_child 
(cc->palette));
+  gtk_box_reorder_child_after (GTK_BOX (cc->palette), cc->custom, cc->custom_label);
 }
 
 static void


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