mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
fix: Fixed haptic feedback on color picker, b=no-bug, c=workspaces
This commit is contained in:
@@ -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>
|
||||
|
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user