Skip to content

Commit

Permalink
Hide it instead of disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbende committed Dec 23, 2023
1 parent 1be8d73 commit d9a76e1
Showing 4 changed files with 4 additions and 20 deletions.
12 changes: 3 additions & 9 deletions cozy/ui/media_controller.py
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 1 addition & 5 deletions data/ui/main_window.ui
Original file line number Diff line number Diff line change
@@ -220,11 +220,7 @@
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="media_control_box">
<style>
<class name="player_bar"/>
</style>
</object>
<object class="GtkRevealer" id="media_control_box"/>
</child>
<child>
<object class="AdwViewSwitcherBar" id="mobile_view_switcher">
5 changes: 0 additions & 5 deletions data/ui/media_controller.ui
Original file line number Diff line number Diff line change
@@ -106,7 +106,6 @@
<property name="spacing">6</property>
<child>
<object class="GtkButton" id="prev_button">
<property name="sensitive">false</property>
<property name="focusable">true</property>
<property name="receives-default">true</property>
<property name="tooltip-text" translatable="true">Rewind</property>
@@ -126,7 +125,6 @@
<object class="GtkButton" id="play_button">
<property name="width-request">42</property>
<property name="height-request">42</property>
<property name="sensitive">false</property>
<property name="focusable">true</property>
<property name="receives-default">true</property>
<property name="tooltip-text" translatable="true">Start playback</property>
@@ -145,7 +143,6 @@
</child>
<child>
<object class="GtkButton" id="next_button">
<property name="sensitive">false</property>
<property name="focusable">true</property>
<property name="receives-default">true</property>
<property name="tooltip-text" translatable="true">Forward</property>
@@ -200,7 +197,6 @@ audio-volume-medium-symbolic</property>
</child>
<child>
<object class="GtkMenuButton" id="playback_speed_button">
<property name="sensitive">false</property>
<property name="focusable">true</property>
<property name="receives-default">true</property>
<property name="tooltip-text" translatable="true">Playback speed</property>
@@ -212,7 +208,6 @@ audio-volume-medium-symbolic</property>
</child>
<child>
<object class="GtkMenuButton" id="timer_button">
<property name="sensitive">false</property>
<property name="focusable">true</property>
<property name="receives-default">true</property>
<property name="tooltip-text" translatable="true">Sleep timer</property>
1 change: 0 additions & 1 deletion data/ui/seek_bar.ui
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@
<child>
<object class="GtkScale" id="progress_scale">
<property name="width-request">150</property>
<property name="sensitive">false</property>
<property name="focusable">true</property>
<property name="tooltip-text" translatable="true">Jump to position in current chapter</property>
<property name="valign">center</property>

0 comments on commit d9a76e1

Please sign in to comment.