Add ability to set dynamic wallaper as background image

This commit is contained in:
Luna N
2020-12-06 19:17:17 +01:00
committed by Romain Vigier
parent ca3f9ec5c3
commit c9b6e4a65c
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -62,7 +62,7 @@ var BackgroundsPreferences = class {
settings.backgrounds.connect('day-changed', () => updateDayChooserUri());
dayChooser.connect('update-preview', () => {
const file = dayChooser.get_preview_filename();
const allowedContentTypes = ['image/jpeg', 'image/png', 'image/tiff'];
const allowedContentTypes = ['image/jpeg', 'image/png', 'image/tiff', 'application/xml'];
if (allowedContentTypes.includes(Gio.content_type_guess(file, null)[0])) {
const pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(file, 256, 256);
dayBackgroundPreview.set_from_pixbuf(pixbuf);
@@ -91,7 +91,7 @@ var BackgroundsPreferences = class {
settings.backgrounds.connect('night-changed', () => updateNightChooserUri());
nightChooser.connect('update-preview', () => {
const file = nightChooser.get_preview_filename();
const allowedContentTypes = ['image/jpeg', 'image/png', 'image/tiff'];
const allowedContentTypes = ['image/jpeg', 'image/png', 'image/tiff', 'application/xml'];
if (allowedContentTypes.includes(Gio.content_type_guess(file, null)[0])) {
const pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(file, 256, 256);
nightBackgroundPreview.set_from_pixbuf(pixbuf);
+1
View File
@@ -39,6 +39,7 @@ Author: Romain Vigier
<mime-type>image/jpeg</mime-type>
<mime-type>image/png</mime-type>
<mime-type>image/tiff</mime-type>
<mime-type>application/xml</mime-type>
</mime-types>
</object>
<object class="GtkImage" id="night_background_preview">