Fix dead-zone slider in the KCM app
This commit is contained in:
parent
3fc4dcefd9
commit
bd973a404f
|
|
@ -883,7 +883,16 @@ void BreezyDesktopEffectConfig::updateNeckSaverVertical()
|
||||||
void BreezyDesktopEffectConfig::updateDeadZoneThresholdDeg()
|
void BreezyDesktopEffectConfig::updateDeadZoneThresholdDeg()
|
||||||
{
|
{
|
||||||
auto configJsonOpt = XRDriverIPC::instance().retrieveConfig();
|
auto configJsonOpt = XRDriverIPC::instance().retrieveConfig();
|
||||||
double val = ui.DeadZoneThresholdDeg->value() / 10.0;
|
|
||||||
|
int raw = ui.DeadZoneThresholdDeg->value();
|
||||||
|
const int clampedRaw = std::clamp(raw, 0, 50);
|
||||||
|
if (raw != clampedRaw) {
|
||||||
|
QSignalBlocker b(ui.DeadZoneThresholdDeg);
|
||||||
|
ui.DeadZoneThresholdDeg->setValue(clampedRaw);
|
||||||
|
raw = clampedRaw;
|
||||||
|
}
|
||||||
|
|
||||||
|
double val = raw / 10.0;
|
||||||
val = std::clamp(val, 0.0, 5.0);
|
val = std::clamp(val, 0.0, 5.0);
|
||||||
|
|
||||||
const double current = deadZoneThresholdDeg(configJsonOpt);
|
const double current = deadZoneThresholdDeg(configJsonOpt);
|
||||||
|
|
|
||||||
|
|
@ -666,13 +666,13 @@
|
||||||
<double>1</double>
|
<double>1</double>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>0</number>
|
<number>-5</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>50</number>
|
<number>55</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="tickStartOffset">
|
<property name="tickStartOffset">
|
||||||
<double>0</double>
|
<double>5</double>
|
||||||
</property>
|
</property>
|
||||||
<property name="tickInterval">
|
<property name="tickInterval">
|
||||||
<double>10</double>
|
<double>10</double>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue