From 3370094740c159bb3d98b407e6bffd9f3739d3ec Mon Sep 17 00:00:00 2001 From: ralfbrown Date: Sun, 19 May 2024 04:15:12 -0400 Subject: [PATCH] properly update label, don't say 'active' if chroma=0 When color-mapping chroma is 0, the hue slider has no effect, so say "active" only when either L != 50 or chroma != 0. Update the section label inside the value-changed callback for the items in the collapsible section so that we can immediately see the update instead of having to wait until an image is opened in darkroom view. --- src/gui/gtk.c | 3 +-- src/iop/channelmixerrgb.c | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/gtk.c b/src/gui/gtk.c index 0ae49015fdfe..c431f613fe37 100644 --- a/src/gui/gtk.c +++ b/src/gui/gtk.c @@ -4168,8 +4168,7 @@ void dt_gui_collapsible_section_set_label(dt_gui_collapsible_section_t *cs, if (!cs || !cs->label || !label) return; gtk_label_set_text(GTK_LABEL(cs->label), label); -// dt_control_queue_redraw_widget(cs->label); - dt_control_queue_redraw(); + dt_control_queue_redraw_widget(cs->label); } gboolean dt_gui_long_click(const int second, diff --git a/src/iop/channelmixerrgb.c b/src/iop/channelmixerrgb.c index c532c69007ef..1d58fe4061aa 100644 --- a/src/iop/channelmixerrgb.c +++ b/src/iop/channelmixerrgb.c @@ -600,7 +600,6 @@ static gboolean _area_mapping_active(const dt_iop_channelmixer_rgb_gui_data_t *g { return g && g->spot_mode && dt_bauhaus_combobox_get(g->spot_mode) != DT_SPOT_MODE_MEASURE && ((g->lightness_spot && dt_bauhaus_slider_get_val(g->lightness_spot) != 50.0f) || - (g->hue_spot && dt_bauhaus_slider_get_val(g->hue_spot) != 0.0f) || (g->chroma_spot && dt_bauhaus_slider_get_val(g->chroma_spot) != 0.0f)); } @@ -4013,6 +4012,9 @@ static void _spot_settings_changed_callback(GtkWidget *slider, dt_conf_set_float("darkroom/modules/channelmixerrgb/hue", Lch_target[2] * 360.f); dt_conf_set_bool("darkroom/modules/channelmixerrgb/use_mixing", use_mixing); + // update the "active" flag in the GUI + dt_gui_collapsible_section_set_label(&g->csspot, _area_mapping_section_text(g)); + ++darktable.gui->reset; _paint_hue(self); --darktable.gui->reset;