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-type>image/jpeg</mime-type>
<mime-type>image/png</mime-type>
<mime-type>image/svg+xml</mime-type>
<mime-type>image/tiff</mime-type>
<mime-type>application/xml</mime-type>
</mime-types>
+10 -10
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 12:01+0200\n"
"POT-Creation-Date: 2022-04-26 22:37+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"
@@ -425,36 +425,36 @@ msgstr ""
msgid ":"
msgstr ""
#: src/modules/TimerOndemand.js:212
#: src/modules/TimerOndemand.js:213
msgid "Turn Night Mode Off"
msgstr ""
#: src/modules/TimerOndemand.js:212
#: src/modules/TimerOndemand.js:213
msgid "Turn Night Mode On"
msgstr ""
#: src/modules/TimerOndemand.js:227
#: src/modules/TimerOndemand.js:228
msgid "Extension Settings"
msgstr ""
#: src/modules/TimerOndemand.js:235
#: src/modules/TimerOndemand.js:237
msgid "Night Mode Off"
msgstr ""
#: src/modules/TimerOndemand.js:235
#: src/modules/TimerOndemand.js:237
msgid "Night Mode On"
msgstr ""
#: src/modules/TimerOndemand.js:236
#: src/modules/TimerOndemand.js:238
msgid "Turn Off"
msgstr ""
#: src/modules/TimerOndemand.js:236
#: src/modules/TimerOndemand.js:238
msgid "Turn On"
msgstr ""
#: src/preferences/BackgroundButton.js:71
msgid "Only JPEG, PNG, TIFF and XML files can be set as background image."
#: src/preferences/BackgroundButton.js:74
msgid "Only JPEG, PNG, TIFF, SVG and XML files can be set as background image."
msgstr ""
#: src/preferences/SchedulePage.js:48
+3 -1
View File
@@ -62,6 +62,7 @@ var BackgroundButton = GObject.registerClass({
if (
Gio.content_type_equals(contentType, 'image/jpeg') ||
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, 'application/xml')
) {
@@ -70,7 +71,7 @@ var BackgroundButton = GObject.registerClass({
} else {
if (this.root instanceof Adw.PreferencesWindow) {
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,
}));
}
@@ -109,6 +110,7 @@ var BackgroundButton = GObject.registerClass({
if (
Gio.content_type_equals(contentType, 'image/jpeg') ||
Gio.content_type_equals(contentType, 'image/png') ||
Gio.content_type_equals(contentType, 'image/svg+xml') ||
Gio.content_type_equals(contentType, 'image/tiff')
) {
path = file.get_path();