Allow disabling the transition

This commit is contained in:
Romain Vigier
2022-02-19 11:38:39 +01:00
parent 533c6788f9
commit caba6a8848
5 changed files with 80 additions and 50 deletions
+2 -1
View File
@@ -73,7 +73,8 @@ var Timer = class {
console.debug(`Time has changed to ${time}.`); console.debug(`Time has changed to ${time}.`);
this._previousTime = time; this._previousTime = time;
this._interfaceSettings.set_string('color-scheme', time === Time.NIGHT ? 'prefer-dark' : 'default'); this._interfaceSettings.set_string('color-scheme', time === Time.NIGHT ? 'prefer-dark' : 'default');
main.layoutManager.screenTransition.run(); if (this._timeSettings.get_boolean('transition'))
main.layoutManager.screenTransition.run();
this.emit('time-changed', time); this.emit('time-changed', time);
} }
+54 -49
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Night Theme Switcher\n" "Project-Id-Version: Night Theme Switcher\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-02-18 18:25+0100\n" "POT-Creation-Date: 2022-02-19 11:38+0100\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"
@@ -45,31 +45,31 @@ msgstr ""
msgid "Turn Off" msgid "Turn Off"
msgstr "" msgstr ""
#: src/preferences/SchedulePage.js:42 src/preferences/ui/SchedulePage.ui:47 #: src/preferences/SchedulePage.js:45 src/preferences/ui/SchedulePage.ui:63
msgid "Night Light" msgid "Night Light"
msgstr "" msgstr ""
#: src/preferences/SchedulePage.js:46 #: src/preferences/SchedulePage.js:49
msgid "Location Services" msgid "Location Services"
msgstr "" msgstr ""
#: src/preferences/SchedulePage.js:54 #: src/preferences/SchedulePage.js:57
msgid "Manual schedule" msgid "Manual schedule"
msgstr "" msgstr ""
#: src/preferences/SchedulePage.js:55 src/preferences/ui/SchedulePage.ui:93 #: src/preferences/SchedulePage.js:58 src/preferences/ui/SchedulePage.ui:109
msgid "On-demand" msgid "On-demand"
msgstr "" msgstr ""
#: src/preferences/SchedulePage.js:87 #: src/preferences/SchedulePage.js:90
msgid "None" msgid "None"
msgstr "" msgstr ""
#: src/preferences/SchedulePage.js:88 #: src/preferences/SchedulePage.js:91
msgid "Top bar" msgid "Top bar"
msgstr "" msgstr ""
#: src/preferences/SchedulePage.js:89 #: src/preferences/SchedulePage.js:92
msgid "System menu" msgid "System menu"
msgstr "" msgstr ""
@@ -206,104 +206,105 @@ msgid "The command to spawn at sunset"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:102 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:102
msgid "Enable backgrounds"
msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:103
msgid "Background will be changed on time change"
msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:107
#: src/preferences/ui/BackgroundsPage.ui:15 #: src/preferences/ui/BackgroundsPage.ui:15
msgid "Day background" msgid "Day background"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:108 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:103
msgid "Path to the day background" msgid "Path to the day background"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:112 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:107
#: src/preferences/ui/BackgroundsPage.ui:28 #: src/preferences/ui/BackgroundsPage.ui:28
msgid "Night background" msgid "Night background"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:113 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:108
msgid "Path to the night background" msgid "Path to the night background"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:125 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:120
#: src/preferences/ui/SchedulePage.ui:27 #: src/preferences/ui/SchedulePage.ui:43
msgid "Time source" msgid "Time source"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:126 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:121
msgid "The source used to check current time" msgid "The source used to check current time"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:130 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:125
msgid "Follow Night Light \"Disable until tomorrow\"" msgid "Follow Night Light \"Disable until tomorrow\""
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:131 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:126
msgid "Switch back to day time when Night Light is temporarily disabled" msgid "Switch back to day time when Night Light is temporarily disabled"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:135 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:130
msgid "Always enable the on-demand timer" msgid "Always enable the on-demand timer"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:136 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:131
msgid "The on-demand timer will always be enabled alongside other timers" msgid "The on-demand timer will always be enabled alongside other timers"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:144 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:139
msgid "On-demand time" msgid "On-demand time"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:145 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:140
msgid "The current time used in on-demand mode" msgid "The current time used in on-demand mode"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:149 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:144
msgid "Key combination to toggle time" msgid "Key combination to toggle time"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:150 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:145
msgid "The key combination that will toggle time in on-demand mode" msgid "The key combination that will toggle time in on-demand mode"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:159 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:154
msgid "On-demand button placement" msgid "On-demand button placement"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:160 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:155
msgid "Where the on-demand button will be placed" msgid "Where the on-demand button will be placed"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:164 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:159
msgid "Use manual time source" msgid "Use manual time source"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:165 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:160
msgid "Disable automatic time source detection" msgid "Disable automatic time source detection"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:169 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:164
msgid "Sunrise time" msgid "Sunrise time"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:170 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:165
msgid "When the day starts" msgid "When the day starts"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:174 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:169
msgid "Sunset time" msgid "Sunset time"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:175 #: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:170
msgid "When the day ends" msgid "When the day ends"
msgstr "" msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:174
#: src/preferences/ui/SchedulePage.ui:15
msgid "Transition"
msgstr ""
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:175
msgid "Use a transition when changing the color scheme"
msgstr ""
#: src/preferences/ui/BackgroundButton.ui:8 #: src/preferences/ui/BackgroundButton.ui:8
msgid "Change background" msgid "Change background"
msgstr "" msgstr ""
@@ -330,7 +331,7 @@ msgstr ""
msgid "Run commands" msgid "Run commands"
msgstr "" msgstr ""
#: src/preferences/ui/CommandsPage.ui:21 src/preferences/ui/SchedulePage.ui:67 #: src/preferences/ui/CommandsPage.ui:21 src/preferences/ui/SchedulePage.ui:83
msgid "Sunrise" msgid "Sunrise"
msgstr "" msgstr ""
@@ -339,7 +340,7 @@ msgstr ""
msgid "notify-send \"Hello sunshine!\"" msgid "notify-send \"Hello sunshine!\""
msgstr "" msgstr ""
#: src/preferences/ui/CommandsPage.ui:35 src/preferences/ui/SchedulePage.ui:79 #: src/preferences/ui/CommandsPage.ui:35 src/preferences/ui/SchedulePage.ui:95
msgid "Sunset" msgid "Sunset"
msgstr "" msgstr ""
@@ -368,44 +369,48 @@ msgstr ""
msgid "Schedule" msgid "Schedule"
msgstr "" msgstr ""
#: src/preferences/ui/SchedulePage.ui:15 #: src/preferences/ui/SchedulePage.ui:16
msgid "Smooth transition between day and night appearance."
msgstr ""
#: src/preferences/ui/SchedulePage.ui:31
msgid "Manual time source" msgid "Manual time source"
msgstr "" msgstr ""
#: src/preferences/ui/SchedulePage.ui:16 #: src/preferences/ui/SchedulePage.ui:32
msgid "" msgid ""
"The extension will try to use Night Light or Location Services to " "The extension will try to use Night Light or Location Services to "
"automatically set your current sunrise and sunset times if they are enabled. " "automatically set your current sunrise and sunset times if they are enabled. "
"If you prefer, you can manually choose a time source." "If you prefer, you can manually choose a time source."
msgstr "" msgstr ""
#: src/preferences/ui/SchedulePage.ui:33 #: src/preferences/ui/SchedulePage.ui:49
msgid "Always show on-demand controls" msgid "Always show on-demand controls"
msgstr "" msgstr ""
#: src/preferences/ui/SchedulePage.ui:34 #: src/preferences/ui/SchedulePage.ui:50
msgid "Allows you to override the current time when using a schedule." msgid "Allows you to override the current time when using a schedule."
msgstr "" msgstr ""
#: src/preferences/ui/SchedulePage.ui:50 #: src/preferences/ui/SchedulePage.ui:66
msgid "Follow <i>Disable until tomorrow</i>" msgid "Follow <i>Disable until tomorrow</i>"
msgstr "" msgstr ""
#: src/preferences/ui/SchedulePage.ui:51 #: src/preferences/ui/SchedulePage.ui:67
msgid "" msgid ""
"When Night Light is temporarily disabled, the extension will switch to day " "When Night Light is temporarily disabled, the extension will switch to day "
"variants." "variants."
msgstr "" msgstr ""
#: src/preferences/ui/SchedulePage.ui:64 #: src/preferences/ui/SchedulePage.ui:80
msgid "Manual schedule times" msgid "Manual schedule times"
msgstr "" msgstr ""
#: src/preferences/ui/SchedulePage.ui:96 #: src/preferences/ui/SchedulePage.ui:112
msgid "Keyboard shortcut" msgid "Keyboard shortcut"
msgstr "" msgstr ""
#: src/preferences/ui/SchedulePage.ui:107 #: src/preferences/ui/SchedulePage.ui:123
msgid "Button location" msgid "Button location"
msgstr "" msgstr ""
+3
View File
@@ -16,6 +16,7 @@ var SchedulePage = GObject.registerClass({
GTypeName: 'SchedulePage', GTypeName: 'SchedulePage',
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'SchedulePage.ui'])}`, Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'SchedulePage.ui'])}`,
InternalChildren: [ InternalChildren: [
'transition_switch',
'manual_time_source_switch', 'manual_time_source_switch',
'time_source_combo_row', 'time_source_combo_row',
'always_show_ondemand_switch', 'always_show_ondemand_switch',
@@ -35,6 +36,8 @@ 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') });
+16
View File
@@ -8,6 +8,22 @@ SPDX-License-Identifier: GPL-3.0-or-later
<property name="name">schedule</property> <property name="name">schedule</property>
<property name="title" translatable="yes">Schedule</property> <property name="title" translatable="yes">Schedule</property>
<property name="icon-name">nightthemeswitcher-schedule-symbolic</property> <property name="icon-name">nightthemeswitcher-schedule-symbolic</property>
<child>
<object class="AdwPreferencesGroup">
<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>
</object>
</child>
<child> <child>
<object class="AdwPreferencesGroup"> <object class="AdwPreferencesGroup">
<child> <child>
@@ -169,5 +169,10 @@ SPDX-License-Identifier: GPL-3.0-or-later
<summary>Sunset time</summary> <summary>Sunset time</summary>
<description>When the day ends</description> <description>When the day ends</description>
</key> </key>
<key name="transition" type="b">
<default>true</default>
<summary>Transition</summary>
<description>Use a transition when changing the color scheme</description>
</key>
</schema> </schema>
</schemalist> </schemalist>