Skip to content

Commit

Permalink
properly update label, don't say 'active' if chroma=0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ralfbrown committed Aug 10, 2024
1 parent a12abd0 commit 3370094
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/gui/gtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion src/iop/channelmixerrgb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3370094

Please sign in to comment.