Fix custom CSS loading for remote app

This commit is contained in:
Rafostar
2020-12-15 23:26:24 +01:00
parent 234451f62a
commit b6c947efa6
3 changed files with 21 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
const { Gio, GstAudio, GstPlayer, Gtk } = imports.gi;
const { Gio, GstAudio, GstPlayer, Gdk, Gtk } = imports.gi;
const Debug = imports.clapper_src.debug;
var appName = 'Clapper';
@@ -34,6 +34,19 @@ function getClapperVersion()
: '';
}
function loadCustomCss()
{
const clapperPath = getClapperPath();
const cssProvider = new Gtk.CssProvider();
cssProvider.load_from_path(`${clapperPath}/css/styles.css`);
Gtk.StyleContext.add_provider_for_display(
Gdk.Display.get_default(),
cssProvider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
);
}
function inhibitForState(state, window)
{
let isInhibited = false;