Skip to content

Commit

Permalink
Media Overlay: keep highlight when pausing
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfactotum committed Oct 7, 2024
1 parent ed41981 commit 05d9049
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/book-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ GObject.registerClass({
mediaOverlayStart() { return this.#exec('reader.view.startMediaOverlay') }
mediaOverlayPause() { return this.#exec('reader.view.mediaOverlay.pause') }
mediaOverlayResume() { return this.#exec('reader.view.mediaOverlay.resume') }
mediaOverlayStop() { return this.#exec('reader.view.mediaOverlay.stop') }
mediaOverlayPrev() { return this.#exec('reader.view.mediaOverlay.prev') }
mediaOverlayNext() { return this.#exec('reader.view.mediaOverlay.next') }
mediaOverlaySetVolume(x) { return this.#exec('reader.view.mediaOverlay.setVolume', x) }
Expand Down Expand Up @@ -655,6 +656,7 @@ export const BookViewer = GObject.registerClass({
'start': () => this._view.mediaOverlayStart(),
'pause': () => this._view.mediaOverlayPause(),
'resume': () => this._view.mediaOverlayResume(),
'stop': () => this._view.mediaOverlayStop(),
'backward': () => this._view.mediaOverlayPrev(),
'forward': () => this._view.mediaOverlayNext(),
'notify::volume': box => this._view.mediaOverlaySetVolume(box.volume),
Expand Down
2 changes: 1 addition & 1 deletion src/foliate-js
Submodule foliate-js updated 191 files
9 changes: 7 additions & 2 deletions src/tts.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ GObject.registerClass({
'start': {},
'pause': {},
'resume': {},
'stop': {},
'backward': {},
'forward': {},
},
Expand Down Expand Up @@ -182,12 +183,16 @@ GObject.registerClass({
this.state = 'paused'
this.emit('pause')
}
stop() {
this.state = 'stopped'
this.emit('stop')
}
backward() {
this.state = 'playing'
if (this.state === 'stopped') this.state = 'playing'
this.emit('backward')
}
forward() {
this.state = 'playing'
if (this.state === 'stopped') this.state = 'playing'
this.emit('forward')
}
})

0 comments on commit 05d9049

Please sign in to comment.