mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Major code cleanup
This commit is contained in:
@@ -103,17 +103,13 @@ class ClapperPopoverButton extends IconButton
|
||||
orientation: Gtk.Orientation.VERTICAL,
|
||||
});
|
||||
|
||||
this.popover.set_parent(this);
|
||||
this.popover.set_child(this.popoverBox);
|
||||
this.popover.set_offset(0, -this.margin_top);
|
||||
|
||||
if(this.isFullscreen)
|
||||
this.popover.add_css_class('osd');
|
||||
|
||||
this.changeStateSignal = this.popover.connect('closed', () =>
|
||||
this.unset_state_flags(Gtk.StateFlags.CHECKED)
|
||||
);
|
||||
this.destroySignal = this.connect('destroy', this._onDestroy.bind(this));
|
||||
this.popover.connect('closed', this._onClosed.bind(this));
|
||||
}
|
||||
|
||||
setFullscreenMode(isFullscreen)
|
||||
@@ -136,16 +132,19 @@ class ClapperPopoverButton extends IconButton
|
||||
vfunc_clicked()
|
||||
{
|
||||
this.set_state_flags(Gtk.StateFlags.CHECKED, false);
|
||||
|
||||
this.popover.set_parent(this);
|
||||
this.popover.popup();
|
||||
}
|
||||
|
||||
_onDestroy()
|
||||
_onClosed()
|
||||
{
|
||||
this.disconnect(this.destroySignal);
|
||||
let root = this.get_root();
|
||||
let clapperWidget = root.get_child();
|
||||
|
||||
clapperWidget.player.widget.grab_focus();
|
||||
|
||||
this.popover.disconnect(this.changeStateSignal);
|
||||
this.popover.unparent();
|
||||
this.popoverBox.emit('destroy');
|
||||
this.popover.emit('destroy');
|
||||
this.unset_state_flags(Gtk.StateFlags.CHECKED);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user