]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkcolorchooser.c
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gtk / gtkcolorchooser.c
index 714eee0128d8e03146a426aac5dfa213997f2fe8..cbefdd3b4a855fa008357ea2921c18c8b9995dc6 100644 (file)
@@ -109,7 +109,7 @@ gtk_color_chooser_default_init (GtkColorChooserInterface *iface)
                   NULL, NULL,
                   NULL,
                   G_TYPE_NONE,
-                  1, G_TYPE_STRING);
+                  1, GDK_TYPE_RGBA);
 }
 
 void
@@ -122,7 +122,7 @@ _gtk_color_chooser_color_activated (GtkColorChooser *chooser,
 /**
  * gtk_color_chooser_get_rgba:
  * @chooser: a #GtkColorChooser
- * @color: return location for the color
+ * @color: (out): a #GdkRGBA to fill in with the current color
  *
  * Gets the currently-selected color.
  *
@@ -143,6 +143,8 @@ gtk_color_chooser_get_rgba (GtkColorChooser *chooser,
  * @color: the new color
  *
  * Sets the color.
+ *
+ * Since: 3.4
  */
 void
 gtk_color_chooser_set_rgba (GtkColorChooser *chooser,
@@ -199,13 +201,13 @@ gtk_color_chooser_set_use_alpha (GtkColorChooser *chooser,
 /**
  * gtk_color_chooser_add_palette:
  * @chooser: a #GtkColorChooser
- * @horizontal: %TRUE if the palette should be displayed in rows,
- *     %FALSE for columns
+ * @orientation: %GTK_ORIENTATION_HORIZONTAL if the palette should
+ *     be displayed in rows, %GTK_ORIENTATION_VERTICAL for columns
  * @colors_per_line: the number of colors to show in each row/column
  * @n_colors: the total number of elements in @colors
- * @colors: (array length=n_colors): the colors of the palette
+ * @colors: (allow-none) (array length=n_colors): the colors of the palette, or %NULL
  *
- * Adds a palette to the color chooser. If @horizontal is %TRUE,
+ * Adds a palette to the color chooser. If @orientation is horizontal,
  * the colors are grouped in rows, with @colors_per_line colors
  * in each row. If @horizontal is %FALSE, the colors are grouped
  * in columns instead.
@@ -217,13 +219,17 @@ gtk_color_chooser_set_use_alpha (GtkColorChooser *chooser,
  * The layout of the color chooser widget works best when the
  * palettes have 9-10 columns.
  *
- * Calling this function is called for the first time has the
+ * Calling this function for the first time has the
  * side effect of removing the default color and gray palettes
  * from the color chooser.
+ *
+ * If @colors is %NULL, removes all previously added palettes.
+ *
+ * Since: 3.4
  */
 void
 gtk_color_chooser_add_palette (GtkColorChooser *chooser,
-                               gboolean         horizontal,
+                               GtkOrientation   orientation,
                                gint             colors_per_line,
                                gint             n_colors,
                                GdkRGBA         *colors)
@@ -231,7 +237,7 @@ gtk_color_chooser_add_palette (GtkColorChooser *chooser,
   g_return_if_fail (GTK_IS_COLOR_CHOOSER (chooser));
 
   if (GTK_COLOR_CHOOSER_GET_IFACE (chooser)->add_palette)
-    GTK_COLOR_CHOOSER_GET_IFACE (chooser)->add_palette (chooser, horizontal, colors_per_line, n_colors, colors);
+    GTK_COLOR_CHOOSER_GET_IFACE (chooser)->add_palette (chooser, orientation, colors_per_line, n_colors, colors);
 }
 
 cairo_pattern_t *