app: color widget updated properly when editing colors.

Also note that GimpColorPanel doesn't need to react differently whether
GimpColorDialog returned OK or CANCEL, as the dialog keep track and
return the appropriate color to set in the end of the process.
This commit is contained in:
Jehan 2019-03-20 11:21:46 +01:00
parent 4dcda7ffb8
commit 7cf06c3f60
2 changed files with 5 additions and 10 deletions

View File

@ -603,6 +603,7 @@ gimp_text_options_gui (GimpToolOptions *tool_options)
button = gimp_prop_color_button_new (config, "foreground", _("Text Color"),
40, 24, GIMP_COLOR_AREA_FLAT);
gimp_color_button_set_update (GIMP_COLOR_BUTTON (button), TRUE);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),
GIMP_CONTEXT (options));
gtk_widget_set_halign (button, GTK_ALIGN_START);

View File

@ -309,17 +309,11 @@ gimp_color_panel_dialog_update (GimpColorDialog *dialog,
break;
case GIMP_COLOR_DIALOG_OK:
if (! gimp_color_button_get_update (GIMP_COLOR_BUTTON (panel)))
gimp_color_button_set_color (GIMP_COLOR_BUTTON (panel), color);
gtk_widget_hide (panel->color_dialog);
g_signal_emit (panel, color_panel_signals[RESPONSE], 0,
state);
break;
case GIMP_COLOR_DIALOG_CANCEL:
if (gimp_color_button_get_update (GIMP_COLOR_BUTTON (panel)))
gimp_color_button_set_color (GIMP_COLOR_BUTTON (panel), color);
/* GimpColorDialog returns the appropriate color (new one or
* original one if process cancelled.
*/
gimp_color_button_set_color (GIMP_COLOR_BUTTON (panel), color);
gtk_widget_hide (panel->color_dialog);
g_signal_emit (panel, color_panel_signals[RESPONSE], 0,