Skip to content

Commit

Permalink
Remove togglable sleep timer fadeout preference
Browse files Browse the repository at this point in the history
Instead of this being an optional thing, let's make it an actual
feature, and use it always
  • Loading branch information
rdbende committed Dec 1, 2024
1 parent 1c65d74 commit d612f9b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 46 deletions.
8 changes: 0 additions & 8 deletions cozy/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ def prefer_external_cover(self) -> bool:
def prefer_external_cover(self, new_value: bool):
self._settings.set_boolean("prefer-external-cover", new_value)

@property
def sleep_timer_fadeout(self) -> bool:
return self._settings.get_boolean("sleep-timer-fadeout")

@property
def sleep_timer_fadeout_duration(self) -> int:
return self._settings.get_int("sleep-timer-fadeout-duration")

@property
def timer(self) -> int:
return self._settings.get_int("timer")
Expand Down
4 changes: 0 additions & 4 deletions cozy/ui/preferences_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ class PreferencesWindow(Adw.PreferencesDialog):

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()
artwork_prefer_external_switch: Adw.SwitchRow = Gtk.Template.Child()

rewind_duration_adjustment: Gtk.Adjustment = Gtk.Template.Child()
forward_duration_adjustment: Gtk.Adjustment = Gtk.Template.Child()
fadeout_duration_adjustment: Gtk.Adjustment = Gtk.Template.Child()

def __init__(self) -> None:
super().__init__()
Expand All @@ -47,8 +45,6 @@ def _bind_settings(self) -> None:
bind_settings("replay", self.replay_switch, "active")
bind_settings("rewind-duration", self.rewind_duration_adjustment, "value")
bind_settings("forward-duration", self.forward_duration_adjustment, "value")
bind_settings("sleep-timer-fadeout", self.sleep_timer_fadeout_switch, "enable-expansion")
bind_settings("sleep-timer-fadeout-duration", self.fadeout_duration_adjustment, "value")
bind_settings("prefer-external-cover", self.artwork_prefer_external_switch, "active")

def _on_lock_ui_changed(self) -> None:
Expand Down
10 changes: 0 additions & 10 deletions data/com.github.geigi.cozy.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@
<summary>Swap author and reader tag assignment.</summary>
<description></description>
</key>
<key type="b" name="sleep-timer-fadeout">
<default>false</default>
<summary>Enable fading out when using the sleep timer.</summary>
<description></description>
</key>
<key type="i" name="sleep-timer-fadeout-duration">
<default>15</default>
<summary>Duration of the sleep timer fadeout.</summary>
<description></description>
</key>
<key type="d" name="volume">
<default>1.0</default>
<summary>Volume.</summary>
Expand Down
24 changes: 0 additions & 24 deletions data/ui/preferences.blp
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
using Gtk 4.0;
using Adw 1;

Adjustment fadeout_duration_adjustment {
upper: 120;
value: 15;
step-increment: 5;
page-increment: 10;
}

Adjustment forward_duration_adjustment {
lower: 5;
Expand Down Expand Up @@ -61,24 +55,6 @@ template $PreferencesWindow: Adw.PreferencesDialog {
numeric: true;
}
}

Adw.PreferencesGroup {
title: _("Sleep Timer");

Adw.ExpanderRow sleep_timer_fadeout_switch {
title: _("Fadeout");
expanded: true;
show-enable-switch: true;

Adw.SpinRow {
title: _("Fadeout Duration");
focusable: true;
adjustment: fadeout_duration_adjustment;
snap-to-ticks: true;
numeric: true;
}
}
}
}

Adw.PreferencesPage storages_page {
Expand Down

0 comments on commit d612f9b

Please sign in to comment.