mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-16 18:06:55 +00:00
4.0.0-rc12.2
* Fixed: Take a few more variables into account when sizing the player for Portrait Mode. * Changed: Fade in the Host button, not responding to user interaction while it's fading to give users a chance to react to the UI change.
This commit is contained in:
parent
7e4223ccdd
commit
d091a35079
11 changed files with 134 additions and 32 deletions
|
@ -92,16 +92,44 @@ export default class CSSTweaks extends Module {
|
|||
changed: val => this.toggle('portrait', val)
|
||||
});
|
||||
|
||||
this.settings.add('layout.sidenav-width', {
|
||||
require: ['context.ui.theatreModeEnabled', 'context.ui.sideNavExpanded'],
|
||||
this.settings.add('layout.portrait-extra-height', {
|
||||
requires: ['context.new_channel', 'context.hosting', 'context.ui.theatreModeEnabled', 'player.theatre.no-whispers', 'whispers.show', 'layout.minimal-navigation'],
|
||||
process(ctx) {
|
||||
if ( ctx.get('context.ui.theatreModeEnabled') )
|
||||
return '0';
|
||||
let height = 0;
|
||||
if ( ctx.get('context.ui.theatreModeEnabled') ) {
|
||||
if ( ctx.get('layout.minimal-navigation') )
|
||||
height += 1;
|
||||
|
||||
if ( ctx.get('whispers.show') && ! ctx.get('player.theatre.no-whispers') )
|
||||
height += 4;
|
||||
|
||||
} else {
|
||||
height = ctx.get('layout.minimal-navigation') ? 1 : 5;
|
||||
if ( ctx.get('whispers.show') )
|
||||
height += 4;
|
||||
|
||||
height += ctx.get('context.new_channel') ? 1 : 5;
|
||||
|
||||
if ( ctx.get('context.hosting') )
|
||||
height += 4;
|
||||
}
|
||||
|
||||
return `${height}rem`;
|
||||
},
|
||||
|
||||
changed: val => this.setVariable('portrait-extra-height', val)
|
||||
})
|
||||
|
||||
this.settings.add('layout.portrait-extra-width', {
|
||||
require: ['layout.side-nav.show', 'context.ui.theatreModeEnabled', 'context.ui.sideNavExpanded'],
|
||||
process(ctx) {
|
||||
if ( ! ctx.get('layout.side-nav.show') || ctx.get('context.ui.theatreModeEnabled') )
|
||||
return '0px';
|
||||
|
||||
return ctx.get('context.ui.sideNavExpanded') ? '24rem' : '5rem'
|
||||
},
|
||||
|
||||
changed: val => this.setVariable('sidenav-width', val)
|
||||
changed: val => this.setVariable('portrait-extra-width', val)
|
||||
});
|
||||
|
||||
|
||||
|
@ -273,7 +301,8 @@ export default class CSSTweaks extends Module {
|
|||
|
||||
this.toggleHide('whispers', !this.settings.get('whispers.show'));
|
||||
|
||||
this.setVariable('sidenav-width', this.settings.get('layout.sidenav-width'))
|
||||
this.setVariable('portrait-extra-width', this.settings.get('layout.portrait-extra-width'))
|
||||
this.setVariable('portrait-extra-height', this.settings.get('layout.portrait-extra-height'))
|
||||
}
|
||||
|
||||
toggleHide(key, val) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue