mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
Port most of the player to GTK4. Some things are still broken or disabled due to GTK change, but will be gradually fixed.
49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
const { Gdk, GObject, Gtk } = imports.gi;
|
|
|
|
var Window = GObject.registerClass({
|
|
Signals: {
|
|
'fullscreen-changed': {
|
|
param_types: [GObject.TYPE_BOOLEAN]
|
|
},
|
|
}
|
|
}, class ClapperWindow extends Gtk.ApplicationWindow
|
|
{
|
|
_init(application, title)
|
|
{
|
|
super._init({
|
|
application: application,
|
|
title: title || 'Clapper',
|
|
//border_width: 0,
|
|
resizable: true,
|
|
//window_position: Gtk.WindowPosition.CENTER,
|
|
width_request: 960,
|
|
height_request: 642,
|
|
destroy_with_parent: true,
|
|
});
|
|
this.isFullscreen = false;
|
|
}
|
|
|
|
toggleFullscreen()
|
|
{
|
|
let un = (this.isFullscreen) ? 'un' : '';
|
|
this[`${un}fullscreen`]();
|
|
}
|
|
/*
|
|
vfunc_window_state_event(event)
|
|
{
|
|
super.vfunc_window_state_event(event);
|
|
|
|
let isFullscreen = Boolean(
|
|
event.new_window_state
|
|
& Gdk.WindowState.FULLSCREEN
|
|
);
|
|
|
|
if(this.isFullscreen === isFullscreen)
|
|
return;
|
|
|
|
this.isFullscreen = isFullscreen;
|
|
this.emit('fullscreen-changed', this.isFullscreen);
|
|
}
|
|
*/
|
|
});
|