Skip to content

Commit

Permalink
Merge pull request #111 from KseBooka/master
Browse files Browse the repository at this point in the history
feat: add increase and decrease colume level by mouse scroll
  • Loading branch information
Rirusha authored May 16, 2024
2 parents a79d82a + 1ac0bd0 commit 4ce2f20
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/widgets/buttons/menu/volume-button.vala
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ public class Cassette.VolumeButton : CustomMenuButton {

real_button.direction = Gtk.ArrowType.UP;

var se = new Gtk.EventControllerScroll (Gtk.EventControllerScrollFlags.VERTICAL);
se.scroll.connect ((dx, dy) => {
if (dy < 0) {
increase_volume ();

} else {
decrease_volume ();
}
});
add_controller (se);

Cassette.Client.settings.bind ("volume", this, "volume", SettingsBindFlags.DEFAULT);
Cassette.Client.settings.bind ("mute", this, "mute", SettingsBindFlags.DEFAULT);
}
Expand Down

0 comments on commit 4ce2f20

Please sign in to comment.