Limit bottom fullscreen controls panel width

Fullscreen bottom controls panel does not look good when progress bar is too long (especially on "ultrawide" displays), so limit its max width to 1720 application-pixels. This should make it still long enough for convenient chapter seeking.
This commit is contained in:
Rafał Dzięgiel
2021-02-24 10:11:12 +01:00
parent bfdc85e3e3
commit dbd3e536b2
2 changed files with 17 additions and 0 deletions

View File

@@ -228,6 +228,19 @@ class ClapperRevealerBottom extends CustomRevealer
this.revealerBox.remove(widget); this.revealerBox.remove(widget);
} }
setLayoutMargins(layoutWidth)
{
const maxWidth = 1720;
if(layoutWidth <= maxWidth)
return;
const margin = (layoutWidth - maxWidth) / 2;
this.margin_start = margin;
this.margin_end = margin;
}
_onMotion(controller, x, y) _onMotion(controller, x, y)
{ {
const clapperWidget = this.root.child; const clapperWidget = this.root.child;

View File

@@ -563,6 +563,10 @@ class ClapperWidget extends Gtk.Grid
return; return;
this.layoutWidth = width; this.layoutWidth = width;
if(this.isFullscreenMode)
this.revealerBottom.setLayoutMargins(width);
this.controls._onPlayerResize(width, height); this.controls._onPlayerResize(width, height);
} }