Background button: Add SVG support

This commit is contained in:
Romain Vigier
2022-04-26 22:38:15 +02:00
parent 9cbfe7eda8
commit 4d52a7eefd
3 changed files with 14 additions and 11 deletions
+1
View File
@@ -36,6 +36,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<mime-types> <mime-types>
<mime-type>image/jpeg</mime-type> <mime-type>image/jpeg</mime-type>
<mime-type>image/png</mime-type> <mime-type>image/png</mime-type>
<mime-type>image/svg+xml</mime-type>
<mime-type>image/tiff</mime-type> <mime-type>image/tiff</mime-type>
<mime-type>application/xml</mime-type> <mime-type>application/xml</mime-type>
</mime-types> </mime-types>
+10 -10
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-04-05 12:01+0200\n" "POT-Creation-Date: 2022-04-26 22:37+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"
@@ -425,36 +425,36 @@ msgstr ""
msgid ":" msgid ":"
msgstr "" msgstr ""
#: src/modules/TimerOndemand.js:212 #: src/modules/TimerOndemand.js:213
msgid "Turn Night Mode Off" msgid "Turn Night Mode Off"
msgstr "" msgstr ""
#: src/modules/TimerOndemand.js:212 #: src/modules/TimerOndemand.js:213
msgid "Turn Night Mode On" msgid "Turn Night Mode On"
msgstr "" msgstr ""
#: src/modules/TimerOndemand.js:227 #: src/modules/TimerOndemand.js:228
msgid "Extension Settings" msgid "Extension Settings"
msgstr "" msgstr ""
#: src/modules/TimerOndemand.js:235 #: src/modules/TimerOndemand.js:237
msgid "Night Mode Off" msgid "Night Mode Off"
msgstr "" msgstr ""
#: src/modules/TimerOndemand.js:235 #: src/modules/TimerOndemand.js:237
msgid "Night Mode On" msgid "Night Mode On"
msgstr "" msgstr ""
#: src/modules/TimerOndemand.js:236 #: src/modules/TimerOndemand.js:238
msgid "Turn Off" msgid "Turn Off"
msgstr "" msgstr ""
#: src/modules/TimerOndemand.js:236 #: src/modules/TimerOndemand.js:238
msgid "Turn On" msgid "Turn On"
msgstr "" msgstr ""
#: src/preferences/BackgroundButton.js:71 #: src/preferences/BackgroundButton.js:74
msgid "Only JPEG, PNG, TIFF and XML files can be set as background image." msgid "Only JPEG, PNG, TIFF, SVG and XML files can be set as background image."
msgstr "" msgstr ""
#: src/preferences/SchedulePage.js:48 #: src/preferences/SchedulePage.js:48
+3 -1
View File
@@ -62,6 +62,7 @@ var BackgroundButton = GObject.registerClass({
if ( if (
Gio.content_type_equals(contentType, 'image/jpeg') || Gio.content_type_equals(contentType, 'image/jpeg') ||
Gio.content_type_equals(contentType, 'image/png') || Gio.content_type_equals(contentType, 'image/png') ||
Gio.content_type_equals(contentType, 'image/svg+xml') ||
Gio.content_type_equals(contentType, 'image/tiff') || Gio.content_type_equals(contentType, 'image/tiff') ||
Gio.content_type_equals(contentType, 'application/xml') Gio.content_type_equals(contentType, 'application/xml')
) { ) {
@@ -70,7 +71,7 @@ var BackgroundButton = GObject.registerClass({
} else { } else {
if (this.root instanceof Adw.PreferencesWindow) { if (this.root instanceof Adw.PreferencesWindow) {
this.root.add_toast(new Adw.Toast({ this.root.add_toast(new Adw.Toast({
title: _('Only JPEG, PNG, TIFF and XML files can be set as background image.'), title: _('Only JPEG, PNG, TIFF, SVG and XML files can be set as background image.'),
timeout: 10, timeout: 10,
})); }));
} }
@@ -109,6 +110,7 @@ var BackgroundButton = GObject.registerClass({
if ( if (
Gio.content_type_equals(contentType, 'image/jpeg') || Gio.content_type_equals(contentType, 'image/jpeg') ||
Gio.content_type_equals(contentType, 'image/png') || Gio.content_type_equals(contentType, 'image/png') ||
Gio.content_type_equals(contentType, 'image/svg+xml') ||
Gio.content_type_equals(contentType, 'image/tiff') Gio.content_type_equals(contentType, 'image/tiff')
) { ) {
path = file.get_path(); path = file.get_path();