fix(ags): fix box undefined error on player
This commit is contained in:
parent
2ad9d8bfdb
commit
90b34ca9ef
1 changed files with 12 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
||||||
const { CACHE_DIR, execAsync, ensureDirectory, lookUpIcon } = ags.Utils;
|
const { execAsync, lookUpIcon } = ags.Utils;
|
||||||
const { Button, Icon, Label, Box, Stack, Slider, CenterBox } = ags.Widget;
|
const { Button, Icon, Label, Stack, Slider, CenterBox } = ags.Widget;
|
||||||
const { GLib, Gtk, Gdk } = imports.gi;
|
const { Gdk } = imports.gi;
|
||||||
const display = Gdk.Display.get_default();
|
const display = Gdk.Display.get_default();
|
||||||
|
|
||||||
import { EventBox } from '../misc/cursorbox.js';
|
import { EventBox } from '../misc/cursorbox.js';
|
||||||
|
@ -33,14 +33,16 @@ export const CoverArt = (player, params) => CenterBox({
|
||||||
[player, box => {
|
[player, box => {
|
||||||
execAsync(['bash', '-c', `[[ -f "${player.coverPath}" ]] && coloryou "${player.coverPath}"`])
|
execAsync(['bash', '-c', `[[ -f "${player.coverPath}" ]] && coloryou "${player.coverPath}"`])
|
||||||
.then(out => {
|
.then(out => {
|
||||||
player.colors.value = JSON.parse(out);
|
if (box) {
|
||||||
|
player.colors.value = JSON.parse(out);
|
||||||
|
|
||||||
box.setStyle(`background: radial-gradient(circle,
|
box.setStyle(`background: radial-gradient(circle,
|
||||||
rgba(0, 0, 0, 0.4) 30%,
|
rgba(0, 0, 0, 0.4) 30%,
|
||||||
${player.colors.value.imageAccent}),
|
${player.colors.value.imageAccent}),
|
||||||
url("${player.coverPath}");
|
url("${player.coverPath}");
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;`);
|
background-position: center;`);
|
||||||
|
}
|
||||||
}).catch(err => { if (err !== "") print(err) });
|
}).catch(err => { if (err !== "") print(err) });
|
||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue