mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Append "PiP" suffix to window title when in floating mode
We are gonna take advantage of this simple change elsewhere
This commit is contained in:
@@ -325,15 +325,17 @@ class ClapperControlsRevealer extends Gtk.Revealer
|
|||||||
|
|
||||||
_onControlsRevealed()
|
_onControlsRevealed()
|
||||||
{
|
{
|
||||||
if(this.child_revealed) {
|
const clapperWidget = this.root.child;
|
||||||
const clapperWidget = this.root.child;
|
if(!clapperWidget) return;
|
||||||
if(!clapperWidget) return;
|
|
||||||
|
|
||||||
|
if(this.child_revealed) {
|
||||||
const [width, height] = this.root.get_default_size();
|
const [width, height] = this.root.get_default_size();
|
||||||
|
|
||||||
clapperWidget.player.widget.height_request = -1;
|
clapperWidget.player.widget.height_request = -1;
|
||||||
this.root.set_default_size(width, height);
|
this.root.set_default_size(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clapperWidget.refreshWindowTitle(this.root.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onUnrevealTick(playerWidget, width, height)
|
_onUnrevealTick(playerWidget, width, height)
|
||||||
|
@@ -319,11 +319,24 @@ class ClapperWidget extends Gtk.Grid
|
|||||||
title = item.filename;
|
title = item.filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.root.title = title;
|
this.refreshWindowTitle(title);
|
||||||
this.revealerTop.title = title;
|
this.revealerTop.title = title;
|
||||||
this.revealerTop.showTitle = true;
|
this.revealerTop.showTitle = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshWindowTitle(title)
|
||||||
|
{
|
||||||
|
const isFloating = !this.controlsRevealer.child_revealed;
|
||||||
|
const pipSuffix = ' - PiP';
|
||||||
|
const hasPipSuffix = title.endsWith(pipSuffix);
|
||||||
|
|
||||||
|
this.root.title = (isFloating && !hasPipSuffix)
|
||||||
|
? title + pipSuffix
|
||||||
|
: (!isFloating && hasPipSuffix)
|
||||||
|
? title.substring(0, title.length - pipSuffix.length)
|
||||||
|
: title;
|
||||||
|
}
|
||||||
|
|
||||||
updateTime()
|
updateTime()
|
||||||
{
|
{
|
||||||
if(
|
if(
|
||||||
|
Reference in New Issue
Block a user