Timer: Always run transition

This commit is contained in:
Romain Vigier
2022-08-16 02:58:54 +02:00
parent c29ae81b17
commit d677812d95
5 changed files with 8 additions and 35 deletions
@@ -85,8 +85,5 @@ SPDX-License-Identifier: GPL-3.0-or-later
<key name="schedule-sunset" type="d"> <key name="schedule-sunset" type="d">
<default>20</default> <default>20</default>
</key> </key>
<key name="transition" type="b">
<default>true</default>
</key>
</schema> </schema>
</schemalist> </schemalist>
-12
View File
@@ -33,18 +33,6 @@ SPDX-License-Identifier: GPL-3.0-or-later
<child> <child>
<object class="AdwPreferencesGroup"> <object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Advanced</property> <property name="title" translatable="yes">Advanced</property>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Transition</property>
<property name="subtitle" translatable="yes">Smooth transition between day and night appearance.</property>
<property name="activatable-widget">transition_switch</property>
<child>
<object class="GtkSwitch" id="transition_switch">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child> <child>
<object class="AdwActionRow"> <object class="AdwActionRow">
<property name="title" translatable="yes">Keyboard shortcut</property> <property name="title" translatable="yes">Keyboard shortcut</property>
+1 -2
View File
@@ -81,8 +81,7 @@ var Timer = class {
return; return;
debug.message(`Time has changed to ${time}.`); debug.message(`Time has changed to ${time}.`);
this.#time = time; this.#time = time;
if (this.#settings.get_boolean('transition')) main.layoutManager.screenTransition.run();
main.layoutManager.screenTransition.run();
this.#interfaceSettings.set_string('color-scheme', time === Time.NIGHT ? 'prefer-dark' : 'default'); this.#interfaceSettings.set_string('color-scheme', time === Time.NIGHT ? 'prefer-dark' : 'default');
this.emit('time-changed', time); this.emit('time-changed', time);
} }
+7 -15
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: nightthemeswitcher@romainvigier.fr\n" "Project-Id-Version: nightthemeswitcher@romainvigier.fr\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-16 02:16+0200\n" "POT-Creation-Date: 2022-08-16 02:19+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -50,7 +50,7 @@ msgstr ""
msgid "Run commands" msgid "Run commands"
msgstr "" msgstr ""
#: src/data/ui/CommandsPage.ui:21 src/data/ui/SchedulePage.ui:65 #: src/data/ui/CommandsPage.ui:21 src/data/ui/SchedulePage.ui:53
msgid "Sunrise" msgid "Sunrise"
msgstr "" msgstr ""
@@ -59,7 +59,7 @@ msgstr ""
msgid "notify-send \"Hello sunshine!\"" msgid "notify-send \"Hello sunshine!\""
msgstr "" msgstr ""
#: src/data/ui/CommandsPage.ui:35 src/data/ui/SchedulePage.ui:77 #: src/data/ui/CommandsPage.ui:35 src/data/ui/SchedulePage.ui:65
msgid "Sunset" msgid "Sunset"
msgstr "" msgstr ""
@@ -108,22 +108,14 @@ msgid "Advanced"
msgstr "" msgstr ""
#: src/data/ui/SchedulePage.ui:38 #: src/data/ui/SchedulePage.ui:38
msgid "Transition"
msgstr ""
#: src/data/ui/SchedulePage.ui:39
msgid "Smooth transition between day and night appearance."
msgstr ""
#: src/data/ui/SchedulePage.ui:50
msgid "Keyboard shortcut" msgid "Keyboard shortcut"
msgstr "" msgstr ""
#: src/data/ui/SchedulePage.ui:61 src/preferences/SchedulePage.js:51 #: src/data/ui/SchedulePage.ui:49 src/preferences/SchedulePage.js:48
msgid "Manual schedule" msgid "Manual schedule"
msgstr "" msgstr ""
#: src/data/ui/SchedulePage.ui:62 #: src/data/ui/SchedulePage.ui:50
msgid "" msgid ""
"These settings only apply when using the manual schedule as the time source." "These settings only apply when using the manual schedule as the time source."
msgstr "" msgstr ""
@@ -196,11 +188,11 @@ msgstr ""
msgid "Version %d" msgid "Version %d"
msgstr "" msgstr ""
#: src/preferences/SchedulePage.js:39 #: src/preferences/SchedulePage.js:36
msgid "Night Light" msgid "Night Light"
msgstr "" msgstr ""
#: src/preferences/SchedulePage.js:43 #: src/preferences/SchedulePage.js:40
msgid "Location Services" msgid "Location Services"
msgstr "" msgstr ""
-3
View File
@@ -17,7 +17,6 @@ var SchedulePage = GObject.registerClass({
Template: 'resource:///org/gnome/shell/extensions/nightthemeswitcher/preferences/ui/SchedulePage.ui', Template: 'resource:///org/gnome/shell/extensions/nightthemeswitcher/preferences/ui/SchedulePage.ui',
InternalChildren: [ InternalChildren: [
'keyboard_shortcut_button', 'keyboard_shortcut_button',
'transition_switch',
'manual_time_source_switch', 'manual_time_source_switch',
'time_source_combo_row', 'time_source_combo_row',
'schedule_sunrise_time_chooser', 'schedule_sunrise_time_chooser',
@@ -30,8 +29,6 @@ var SchedulePage = GObject.registerClass({
const colorSettings = new Gio.Settings({ schema: 'org.gnome.settings-daemon.plugins.color' }); const colorSettings = new Gio.Settings({ schema: 'org.gnome.settings-daemon.plugins.color' });
const locationSettings = new Gio.Settings({ schema: 'org.gnome.system.location' }); const locationSettings = new Gio.Settings({ schema: 'org.gnome.system.location' });
settings.bind('transition', this._transition_switch, 'active', Gio.SettingsBindFlags.DEFAULT);
settings.bind('manual-time-source', this._manual_time_source_switch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.bind('manual-time-source', this._manual_time_source_switch, 'active', Gio.SettingsBindFlags.DEFAULT);
const choiceFilter = new Gtk.BoolFilter({ expression: Gtk.PropertyExpression.new(DropDownChoice, null, 'enabled') }); const choiceFilter = new Gtk.BoolFilter({ expression: Gtk.PropertyExpression.new(DropDownChoice, null, 'enabled') });