Themes page: Use expander rows

This commit is contained in:
Romain Vigier
2022-04-05 12:02:40 +02:00
parent e532ade9b3
commit 92c219065c
4 changed files with 79 additions and 103 deletions
@@ -14,7 +14,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<schema id="org.gnome.shell.extensions.nightthemeswitcher.gtk-variants" path="/org/gnome/shell/extensions/nightthemeswitcher/gtk-variants/">
<key name="enabled" type="b">
<default>false</default>
<summary>Switch GTK variants</summary>
<summary>Switch GTK theme</summary>
<description>Enable GTK variants switching</description>
</key>
<key name="day" type="s">
@@ -31,7 +31,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<schema id="org.gnome.shell.extensions.nightthemeswitcher.shell-variants" path="/org/gnome/shell/extensions/nightthemeswitcher/shell-variants/">
<key name="enabled" type="b">
<default>false</default>
<summary>Switch shell variants</summary>
<summary>Switch Shell theme</summary>
<description>Enable shell variants switching</description>
</key>
<key name="day" type="s">
@@ -48,7 +48,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<schema id="org.gnome.shell.extensions.nightthemeswitcher.icon-variants" path="/org/gnome/shell/extensions/nightthemeswitcher/icon-variants/">
<key name="enabled" type="b">
<default>false</default>
<summary>Switch icon variants</summary>
<summary>Switch icon theme</summary>
<description>Enable icon variants switching</description>
</key>
<key name="day" type="s">
@@ -65,7 +65,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<schema id="org.gnome.shell.extensions.nightthemeswitcher.cursor-variants" path="/org/gnome/shell/extensions/nightthemeswitcher/cursor-variants/">
<key name="enabled" type="b">
<default>false</default>
<summary>Switch cursor variants</summary>
<summary>Switch cursor theme</summary>
<description>Enable cursor variants switching</description>
</key>
<key name="day" type="s">
+16 -28
View File
@@ -25,13 +25,11 @@ SPDX-License-Identifier: GPL-3.0-or-later
</child>
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">GTK theme</property>
<property name="description" translatable="yes">Forcing a dark theme on applications not designed to support it can have undesirable side-effects such as unreadable text or invisible icons.</property>
<property name="header-suffix">
<object class="GtkSwitch" id="gtk_enabled_switch">
<property name="valign">center</property>
</object>
</property>
<child>
<object class="AdwExpanderRow" id="gtk_row">
<property name="title" translatable="yes">Switch GTK theme</property>
<property name="subtitle" translatable="yes">Forcing a dark theme on applications not designed to support it can have undesirable side-effects such as unreadable text or invisible icons.</property>
<property name="show-enable-switch">True</property>
<child>
<object class="AdwComboRow" id="gtk_day_variant_combo_row">
<property name="title" translatable="yes">Day variant</property>
@@ -45,13 +43,9 @@ SPDX-License-Identifier: GPL-3.0-or-later
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Shell theme</property>
<property name="header-suffix">
<object class="GtkSwitch" id="shell_enabled_switch">
<property name="valign">center</property>
</object>
</property>
<object class="AdwExpanderRow" id="shell_row">
<property name="title" translatable="yes">Switch Shell theme</property>
<property name="show-enable-switch">True</property>
<child>
<object class="AdwComboRow" id="shell_day_variant_combo_row">
<property name="title" translatable="yes">Day variant</property>
@@ -65,13 +59,9 @@ SPDX-License-Identifier: GPL-3.0-or-later
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Icon theme</property>
<property name="header-suffix">
<object class="GtkSwitch" id="icon_enabled_switch">
<property name="valign">center</property>
</object>
</property>
<object class="AdwExpanderRow" id="icon_row">
<property name="title" translatable="yes">Switch icon theme</property>
<property name="show-enable-switch">True</property>
<child>
<object class="AdwComboRow" id="icon_day_variant_combo_row">
<property name="title" translatable="yes">Day variant</property>
@@ -85,13 +75,9 @@ SPDX-License-Identifier: GPL-3.0-or-later
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Cursor theme</property>
<property name="header-suffix">
<object class="GtkSwitch" id="cursor_enabled_switch">
<property name="valign">center</property>
</object>
</property>
<object class="AdwExpanderRow" id="cursor_row">
<property name="title" translatable="yes">Switch cursor theme</property>
<property name="show-enable-switch">True</property>
<child>
<object class="AdwComboRow" id="cursor_day_variant_combo_row">
<property name="title" translatable="yes">Day variant</property>
@@ -104,5 +90,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
+14 -26
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: nightthemeswitcher@romainvigier.fr\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-05 11:41+0200\n"
"POT-Creation-Date: 2022-04-05 12:01+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -26,7 +26,8 @@ msgid "The current extension settings version"
msgstr ""
#: src/data/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:17
msgid "Switch GTK variants"
#: src/data/ui/ThemesPage.ui:30
msgid "Switch GTK theme"
msgstr ""
#: src/data/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:18
@@ -50,7 +51,8 @@ msgid "The GTK theme to use during nighttime"
msgstr ""
#: src/data/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:34
msgid "Switch shell variants"
#: src/data/ui/ThemesPage.ui:47
msgid "Switch Shell theme"
msgstr ""
#: src/data/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:35
@@ -74,7 +76,8 @@ msgid "The shell theme to use during nighttime"
msgstr ""
#: src/data/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:51
msgid "Switch icon variants"
#: src/data/ui/ThemesPage.ui:63
msgid "Switch icon theme"
msgstr ""
#: src/data/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:52
@@ -98,7 +101,8 @@ msgid "The icon theme to use during nighttime"
msgstr ""
#: src/data/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:68
msgid "Switch cursor variants"
#: src/data/ui/ThemesPage.ui:79
msgid "Switch cursor theme"
msgstr ""
#: src/data/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:69
@@ -400,38 +404,22 @@ msgid ""
"themes is discouraged and is only here for legacy reasons."
msgstr ""
#: src/data/ui/ThemesPage.ui:28
msgid "GTK theme"
msgstr ""
#: src/data/ui/ThemesPage.ui:29
#: src/data/ui/ThemesPage.ui:31
msgid ""
"Forcing a dark theme on applications not designed to support it can have "
"undesirable side-effects such as unreadable text or invisible icons."
msgstr ""
#: src/data/ui/ThemesPage.ui:37 src/data/ui/ThemesPage.ui:57
#: src/data/ui/ThemesPage.ui:77 src/data/ui/ThemesPage.ui:97
#: src/data/ui/ThemesPage.ui:35 src/data/ui/ThemesPage.ui:51
#: src/data/ui/ThemesPage.ui:67 src/data/ui/ThemesPage.ui:83
msgid "Day variant"
msgstr ""
#: src/data/ui/ThemesPage.ui:42 src/data/ui/ThemesPage.ui:62
#: src/data/ui/ThemesPage.ui:82 src/data/ui/ThemesPage.ui:102
#: src/data/ui/ThemesPage.ui:40 src/data/ui/ThemesPage.ui:56
#: src/data/ui/ThemesPage.ui:72 src/data/ui/ThemesPage.ui:88
msgid "Night variant"
msgstr ""
#: src/data/ui/ThemesPage.ui:49
msgid "Shell theme"
msgstr ""
#: src/data/ui/ThemesPage.ui:69
msgid "Icon theme"
msgstr ""
#: src/data/ui/ThemesPage.ui:89
msgid "Cursor theme"
msgstr ""
#. Time separator (eg. 08:27)
#: src/data/ui/TimeChooser.ui:23
msgid ":"
+8 -8
View File
@@ -16,16 +16,16 @@ var ThemesPage = GObject.registerClass({
GTypeName: 'ThemesPage',
Template: 'resource:///org/gnome/shell/extensions/nightthemeswitcher/preferences/ui/ThemesPage.ui',
InternalChildren: [
'gtk_enabled_switch',
'gtk_row',
'gtk_day_variant_combo_row',
'gtk_night_variant_combo_row',
'shell_enabled_switch',
'shell_row',
'shell_day_variant_combo_row',
'shell_night_variant_combo_row',
'icon_enabled_switch',
'icon_row',
'icon_day_variant_combo_row',
'icon_night_variant_combo_row',
'cursor_enabled_switch',
'cursor_row',
'cursor_day_variant_combo_row',
'cursor_night_variant_combo_row',
],
@@ -37,28 +37,28 @@ var ThemesPage = GObject.registerClass({
const iconSettings = extensionUtils.getSettings(utils.getSettingsSchema('icon-variants'));
const cursorSettings = extensionUtils.getSettings(utils.getSettingsSchema('cursor-variants'));
gtkSettings.bind('enabled', this._gtk_enabled_switch, 'active', Gio.SettingsBindFlags.DEFAULT);
gtkSettings.bind('enabled', this._gtk_row, 'enable-expansion', Gio.SettingsBindFlags.DEFAULT);
const gtkThemesStore = Gio.ListStore.new(DropDownChoice);
gtkThemesStore.splice(0, 0, Array.from(utils.getInstalledGtkThemes()).sort().map(theme => new DropDownChoice({ id: theme, title: theme })));
_setupComboRow(this._gtk_day_variant_combo_row, gtkThemesStore, gtkSettings, 'day');
_setupComboRow(this._gtk_night_variant_combo_row, gtkThemesStore, gtkSettings, 'night');
shellSettings.bind('enabled', this._shell_enabled_switch, 'active', Gio.SettingsBindFlags.DEFAULT);
shellSettings.bind('enabled', this._shell_row, 'enable-expansion', Gio.SettingsBindFlags.DEFAULT);
const shellThemesStore = Gio.ListStore.new(DropDownChoice);
shellThemesStore.splice(0, 0, Array.from(utils.getInstalledShellThemes()).sort().map(theme => new DropDownChoice({ id: theme, title: theme || _('Default') })));
_setupComboRow(this._shell_day_variant_combo_row, shellThemesStore, shellSettings, 'day');
_setupComboRow(this._shell_night_variant_combo_row, shellThemesStore, shellSettings, 'night');
iconSettings.bind('enabled', this._icon_enabled_switch, 'active', Gio.SettingsBindFlags.DEFAULT);
iconSettings.bind('enabled', this._icon_row, 'enable-expansion', Gio.SettingsBindFlags.DEFAULT);
const iconThemesStore = Gio.ListStore.new(DropDownChoice);
iconThemesStore.splice(0, 0, Array.from(utils.getInstalledIconThemes()).sort().map(theme => new DropDownChoice({ id: theme, title: theme })));
_setupComboRow(this._icon_day_variant_combo_row, iconThemesStore, iconSettings, 'day');
_setupComboRow(this._icon_night_variant_combo_row, iconThemesStore, iconSettings, 'night');
cursorSettings.bind('enabled', this._cursor_enabled_switch, 'active', Gio.SettingsBindFlags.DEFAULT);
cursorSettings.bind('enabled', this._cursor_row, 'enable-expansion', Gio.SettingsBindFlags.DEFAULT);
const cursorThemesStore = Gio.ListStore.new(DropDownChoice);
cursorThemesStore.splice(0, 0, Array.from(utils.getInstalledCursorThemes()).sort().map(theme => new DropDownChoice({ id: theme, title: theme })));