Skip to content

Commit

Permalink
Use AdwExpanderRow
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbende committed Dec 20, 2023
1 parent fcc0fe8 commit 9693858
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
3 changes: 1 addition & 2 deletions cozy/ui/preferences_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class PreferencesView(Adw.PreferencesWindow):
swap_author_reader_switch: Adw.SwitchRow = Gtk.Template.Child()
replay_switch: Adw.SwitchRow = Gtk.Template.Child()
sleep_timer_fadeout_switch: Adw.SwitchRow = Gtk.Template.Child()
fadeout_duration_spin_button: Adw.SpinRow = Gtk.Template.Child()
artwork_prefer_external_switch: Adw.SwitchRow = Gtk.Template.Child()

rewind_duration_adjustment: Gtk.Adjustment = Gtk.Template.Child()
Expand Down Expand Up @@ -60,7 +59,7 @@ def _bind_settings(self):
self._glib_settings.bind("forward-duration", self.forward_duration_adjustment, "value",
Gio.SettingsBindFlags.DEFAULT)

self._glib_settings.bind("sleep-timer-fadeout", self.sleep_timer_fadeout_switch, "active",
self._glib_settings.bind("sleep-timer-fadeout", self.sleep_timer_fadeout_switch, "enable-expansion",
Gio.SettingsBindFlags.DEFAULT)

self._glib_settings.bind("sleep-timer-fadeout-duration", self.fadeout_duration_adjustment,
Expand Down
22 changes: 12 additions & 10 deletions data/ui/preferences.ui
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,19 @@
<object class="AdwPreferencesGroup">
<property name="title" translatable="true">Sleep Timer</property>
<child>
<object class="AdwSwitchRow" id="sleep_timer_fadeout_switch">
<object class="AdwExpanderRow" id="sleep_timer_fadeout_switch">
<property name="title">Fadeout</property>
</object>
</child>
<child>
<object class="AdwSpinRow" id="fadeout_duration_spin_button">
<property name="title">Fadeout duration</property>
<property name="focusable">true</property>
<property name="adjustment">fadeout_duration_adjustment</property>
<property name="snap-to-ticks">true</property>
<property name="numeric">true</property>
<property name="expanded">true</property>
<property name="show-enable-switch">true</property>
<child>
<object class="AdwSpinRow">
<property name="title">Fadeout duration</property>
<property name="focusable">true</property>
<property name="adjustment">fadeout_duration_adjustment</property>
<property name="snap-to-ticks">true</property>
<property name="numeric">true</property>
</object>
</child>
</object>
</child>
</object>
Expand Down

0 comments on commit 9693858

Please sign in to comment.