1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-07 21:49:58 +02:00

fix: Fixed haptic feedback on color picker, b=no-bug, c=workspaces

This commit is contained in:
mr. m 2025-06-27 16:55:20 +02:00
parent 5930552cdc
commit d96d6831a2
No known key found for this signature in database
GPG key ID: 928E01ED4C97749F
2 changed files with 4 additions and 4 deletions

View file

@ -100,7 +100,7 @@
</defs>
</svg>
</box>
<html:input type="range" min="0.2" max="0.8" value="0.4" step="0.001" id="PanelUI-zen-gradient-generator-opacity" />
<html:input type="range" min="0.3" max="0.8" value="0.4" step="0.001" id="PanelUI-zen-gradient-generator-opacity" />
</vbox>
<vbox id="PanelUI-zen-gradient-generator-texture-wrapper">
</vbox>

View file

@ -41,7 +41,7 @@
}
const MAX_OPACITY = 0.8;
const MIN_OPACITY = 0.2;
const MIN_OPACITY = 0.3;
class nsZenThemePicker extends ZenMultiWindowFeature {
static MAX_DOTS = 3;
@ -992,9 +992,9 @@
onOpacityChange(event) {
this.currentOpacity = parseFloat(event.target.value);
// If we reached a whole number (e.g., 0.1, 0.2, etc.), send a haptic feedback.
if (Math.abs((this.currentOpacity * 10) % 1) !== this._lastHapticFeedback) {
if (Math.round(this.currentOpacity * 10) !== this._lastHapticFeedback) {
Services.zen.playHapticFeedback();
this._lastHapticFeedback = Math.abs((this.currentOpacity * 10) % 1);
this._lastHapticFeedback = Math.round(this.currentOpacity * 10);
}
this.updateCurrentWorkspace();
}