Skip to content

Commit 5d7c03a

Browse files
committed
fix gallery
1 parent e5bf209 commit 5d7c03a

File tree

2 files changed

+21
-124
lines changed

2 files changed

+21
-124
lines changed

prefs.js

Lines changed: 7 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const BingImageURL = Utils.BingImageURL;
2121

2222
var DESKTOP_SCHEMA = 'org.gnome.desktop.background';
2323

24-
var PREFS_DEFAULT_WIDTH = 700;
24+
var PREFS_DEFAULT_WIDTH = 750;
2525
var PREFS_DEFAULT_HEIGHT = 750;
2626

2727
export default class BingWallpaperExtensionPreferences extends ExtensionPreferences {
@@ -113,50 +113,8 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
113113
const folderDialog = buildable.get_object('folderDialog');
114114
const lockscreen_page = buildable.get_object('lockscreen_page');
115115

116-
/*const lockscreen_page = new Adw.PreferencesPage({
117-
title: _('Lock screen'),
118-
icon_name: 'applications-system-symbolic',
119-
});*/
120116
window.add(lockscreen_page);
121117
const ls_group = buildable.get_object('ls_group');
122-
/*
123-
const ls_group = new Adw.PreferencesGroup({
124-
title: _('Lockscreen blur'),
125-
});
126-
*/
127-
/*
128-
lockscreen_page.add(ls_group);
129-
const overrideSwitch = new Adw.SwitchRow({
130-
title: _('Dynamic lockscreen blur'),
131-
subtitle: _('Whether to enable dynamic blur mode on lock screen'),
132-
});
133-
const strengthEntry = new Adw.SpinRow({
134-
title: _('Blur strength'),
135-
subtitle: _('Blur strength when login prompt is not visible'),
136-
adjustment: new Gtk.Adjustment({
137-
lower: 0,
138-
upper: 50,
139-
value: settings.get_int('lockscreen-blur-strength'),
140-
page_increment: 10,
141-
step_increment: 1,
142-
}),
143-
});
144-
const brightnessEntry = new Adw.SpinRow({
145-
title: _('Wallpaper brightness'),
146-
subtitle: _('Dim wallpaper when login prompt is not visible'),
147-
adjustment: new Gtk.Adjustment({
148-
lower: 0,
149-
upper: 50,
150-
value: settings.get_int('lockscreen-blur-brightness'),
151-
page_increment: 10,
152-
step_increment: 1,
153-
}),
154-
});
155-
*/
156-
/*const blurPresets = new Adw.ActionRow({
157-
title: _('Presets'),
158-
});*/
159-
160118
const overrideSwitch = buildable.get_object('overrideSwitch');
161119
const blurPresets = buildable.get_object('blurPresets');
162120
const strengthEntry = buildable.get_object('strengthEntry');
@@ -204,8 +162,11 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
204162
const gallery_page = buildable.get_object('gallery_page');
205163
window.add(gallery_page);
206164

165+
const carouselViewPort = buildable.get_object('carouselViewPort');
207166
const carouselFlowBox = buildable.get_object('carouselFlowBox');
208167

168+
//carouselViewPort.set_size(500,500);
169+
209170
const debug_page = buildable.get_object('debug_page');
210171
window.add(debug_page);
211172

@@ -243,57 +204,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
243204
version_button.set_label(this.metadata.version.toString());
244205

245206
const change_log = buildable.get_object('change_log');
246-
247-
248-
/*
249-
// Prepare labels and controls
250-
let buildable = new Gtk.Builder();
251-
// GTK4 removes some properties, and builder breaks when it sees them
252-
buildable.add_from_file( this.dir.get_path() + '/ui/Settings4.ui' );
253-
*/
254-
255-
256-
/*
257-
let box = buildable.get_object('prefs_widget');
258-
259-
// fix size of prefs window in GNOME shell 40+ (but super racy, so is unreliable)
260-
261-
buildable.get_object('extension_version').set_text(this.metadata.version.toString());
262-
buildable.get_object('extension_name').set_text(this.metadata.name.toString());
263-
264-
// assign variables to UI objects we've loaded
265-
let hideSwitch = buildable.get_object('hide');
266-
let iconEntry = buildable.get_object('icon');
267-
let notifySwitch = buildable.get_object('notify');
268-
let bgSwitch = buildable.get_object('background');
269-
let styleEntry = buildable.get_object('background_style');
270-
let fileChooserBtn = buildable.get_object('download_folder');
271-
let fileChooser = buildable.get_object('file_chooser'); // this should only exist on Gtk4
272-
let folderOpenBtn = buildable.get_object('button_open_download_folder');
273-
let marketEntry = buildable.get_object('market');
274-
let resolutionEntry = buildable.get_object('resolution');
275-
let historyEntry = buildable.get_object('history');
276-
icon_image = buildable.get_object('icon_image');
277-
let overrideSwitch = buildable.get_object('lockscreen_override');
278-
let strengthEntry = buildable.get_object('entry_strength');
279-
let brightnessEntry = buildable.get_object('entry_brightness');*/
280-
281-
282-
/*
283-
let unsafeSwitch = buildable.get_object('unsafe_switch');
284-
let randomIntervalEntry = buildable.get_object('entry_random_interval');
285-
let change_log = buildable.get_object('change_log');
286-
let buttonGDMdefault = buildable.get_object('button_default_gnome');
287-
let buttonnoblur = buildable.get_object('button_no_blur');
288-
let buttonslightblur = buildable.get_object('button_slight_blur');
289-
let buttonImportData = buildable.get_object('button_json_import');
290-
let buttonExportData = buildable.get_object('button_json_export');
291-
let switchAlwaysExport = buildable.get_object('always_export_switch');
292-
let switchEnableShuffle = buildable.get_object('shuffle_enabled_switch');
293-
let entryShuffleMode = buildable.get_object('shuffle_mode_combo');
294-
let carouselFlowBox = (Gtk.get_major_version() == 4) ? buildable.get_object('carouselFlowBox'): null;
295-
*/
296-
207+
297208
try {
298209
httpSession = new Soup.Session();
299210
httpSession.user_agent = 'User-Agent: Mozilla/5.0 (X11; GNOME Shell/' + Config.PACKAGE_VERSION + '; Linux x86_64; +https://github.com/neffo/bing-wallpaper-gnome-extension ) BingWallpaper Gnome Extension/' + this.metadata.version;
@@ -312,24 +223,11 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
312223
// Indicator & notifications
313224
settings.bind('hide', hideSwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
314225
settings.bind('notify', notifySwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
315-
/*
316-
// add markets to dropdown list (aka a GtkComboText)
317-
Utils.icon_list.forEach((iconname, index) => {
318-
iconEntry.append(iconname, iconname);
319-
});
320-
*/
321-
// user selectable indicator icons
322-
// settings.bind('icon-name', iconEntry, 'active_id', Gio.SettingsBindFlags.DEFAULT);
323226
settings.connect('changed::icon-name', () => {
324227
Utils.validate_icon(settings, this.path, icon_image);
325228
/*iconEntry.set_selected(Utils.indexOf(settings.get_string('icon-name')));*/
326229
});
327-
328-
/*
329-
iconEntry.connect('changed', (widget) => {
330-
settings.set_string('icon-name', Utils.icon_list[iconEntry.active_id]);
331-
});*/
332-
230+
333231
//iconEntry.set_active_id(settings.get_string('icon-name'));
334232

335233
// connect switches to settings changes
@@ -348,7 +246,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
348246

349247
// we populate the tab (gtk4+, gnome 40+), this was previously a button to open a new window in gtk3
350248
// disabled at the moment, needs testing
351-
//carousel = new Carousel(settings, null, null, carouselFlowBox, this.dir.get_path()); // auto load carousel
249+
carousel = new Carousel(settings, null, null, carouselFlowBox, this.dir.get_path()); // auto load carousel
352250

353251
// this is intended for migrating image folders between computers (or even sharing) or backups
354252
// we export the Bing JSON data to the image directory, so this folder becomes portable
@@ -420,10 +318,5 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
420318

421319
if (httpSession)
422320
Utils.fetch_change_log(this.metadata.version.toString(), change_log, httpSession);
423-
424-
/*group.add(box);
425-
page.add(group);
426-
427-
window.add(page);*/
428321
}
429322
}

ui/prefsadw.ui

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,25 @@ Bing Wallpaper GNOME extension by: Michael Carroll
140140
<property name="icon-name">document-open-recent-symbolic</property>
141141
<property name="title" translatable="yes">Gallery</property>
142142
<child>
143-
<object class="GtkViewport" id="carouselViewPort">
143+
<object class="GtkScrolledWindow" id="carouselViewPort">
144144
<property name="can-focus">0</property>
145145
<property name="height_request">500</property>
146146
<property name="hexpand">0</property>
147147
<property name="vexpand">0</property>
148148
<property name="child">
149-
<object class="GtkFlowBox" id="carouselFlowBox">
150-
<property name="can-focus">0</property>
151-
<property name="halign">center</property>
152-
<property name="homogeneous">1</property>
153-
<property name="max-children-per-line">2</property>
154-
<property name="min-children-per-line">2</property>
155-
<property name="row-spacing">2</property>
156-
<property name="column-spacing">2</property>
157-
</object>
149+
<object class="GtkBox">
150+
<child>
151+
<object class="GtkFlowBox" id="carouselFlowBox">
152+
<property name="can-focus">0</property>
153+
<property name="halign">center</property>
154+
<property name="homogeneous">1</property>
155+
<property name="max-children-per-line">2</property>
156+
<property name="min-children-per-line">2</property>
157+
<property name="row-spacing">2</property>
158+
<property name="column-spacing">2</property>
159+
</object>
160+
</child>
161+
</object>
158162
</property>
159163
</object>
160164
</child>

0 commit comments

Comments
 (0)