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

@@ -16,25 +16,15 @@ var Widget = GObject.registerClass({
}
}, class ClapperWidget extends Gtk.Grid
{
_init(opts)
_init()
{
Debug.gstVersionCheck();
super._init();
let clapperPath = Misc.getClapperPath();
let defaults = {
cssPath: `${clapperPath}/css/styles.css`,
};
Object.assign(this, defaults, opts);
let cssProvider = new Gtk.CssProvider();
cssProvider.load_from_path(this.cssPath);
Gtk.StyleContext.add_provider_for_display(
Gdk.Display.get_default(),
cssProvider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
);
/* load CSS here to allow using this class
* separately as a pre-made GTK widget */
Misc.loadCustomCss();
this.windowSize = JSON.parse(settings.get_string('window-size'));
this.floatSize = JSON.parse(settings.get_string('float-size'));