mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-29 23:32:04 +02:00
Restore seek on drop behavior
This commit is contained in:
@@ -163,13 +163,7 @@ var App = GObject.registerClass({
|
||||
|
||||
this.player.widget.width_request = 960;
|
||||
this.player.widget.height_request = 540;
|
||||
/*
|
||||
this.player.widget.add_events(
|
||||
Gdk.EventMask.SCROLL_MASK
|
||||
| Gdk.EventMask.ENTER_NOTIFY_MASK
|
||||
| Gdk.EventMask.LEAVE_NOTIFY_MASK
|
||||
);
|
||||
*/
|
||||
|
||||
this.interface.addPlayer(this.player);
|
||||
this.player.connect('state-changed', this._onPlayerStateChanged.bind(this));
|
||||
|
||||
|
25
clapper_src/controls.js
vendored
25
clapper_src/controls.js
vendored
@@ -203,14 +203,14 @@ var Controls = GObject.registerClass({
|
||||
|
||||
this.positionScale.add_css_class('positionscale');
|
||||
this.positionScale.connect('value-changed', this._onPositionScaleValueChanged.bind(this));
|
||||
/*
|
||||
|
||||
/* GTK4 is missing pressed/released signals for GtkRange/GtkScale.
|
||||
* We cannot add controllers, cause it already has them, so we
|
||||
* workaround this by observing css classes it currently has */
|
||||
this.positionScale.connect(
|
||||
'button-press-event', this._onPositionScaleButtonPressEvent.bind(this)
|
||||
'notify::css-classes', this._onPositionScaleDragging.bind(this)
|
||||
);
|
||||
this.positionScale.connect(
|
||||
'button-release-event', this._onPositionScaleButtonReleaseEvent.bind(this)
|
||||
);
|
||||
*/
|
||||
|
||||
this.positionAdjustment = this.positionScale.get_adjustment();
|
||||
this.append(this.positionScale);
|
||||
}
|
||||
@@ -295,15 +295,14 @@ var Controls = GObject.registerClass({
|
||||
this.elapsedButton.set_label(elapsed);
|
||||
}
|
||||
|
||||
_onPositionScaleButtonPressEvent()
|
||||
_onPositionScaleDragging(scale)
|
||||
{
|
||||
this.isPositionSeeking = true;
|
||||
this.emit('position-seeking-changed', this.isPositionSeeking);
|
||||
}
|
||||
let isPositionSeeking = scale.has_css_class('dragging');
|
||||
|
||||
_onPositionScaleButtonReleaseEvent()
|
||||
{
|
||||
this.isPositionSeeking = false;
|
||||
if(this.isPositionSeeking === isPositionSeeking)
|
||||
return;
|
||||
|
||||
this.isPositionSeeking = isPositionSeeking;
|
||||
this.emit('position-seeking-changed', this.isPositionSeeking);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user