-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #219 from neffo/version-47
Version 47
- Loading branch information
Showing
10 changed files
with
11 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,20 +8,18 @@ | |
// Based on GNOME shell extension NASA APOD by Elia Argentieri https://github.com/Elinvention/gnome-shell-extension-nasa-apod | ||
|
||
import Gtk from 'gi://Gtk'; | ||
import Gdk from 'gi://Gdk'; | ||
import GdkPixbuf from 'gi://GdkPixbuf'; | ||
import Gio from 'gi://Gio'; | ||
import GLib from 'gi://GLib'; | ||
import * as Utils from './utils.js'; | ||
import {ExtensionPreferences, gettext as _} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'; | ||
import {gettext as _} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'; | ||
|
||
const default_dimensions = [30, 30, 1650, 800]; // TODO: pull from and save dimensions to settings, but perhaps verify that dimensions are ok | ||
|
||
const GALLERY_THUMB_WIDTH = 320; | ||
const GALLERY_THUMB_HEIGHT = 180; | ||
|
||
export default class Carousel { | ||
constructor(settings, button = null, callbackfunc = null, prefs_flowbox = null) { | ||
constructor(settings, button = null, callbackfunc = null, prefs_flowbox = null, extensionPath = null) { | ||
//create_gallery(widget, settings); | ||
this.settings = settings; | ||
this.button = button; | ||
|
@@ -30,27 +28,12 @@ export default class Carousel { | |
this.window = null; | ||
this.imageList = Utils.imageListSortByDate(Utils.getImageList(this.settings)).reverse(); // get images and reverse order | ||
this.searchEntry = null; | ||
this.extensionPath = ExtensionPreferences.lookupByUUID('[email protected]').path | ||
this.extensionPath = extensionPath | ||
|
||
this.log('create carousel...'); | ||
|
||
if (!prefs_flowbox) { | ||
[this.window, this.flowBox] = this._create_gallery_window(_('Bing Wallpaper Gallery'), default_dimensions); | ||
if (Gtk.get_major_version() < 4) | ||
this.window.show_all(); | ||
else | ||
this.window.show(); | ||
//this.window.connect('destroy', this._enable_button); | ||
} | ||
else { | ||
this.flowBox = prefs_flowbox; | ||
} | ||
if (Gtk.get_major_version() < 4) { | ||
this._create_gallery(); | ||
} | ||
else { | ||
this.flowBox.insert(this._create_placeholder_item(), -1); | ||
} | ||
this.flowBox = prefs_flowbox; | ||
this.flowBox.insert(this._create_placeholder_item(), -1); | ||
} | ||
|
||
_enable_button() { | ||
|
@@ -59,20 +42,6 @@ export default class Carousel { | |
} | ||
} | ||
|
||
_create_gallery_window(title, dimensions) { | ||
let buildable = new Gtk.Builder(); | ||
let win = new Gtk.Window(); | ||
let flowBox; | ||
|
||
win.set_default_size(dimensions[2], dimensions[3]); | ||
win.set_title(title); | ||
|
||
buildable.add_objects_from_file(this.extensionPath + '/ui/carousel4.ui', ['carouselViewPort']); | ||
flowBox = buildable.get_object('carouselFlowBox'); | ||
win.set_child(buildable.get_object('carouselScrollable')); | ||
return [win, flowBox]; | ||
} | ||
|
||
_create_gallery() { | ||
Utils.randomIntervals.forEach((x) => { | ||
let item = this._create_random_item(x.value, _(x.title)); | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters