From d9a76e1fe86003d14643c085233b45f716ad42b8 Mon Sep 17 00:00:00 2001 From: rdbende Date: Sat, 23 Dec 2023 12:04:00 +0100 Subject: [PATCH] Hide it instead of disabling --- cozy/ui/media_controller.py | 12 +++--------- data/ui/main_window.ui | 6 +----- data/ui/media_controller.ui | 5 ----- data/ui/seek_bar.ui | 1 - 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/cozy/ui/media_controller.py b/cozy/ui/media_controller.py index b5c9a506..fe3e3e05 100644 --- a/cozy/ui/media_controller.py +++ b/cozy/ui/media_controller.py @@ -40,8 +40,8 @@ class MediaController(Adw.BreakpointBin): def __init__(self, main_window_builder: Gtk.Builder): super().__init__() - media_control_box: Gtk.Box = main_window_builder.get_object("media_control_box") - media_control_box.append(self) + self.container_bar: Gtk.Revealer = main_window_builder.get_object("media_control_box") + self.container_bar.set_child(self) self.seek_bar = SeekBar() self.seek_bar_container.append(self.seek_bar) @@ -127,13 +127,7 @@ def _on_length_changed(self): def _on_lock_ui_changed(self): sensitive = not self._playback_control_view_model.lock_ui - self.seek_bar.sensitive = sensitive - self.prev_button.set_sensitive(sensitive) - self.next_button.set_sensitive(sensitive) - self.play_button.set_sensitive(sensitive) - self.volume_button.set_sensitive(sensitive) - self.playback_speed_button.set_sensitive(sensitive) - self.timer_button.set_sensitive(sensitive) + self.container_bar.set_reveal_child(sensitive) def _on_volume_changed(self): self.volume_button.set_value(self._playback_control_view_model.volume) diff --git a/data/ui/main_window.ui b/data/ui/main_window.ui index b6ad6048..d8b541cd 100644 --- a/data/ui/main_window.ui +++ b/data/ui/main_window.ui @@ -220,11 +220,7 @@ vertical - - - + diff --git a/data/ui/media_controller.ui b/data/ui/media_controller.ui index fac4dd60..46318de5 100644 --- a/data/ui/media_controller.ui +++ b/data/ui/media_controller.ui @@ -106,7 +106,6 @@ 6 - false true true Rewind @@ -126,7 +125,6 @@ 42 42 - false true true Start playback @@ -145,7 +143,6 @@ - false true true Forward @@ -200,7 +197,6 @@ audio-volume-medium-symbolic - false true true Playback speed @@ -212,7 +208,6 @@ audio-volume-medium-symbolic - false true true Sleep timer diff --git a/data/ui/seek_bar.ui b/data/ui/seek_bar.ui index 6873bf27..2254819d 100644 --- a/data/ui/seek_bar.ui +++ b/data/ui/seek_bar.ui @@ -26,7 +26,6 @@ 150 - false true Jump to position in current chapter center