2020-04-14 16:18:57 +01:00
|
|
|
/*
|
2024-09-09 14:57:16 +01:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2020-04-14 16:18:57 +01:00
|
|
|
Copyright 2020 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
2025-01-06 11:18:54 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
2024-09-09 14:57:16 +01:00
|
|
|
Please see LICENSE files in the repository root for full details.
|
2020-04-14 16:18:57 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import SettingController from "./SettingController";
|
2020-05-20 14:44:56 +01:00
|
|
|
import dis from "../../dispatcher/dispatcher";
|
2025-02-05 13:25:06 +00:00
|
|
|
import { type UpdateSystemFontPayload } from "../../dispatcher/payloads/UpdateSystemFontPayload";
|
2020-06-15 15:33:52 +01:00
|
|
|
import { Action } from "../../dispatcher/actions";
|
2020-04-14 16:18:57 +01:00
|
|
|
|
2020-06-15 15:33:52 +01:00
|
|
|
export default class SystemFontController extends SettingController {
|
2022-12-16 12:29:59 +00:00
|
|
|
public constructor() {
|
2020-04-16 11:56:43 +01:00
|
|
|
super();
|
2020-04-14 16:18:57 +01:00
|
|
|
}
|
|
|
|
|
|
2023-11-23 13:04:05 +00:00
|
|
|
public onChange(): void {
|
2020-04-14 16:18:57 +01:00
|
|
|
// Dispatch font size change so that everything open responds to the change.
|
2020-06-15 15:33:52 +01:00
|
|
|
dis.dispatch<UpdateSystemFontPayload>({
|
|
|
|
|
action: Action.UpdateSystemFont,
|
2026-06-30 13:49:28 +01:00
|
|
|
useBundledEmojiFont: this.settingsStore.getValue("useBundledEmojiFont"),
|
|
|
|
|
useSystemFont: this.settingsStore.getValue("useSystemFont"),
|
|
|
|
|
font: this.settingsStore.getValue("systemFont"),
|
2020-04-14 16:18:57 +01:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|