diff --git a/rikai_config.py b/rikai_config.py index 09dbd18..8e421dc 100644 --- a/rikai_config.py +++ b/rikai_config.py @@ -1,3 +1,6 @@ +# Whether to automatically pause when hover over subtitles +autopause = True + # interval between checking for the next subtitle, in seconds update_time = 0.01 diff --git a/subtitles_popup_graphics.py b/subtitles_popup_graphics.py index 4fc7b9a..6d8cf85 100644 --- a/subtitles_popup_graphics.py +++ b/subtitles_popup_graphics.py @@ -406,13 +406,14 @@ def enterEvent(self, event): if not self.already_in: self.already_in = True self.setUpdatesEnabled(True) - self.previously_paused = mpv_pause_status() - mpv_pause() + if self.parent.config.autopause: + self.previously_paused = mpv_pause_status() + mpv_pause() super().enterEvent(event) def leaveEvent(self, event): - if not self.previously_paused: + if self.parent.config.autopause and not self.previously_paused: mpv_resume() self.already_in = False