BSpinner: Simplify SetMin|MaxValue()
After the last change, korli suggested this simplification that lets SetValue() do all the in/decrement-widget en/disabling. Change-Id: If87579d9104bbc9ae279aa5f2f99c9921bb238ea Reviewed-on: https://review.haiku-os.org/c/haiku/+/7053 Reviewed-by: waddlesplash <waddlesplash@gmail.com> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
parent
ac121994b1
commit
de1e2d9227
@ -249,10 +249,7 @@ void
|
||||
BDecimalSpinner::SetMinValue(double min)
|
||||
{
|
||||
fMinValue = min;
|
||||
if (fValue < fMinValue)
|
||||
SetValue(fMinValue);
|
||||
else
|
||||
SetDecrementEnabled(IsEnabled() && fValue > fMinValue);
|
||||
SetValue(Value());
|
||||
}
|
||||
|
||||
|
||||
@ -260,10 +257,7 @@ void
|
||||
BDecimalSpinner::SetMaxValue(double max)
|
||||
{
|
||||
fMaxValue = max;
|
||||
if (fValue > fMaxValue)
|
||||
SetValue(fMaxValue);
|
||||
else
|
||||
SetIncrementEnabled(IsEnabled() && fValue < fMaxValue);
|
||||
SetValue(Value());
|
||||
}
|
||||
|
||||
|
||||
|
@ -197,10 +197,7 @@ void
|
||||
BSpinner::SetMinValue(int32 min)
|
||||
{
|
||||
fMinValue = min;
|
||||
if (fValue < fMinValue)
|
||||
SetValue(fMinValue);
|
||||
else
|
||||
SetDecrementEnabled(IsEnabled() && fValue > fMinValue);
|
||||
SetValue(Value());
|
||||
}
|
||||
|
||||
|
||||
@ -208,10 +205,7 @@ void
|
||||
BSpinner::SetMaxValue(int32 max)
|
||||
{
|
||||
fMaxValue = max;
|
||||
if (fValue > fMaxValue)
|
||||
SetValue(fMaxValue);
|
||||
else
|
||||
SetIncrementEnabled(IsEnabled() && fValue < fMaxValue);
|
||||
SetValue(Value());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user