actions: Load menu colors for Gradient Editor

Resolves #12226.
GimpGradientEditor's saved_color array was
converted to GeglColor as part of the color
space invasion. However, we were still
treating it as if it was a GimpRGB array, so
we'd use gegl_color_set_pixel () to convert
it for gimp_action_group_set_action_color ().
This resulted in the menu displaying empty colors.
This patch removes the unnecessary conversions
and passed the saved_color values directly so that
they show up in the menu.
This commit is contained in:
Alx Sa 2024-10-26 03:10:22 +00:00
parent d054a87d2c
commit 71d2a1415f

View file

@ -630,26 +630,16 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-load-left-09", left_editable);
SET_SENSITIVE ("gradient-editor-load-left-10", left_editable);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[0]);
SET_COLOR ("gradient-editor-load-left-01", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[1]);
SET_COLOR ("gradient-editor-load-left-02", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[2]);
SET_COLOR ("gradient-editor-load-left-03", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[3]);
SET_COLOR ("gradient-editor-load-left-04", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[4]);
SET_COLOR ("gradient-editor-load-left-05", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[5]);
SET_COLOR ("gradient-editor-load-left-06", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[6]);
SET_COLOR ("gradient-editor-load-left-07", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[7]);
SET_COLOR ("gradient-editor-load-left-08", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[8]);
SET_COLOR ("gradient-editor-load-left-09", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[9]);
SET_COLOR ("gradient-editor-load-left-10", color, TRUE);
SET_COLOR ("gradient-editor-load-left-01", editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-load-left-02", editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-load-left-03", editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-load-left-04", editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-load-left-05", editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-load-left-06", editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-load-left-07", editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-load-left-08", editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-load-left-09", editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-load-left-10", editor->saved_colors[9], TRUE);
SET_SENSITIVE ("gradient-editor-save-left-01", gradient);
SET_SENSITIVE ("gradient-editor-save-left-02", gradient);
@ -662,26 +652,16 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-save-left-09", gradient);
SET_SENSITIVE ("gradient-editor-save-left-10", gradient);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[0]);
SET_COLOR ("gradient-editor-save-left-01", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[1]);
SET_COLOR ("gradient-editor-save-left-02", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[2]);
SET_COLOR ("gradient-editor-save-left-03", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[3]);
SET_COLOR ("gradient-editor-save-left-04", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[4]);
SET_COLOR ("gradient-editor-save-left-05", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[5]);
SET_COLOR ("gradient-editor-save-left-06", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[6]);
SET_COLOR ("gradient-editor-save-left-07", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[7]);
SET_COLOR ("gradient-editor-save-left-08", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[8]);
SET_COLOR ("gradient-editor-save-left-09", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[9]);
SET_COLOR ("gradient-editor-save-left-10", color, TRUE);
SET_COLOR ("gradient-editor-save-left-01", editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-save-left-02", editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-save-left-03", editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-save-left-04", editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-save-left-05", editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-save-left-06", editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-save-left-07", editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-save-left-08", editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-save-left-09", editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-save-left-10", editor->saved_colors[9], TRUE);
SET_SENSITIVE ("gradient-editor-right-color-fixed", editable);
SET_SENSITIVE ("gradient-editor-right-color-foreground", editable);
@ -741,26 +721,16 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-load-right-09", right_editable);
SET_SENSITIVE ("gradient-editor-load-right-10", right_editable);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[0]);
SET_COLOR ("gradient-editor-load-right-01", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[1]);
SET_COLOR ("gradient-editor-load-right-02", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[2]);
SET_COLOR ("gradient-editor-load-right-03", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[3]);
SET_COLOR ("gradient-editor-load-right-04", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[4]);
SET_COLOR ("gradient-editor-load-right-05", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[5]);
SET_COLOR ("gradient-editor-load-right-06", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[6]);
SET_COLOR ("gradient-editor-load-right-07", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[7]);
SET_COLOR ("gradient-editor-load-right-08", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[8]);
SET_COLOR ("gradient-editor-load-right-09", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[9]);
SET_COLOR ("gradient-editor-load-right-10", color, TRUE);
SET_COLOR ("gradient-editor-load-right-01", editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-load-right-02", editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-load-right-03", editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-load-right-04", editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-load-right-05", editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-load-right-06", editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-load-right-07", editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-load-right-08", editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-load-right-09", editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-load-right-10", editor->saved_colors[9], TRUE);
SET_SENSITIVE ("gradient-editor-save-right-01", gradient);
SET_SENSITIVE ("gradient-editor-save-right-02", gradient);
@ -773,26 +743,16 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-save-right-09", gradient);
SET_SENSITIVE ("gradient-editor-save-right-10", gradient);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[0]);
SET_COLOR ("gradient-editor-save-right-01", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[1]);
SET_COLOR ("gradient-editor-save-right-02", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[2]);
SET_COLOR ("gradient-editor-save-right-03", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[3]);
SET_COLOR ("gradient-editor-save-right-04", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[4]);
SET_COLOR ("gradient-editor-save-right-05", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[5]);
SET_COLOR ("gradient-editor-save-right-06", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[6]);
SET_COLOR ("gradient-editor-save-right-07", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[7]);
SET_COLOR ("gradient-editor-save-right-08", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[8]);
SET_COLOR ("gradient-editor-save-right-09", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[9]);
SET_COLOR ("gradient-editor-save-right-10", color, TRUE);
SET_COLOR ("gradient-editor-save-right-01", editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-save-right-02", editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-save-right-03", editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-save-right-04", editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-save-right-05", editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-save-right-06", editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-save-right-07", editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-save-right-08", editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-save-right-09", editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-save-right-10", editor->saved_colors[9], TRUE);
SET_SENSITIVE ("gradient-editor-flip", editable);
SET_SENSITIVE ("gradient-editor-replicate", editable);