mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-05-21 04:26:40 +08:00
feat(cli): added --hide-info-window
option (#313)
* feat(cli): added `--hide-info-window` option This was suggested by Discord use #dung_14424 on the Manim Discord. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
<!-- start changelog -->
|
||||
|
||||
(v5.1)=
|
||||
## [v5.1 (Unreleased)](https://github.com/jeertmans/manim-slides/compare/v5.0.0...HEAD)
|
||||
|
||||
(v5.1-added)=
|
||||
### Added
|
||||
|
||||
- Added the `--hide-info-window` option to `manim-slides present`.
|
||||
[#313](https://github.com/jeertmans/manim-slides/pull/313)
|
||||
|
||||
## [v5](https://github.com/jeertmans/manim-slides/compare/v4.16.0...v5.0.0)
|
||||
|
||||
Prior to v5, there was no real CHANGELOG other than the GitHub releases,
|
||||
|
@ -225,6 +225,11 @@ def start_at_callback(
|
||||
is_flag=True,
|
||||
help="If set, pressing next will turn any looping slide into a play slide.",
|
||||
)
|
||||
@click.option(
|
||||
"--hide-info-window",
|
||||
is_flag=True,
|
||||
help="Hide info window.",
|
||||
)
|
||||
@click.help_option("-h", "--help")
|
||||
@verbosity_option
|
||||
def present(
|
||||
@ -243,6 +248,7 @@ def present(
|
||||
screen_number: Optional[int],
|
||||
playback_rate: float,
|
||||
next_terminates_loop: bool,
|
||||
hide_info_window: bool,
|
||||
) -> None:
|
||||
"""
|
||||
Present SCENE(s), one at a time, in order.
|
||||
@ -304,6 +310,7 @@ def present(
|
||||
screen=screen,
|
||||
playback_rate=playback_rate,
|
||||
next_terminates_loop=next_terminates_loop,
|
||||
hide_info_window=hide_info_window,
|
||||
)
|
||||
|
||||
player.show()
|
||||
|
@ -55,6 +55,7 @@ class Player(QMainWindow): # type: ignore[misc]
|
||||
screen: Optional[QScreen] = None,
|
||||
playback_rate: float = 1.0,
|
||||
next_terminates_loop: bool = False,
|
||||
hide_info_window: bool = False,
|
||||
):
|
||||
super().__init__()
|
||||
|
||||
@ -109,6 +110,7 @@ class Player(QMainWindow): # type: ignore[misc]
|
||||
self.slide_changed.connect(self.slide_changed_callback)
|
||||
|
||||
self.info = Info(parent=self)
|
||||
self.hide_info_window = hide_info_window
|
||||
|
||||
# Connecting key callbacks
|
||||
|
||||
@ -120,6 +122,7 @@ class Player(QMainWindow): # type: ignore[misc]
|
||||
self.config.keys.REPLAY.connect(self.replay)
|
||||
self.config.keys.FULL_SCREEN.connect(self.full_screen)
|
||||
self.config.keys.HIDE_MOUSE.connect(self.hide_mouse)
|
||||
# self.config.keys.PREVIOUS_REVERSE.connect(self.previous_reverse)
|
||||
|
||||
self.dispatch = self.config.keys.dispatch_key_function()
|
||||
|
||||
@ -304,7 +307,9 @@ class Player(QMainWindow): # type: ignore[misc]
|
||||
|
||||
def show(self) -> None:
|
||||
super().show()
|
||||
self.info.show()
|
||||
|
||||
if not self.hide_info_window:
|
||||
self.info.show()
|
||||
|
||||
@Slot()
|
||||
def close(self) -> None:
|
||||
@ -332,6 +337,13 @@ class Player(QMainWindow): # type: ignore[misc]
|
||||
def reverse(self) -> None:
|
||||
self.load_reversed_slide()
|
||||
|
||||
@Slot()
|
||||
def previous_reverse(self) -> None:
|
||||
position = self.media_player.position()
|
||||
self.media_player.setPlaybackRate(-1.0)
|
||||
self.media_player.setPosition(position)
|
||||
# self.load_reversed_slide()
|
||||
|
||||
@Slot()
|
||||
def replay(self) -> None:
|
||||
self.media_player.setPosition(0)
|
||||
|
Reference in New Issue
Block a user