From b1ca9c15bc9b2f793907a263ec6191dc4af1a577 Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Tue, 13 Oct 2020 22:07:22 +0200 Subject: [PATCH] Restore scrolling on player --- clapper_src/interface.js | 7 +++---- clapper_src/player.js | 6 ++++++ 2 files changed, 9 insertions(+), 4 deletions(-) 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));