1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-05 02:28:31 +00:00

4.0.0-rc12.1

* Added: Portrait Mode Threshold setting for customizing at precisely which point Portrait Mode kicks in.
* Fixed: Do not automatically hide chat because of a narrow window when Portrait Mode is enabled.
This commit is contained in:
SirStendec 2018-08-03 16:33:58 -04:00
parent 81ebb14937
commit 7e4223ccdd
3 changed files with 25 additions and 3 deletions

View file

@ -100,7 +100,7 @@ class FrankerFaceZ extends Module {
FrankerFaceZ.Logger = Logger; FrankerFaceZ.Logger = Logger;
const VER = FrankerFaceZ.version_info = { const VER = FrankerFaceZ.version_info = {
major: 4, minor: 0, revision: 0, extra: '-rc12', major: 4, minor: 0, revision: 0, extra: '-rc12.1',
commit: __git_commit__, commit: __git_commit__,
build: __webpack_hash__, build: __webpack_hash__,
toString: () => toString: () =>

View file

@ -62,11 +62,32 @@ export default class CSSTweaks extends Module {
} }
}); });
this.settings.add('layout.portrait-threshold', {
default: 1.25,
ui: {
path: 'Appearance > Layout >> Channel',
title: 'Portrait Mode Threshold',
description: 'This is the Width to Height ratio at which point Portrait Mode will begin to activate.',
component: 'setting-text-box',
process(val) {
val = parseFloat(val, 10)
if ( isNaN(val) || ! isFinite(val) || val <= 0 )
return 1.25;
return val;
}
}
})
this.settings.add('layout.use-portrait', { this.settings.add('layout.use-portrait', {
requires: ['layout.portrait', 'context.ui.rightColumnExpanded', 'context.route.name', 'context.size'], requires: ['layout.portrait', 'layout.portrait-threshold', 'context.ui.rightColumnExpanded', 'context.route.name', 'context.size'],
process(ctx) { process(ctx) {
const size = ctx.get('context.size'); const size = ctx.get('context.size');
return ctx.get('layout.portrait') && ctx.get('context.ui.rightColumnExpanded') && PORTRAIT_ROUTES.includes(ctx.get('context.route.name')) && (size && size.height > size.width) if ( ! size || ! ctx.get('layout.portrait') || ! ctx.get('context.ui.rightColumnExpanded') || ! PORTRAIT_ROUTES.includes(ctx.get('context.route.name')) )
return false;
const ratio = size.width / size.height;
return ratio <= ctx.get('layout.portrait-threshold');
}, },
changed: val => this.toggle('portrait', val) changed: val => this.toggle('portrait', val)
}); });

View file

@ -26,6 +26,7 @@
} }
.right-column { .right-column {
display: unset !important;
position: fixed !important; position: fixed !important;
z-index: 10000; z-index: 10000;
bottom: 0; bottom: 0;