mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-16 10:06:54 +00:00
Merge cf97620c7f
into 64f7a513a8
This commit is contained in:
commit
b7ecda0b55
4 changed files with 15 additions and 11 deletions
|
@ -9,6 +9,7 @@ import dayjs from 'dayjs';
|
|||
import Module from 'utilities/module';
|
||||
import {createElement, ManagedStyle} from 'utilities/dom';
|
||||
import {timeout, has, glob_to_regex, escape_regex, split_chars} from 'utilities/object';
|
||||
import {CHAT_FONT_SIZE} from 'utilities/constants';
|
||||
|
||||
import Badges from './badges';
|
||||
import Emotes from './emotes';
|
||||
|
@ -100,7 +101,7 @@ export default class Chat extends Module {
|
|||
});
|
||||
|
||||
this.settings.add('chat.font-size', {
|
||||
default: 12,
|
||||
default: CHAT_FONT_SIZE,
|
||||
ui: {
|
||||
path: 'Chat > Appearance >> General',
|
||||
title: 'Font Size',
|
||||
|
@ -109,7 +110,7 @@ export default class Chat extends Module {
|
|||
process(val) {
|
||||
val = parseInt(val, 10);
|
||||
if ( isNaN(val) || ! isFinite(val) || val <= 0 )
|
||||
return 12;
|
||||
return null;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
@ -1696,4 +1697,4 @@ export default class Chat extends Module {
|
|||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
import {get} from 'utilities/object';
|
||||
import {ColorAdjuster} from 'utilities/color';
|
||||
|
||||
import {CHAT_FONT_SIZE} from 'utilities/constants';
|
||||
import Module from 'utilities/module';
|
||||
|
||||
import Line from './line';
|
||||
|
@ -66,7 +67,7 @@ export default class Chat extends Module {
|
|||
updateChatCSS() {
|
||||
const size = this.chat.context.get('chat.font-size'),
|
||||
emote_alignment = this.chat.context.get('chat.lines.emote-alignment'),
|
||||
lh = Math.round((20/12) * size);
|
||||
lh = Math.round((20/CHAT_FONT_SIZE) * size);
|
||||
|
||||
let font = this.chat.context.get('chat.font-family') || 'inherit';
|
||||
if ( font.indexOf(' ') !== -1 && font.indexOf(',') === -1 && font.indexOf('"') === -1 && font.indexOf("'") === -1 )
|
||||
|
@ -76,7 +77,7 @@ export default class Chat extends Module {
|
|||
this.css_tweaks.setVariable('chat-line-height', `${lh/10}rem`);
|
||||
this.css_tweaks.setVariable('chat-font-family', font);
|
||||
|
||||
this.css_tweaks.toggle('chat-font', size !== 12 || font);
|
||||
this.css_tweaks.toggle('chat-font', size !== CHAT_FONT_SIZE || font);
|
||||
|
||||
this.css_tweaks.toggle('emote-alignment-padded', emote_alignment === 1);
|
||||
this.css_tweaks.toggle('emote-alignment-baseline', emote_alignment === 2);
|
||||
|
@ -188,4 +189,4 @@ export default class Chat extends Module {
|
|||
|
||||
room.updateBadges(badges);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import {ColorAdjuster} from 'utilities/color';
|
||||
import {get, has, make_enum, shallow_object_equals, set_equals, deep_equals} from 'utilities/object';
|
||||
import {WEBKIT_CSS as WEBKIT} from 'utilities/constants';
|
||||
import {WEBKIT_CSS as WEBKIT, CHAT_FONT_SIZE} from 'utilities/constants';
|
||||
import {FFZEvent} from 'utilities/events';
|
||||
|
||||
import Module from 'utilities/module';
|
||||
|
@ -619,7 +619,7 @@ export default class ChatHook extends Module {
|
|||
const width = this.chat.context.get('chat.width'),
|
||||
size = this.chat.context.get('chat.font-size'),
|
||||
emote_alignment = this.chat.context.get('chat.lines.emote-alignment'),
|
||||
lh = Math.round((20/12) * size);
|
||||
lh = Math.round((20/CHAT_FONT_SIZE) * size);
|
||||
|
||||
let font = this.chat.context.get('chat.font-family') || 'inherit';
|
||||
if ( font.indexOf(' ') !== -1 && font.indexOf(',') === -1 && font.indexOf('"') === -1 && font.indexOf("'") === -1 )
|
||||
|
@ -631,7 +631,7 @@ export default class ChatHook extends Module {
|
|||
this.css_tweaks.setVariable('chat-width', `${width/10}rem`);
|
||||
this.css_tweaks.setVariable('negative-chat-width', `${-width/10}rem`);
|
||||
|
||||
this.css_tweaks.toggle('chat-font', size !== 12 || font !== 'inherit');
|
||||
this.css_tweaks.toggle('chat-font', size !== CHAT_FONT_SIZE || font !== 'inherit');
|
||||
this.css_tweaks.toggle('chat-width', this.settings.get('chat.use-width'));
|
||||
|
||||
this.css_tweaks.toggle('emote-alignment-padded', emote_alignment === 1);
|
||||
|
@ -2598,4 +2598,4 @@ export function formatBitsConfig(config) {
|
|||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,4 +124,6 @@ export const EmoteTypes = make_enum(
|
|||
'BitsTier',
|
||||
'Global',
|
||||
'TwoFactor'
|
||||
);
|
||||
);
|
||||
|
||||
export const CHAT_FONT_SIZE = 13;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue