mirror of
https://github.com/zen-browser/desktop.git
synced 2025-07-07 11:25:31 +02:00
fix: Fixed haptic feedback on color picker, b=no-bug, c=workspaces
This commit is contained in:
parent
5930552cdc
commit
d96d6831a2
2 changed files with 4 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue