diff --git a/clapper_src/interface.js b/clapper_src/interface.js index 9240e945..602fbf8f 100644 --- a/clapper_src/interface.js +++ b/clapper_src/interface.js @@ -51,11 +51,10 @@ class ClapperInterface extends Gtk.Grid this._player.connect('volume-changed', this._onPlayerVolumeChanged.bind(this)); this._player.connect('duration-changed', this._onPlayerDurationChanged.bind(this)); this._player.connect('position-updated', this._onPlayerPositionUpdated.bind(this)); -/* - this._player.connectWidget( - 'scroll-event', (self, event) => this.controls._onScrollEvent(event) + + this._player.scrollController.connect( + 'scroll', (ctl, dx, dy) => this.controls._onScroll(ctl, dx, dy) ); -*/ this.controls.togglePlayButton.connect( 'clicked', this._onControlsTogglePlayClicked.bind(this) ); diff --git a/clapper_src/player.js b/clapper_src/player.js index 151afa37..971e6c23 100644 --- a/clapper_src/player.js +++ b/clapper_src/player.js @@ -82,10 +82,16 @@ class ClapperPlayer extends GstPlayer.Player this.keyController = new Gtk.EventControllerKey(); this.motionController = new Gtk.EventControllerMotion(); + this.scrollController = new Gtk.EventControllerScroll(); this.dragGesture = new Gtk.GestureDrag(); + this.scrollController.set_flags( + Gtk.EventControllerScrollFlags.BOTH_AXES + ); + this.widget.add_controller(this.keyController); this.widget.add_controller(this.motionController); + this.widget.add_controller(this.scrollController); this.widget.add_controller(this.dragGesture); this.connect('state-changed', this._onStateChanged.bind(this));