Disable highlight recovery threshold when highlight recovery = 0 and set threshold default to 0

This commit is contained in:
Thanatomanic
2018-09-02 16:58:20 +02:00
parent 52e4231c97
commit 59ca037fd7
3 changed files with 15 additions and 3 deletions

View File

@@ -111,7 +111,7 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA
//----------- Highlight recovery & threshold -------------
hlcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 0));
pack_start (*hlcompr);
hlcomprthresh = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 33));
hlcomprthresh = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 0));
pack_start (*hlcomprthresh);
//----------- Black Level & Compression -------------------
@@ -232,6 +232,10 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited)
if (!black->getAddMode()) {
shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect
}
if (!hlcompr->getAddMode()) {
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
}
brightness->setValue (pp->toneCurve.brightness);
contrast->setValue (pp->toneCurve.contrast);
@@ -620,6 +624,10 @@ void ToneCurve::adjusterChanged (Adjuster* a, double newval)
listener->panelChanged (EvSaturation, costr);
} else if (a == hlcompr) {
listener->panelChanged (EvHLCompr, costr);
if (!hlcompr->getAddMode()) {
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
}
} else if (a == hlcomprthresh) {
listener->panelChanged (EvHLComprThreshold, costr);
} else if (a == shcompr) {
@@ -663,6 +671,10 @@ void ToneCurve::neutral_pressed ()
if (!black->getAddMode()) {
shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect
}
if (!hlcompr->getAddMode()) {
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
}
contrast->setValue(0);
//saturation->setValue(0);