Skip to content

Commit

Permalink
Merge pull request linuxmint#6573 from timfeierabend/sound150/add-vol…
Browse files Browse the repository at this point in the history
…ume-drag-sound

sound150@claudiux: Play volume change sound after changing volume via dragging slider
  • Loading branch information
claudiux authored Nov 15, 2024
2 parents 10b24fc + 1b42a17 commit 00eb223
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
10 changes: 9 additions & 1 deletion sound150@claudiux/files/sound150@claudiux/4.6/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ class VolumeSlider extends PopupMenu.PopupSliderMenuItem {
this.tooltip = new Tooltips.Tooltip(this.actor, this.tooltipText);

this.connect("value-changed", () => this._onValueChanged());
if (tooltip === _("Volume")) {
this.connect("drag-end", () => this._onDragEnd());
}

this.app_icon = app_icon;
if (this.app_icon == null) {
Expand Down Expand Up @@ -198,6 +201,12 @@ class VolumeSlider extends PopupMenu.PopupSliderMenuItem {
this.applet._notifyVolumeChange(this.stream);
}

_onDragEnd() {
if (this.stream) {
this.applet._notifyVolumeChange(this.stream);
}
}

_onScrollEvent(actor, event) {
let direction = event.get_scroll_direction();

Expand Down Expand Up @@ -227,7 +236,6 @@ class VolumeSlider extends PopupMenu.PopupSliderMenuItem {
}
this._slider.queue_repaint();
this.emit('value-changed', this._value);
this.emit('drag-end');
return true;
}
return false;
Expand Down
10 changes: 9 additions & 1 deletion sound150@claudiux/files/sound150@claudiux/5.4/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ class VolumeSlider extends PopupMenu.PopupSliderMenuItem {
this.tooltip = new Tooltips.Tooltip(this.actor, this.tooltipText);

this.connect("value-changed", () => this._onValueChanged());
if (tooltip === _("Volume")) {
this.connect("drag-end", () => this._onDragEnd());
}

this.app_icon = app_icon;
if (this.app_icon == null) {
Expand Down Expand Up @@ -349,6 +352,12 @@ class VolumeSlider extends PopupMenu.PopupSliderMenuItem {
this.applet._notifyVolumeChange(this.stream);
}

_onDragEnd() {
if (this.stream) {
this.applet._notifyVolumeChange(this.stream);
}
}

_onScrollEvent(actor, event) {
let direction = event.get_scroll_direction();

Expand Down Expand Up @@ -379,7 +388,6 @@ class VolumeSlider extends PopupMenu.PopupSliderMenuItem {
}
this._slider.queue_repaint();
this.emit("value-changed", this._value);
this.emit("drag-end");
return true;
}
return false;
Expand Down
10 changes: 9 additions & 1 deletion sound150@claudiux/files/sound150@claudiux/6.4/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ class VolumeSlider extends PopupMenu.PopupSliderMenuItem {
this.tooltip = new Tooltips.Tooltip(this.actor, this.tooltipText);

this.connect("value-changed", () => this._onValueChanged());
if (tooltip === _("Volume")) {
this.connect("drag-end", () => this._onDragEnd());
}

this.app_icon = app_icon;
if (this.app_icon == null) {
Expand Down Expand Up @@ -350,6 +353,12 @@ class VolumeSlider extends PopupMenu.PopupSliderMenuItem {
this.applet._notifyVolumeChange(this.stream);
}

_onDragEnd() {
if (this.stream) {
this.applet._notifyVolumeChange(this.stream);
}
}

_onScrollEvent(actor, event) {
let direction = event.get_scroll_direction();

Expand Down Expand Up @@ -380,7 +389,6 @@ class VolumeSlider extends PopupMenu.PopupSliderMenuItem {
}
this._slider.queue_repaint();
this.emit("value-changed", this._value);
this.emit("drag-end");
return true;
}
return false;
Expand Down

0 comments on commit 00eb223

Please sign in to comment.