mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +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.width_request = 960;
|
||||||
this.player.widget.height_request = 540;
|
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.interface.addPlayer(this.player);
|
||||||
this.player.connect('state-changed', this._onPlayerStateChanged.bind(this));
|
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.add_css_class('positionscale');
|
||||||
this.positionScale.connect('value-changed', this._onPositionScaleValueChanged.bind(this));
|
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(
|
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.positionAdjustment = this.positionScale.get_adjustment();
|
||||||
this.append(this.positionScale);
|
this.append(this.positionScale);
|
||||||
}
|
}
|
||||||
@@ -295,15 +295,14 @@ var Controls = GObject.registerClass({
|
|||||||
this.elapsedButton.set_label(elapsed);
|
this.elapsedButton.set_label(elapsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onPositionScaleButtonPressEvent()
|
_onPositionScaleDragging(scale)
|
||||||
{
|
{
|
||||||
this.isPositionSeeking = true;
|
let isPositionSeeking = scale.has_css_class('dragging');
|
||||||
this.emit('position-seeking-changed', this.isPositionSeeking);
|
|
||||||
}
|
|
||||||
|
|
||||||
_onPositionScaleButtonReleaseEvent()
|
if(this.isPositionSeeking === isPositionSeeking)
|
||||||
{
|
return;
|
||||||
this.isPositionSeeking = false;
|
|
||||||
|
this.isPositionSeeking = isPositionSeeking;
|
||||||
this.emit('position-seeking-changed', this.isPositionSeeking);
|
this.emit('position-seeking-changed', this.isPositionSeeking);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user