mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
Add missing PiP icons from web devel kit. Also add play/pause icons at the right size and remove all workarounds/scaling implemented or these two. Playback icons are always two bars for pause and triangle for play, so hopefully this will not be problematic, as this guaranties the right size for them that Adwaita unfortunately cannot provide.
56 lines
1.2 KiB
JavaScript
56 lines
1.2 KiB
JavaScript
const { Gio, GObject, Gdk, Gtk } = imports.gi;
|
|
const { AppBase } = imports.src.appBase;
|
|
const { Widget } = imports.src.widget;
|
|
const Debug = imports.src.debug;
|
|
|
|
const { debug } = Debug;
|
|
|
|
var App = GObject.registerClass({
|
|
GTypeName: 'ClapperApp',
|
|
},
|
|
class ClapperApp extends AppBase
|
|
{
|
|
_init()
|
|
{
|
|
super._init();
|
|
|
|
this.flags |= Gio.ApplicationFlags.HANDLES_OPEN;
|
|
}
|
|
|
|
vfunc_startup()
|
|
{
|
|
super.vfunc_startup();
|
|
|
|
const window = this.active_window;
|
|
const clapperWidget = new Widget();
|
|
const dummyHeaderbar = new Gtk.Box({
|
|
can_focus: false,
|
|
focusable: false,
|
|
visible: false,
|
|
});
|
|
|
|
window.add_css_class('nobackground');
|
|
window.set_child(clapperWidget);
|
|
window.set_titlebar(dummyHeaderbar);
|
|
|
|
this.mapSignal = window.connect('map', this._onWindowMap.bind(this));
|
|
}
|
|
|
|
vfunc_open(files, hint)
|
|
{
|
|
super.vfunc_open(files, hint);
|
|
|
|
this._openFilesAsync(files).then(() => this.activate()).catch(debug);
|
|
}
|
|
|
|
_onWindowMap(window)
|
|
{
|
|
window.disconnect(this.mapSignal);
|
|
this.mapSignal = null;
|
|
|
|
debug('window mapped');
|
|
|
|
window.child._onWindowMap(window);
|
|
}
|
|
});
|