2019-01-23 21:36:42 -07:00
|
|
|
/*
|
2024-09-09 14:57:16 +01:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2023-05-17 13:16:49 +12:00
|
|
|
Copyright 2019-2023 The Matrix.org Foundation C.I.C.
|
2019-08-06 18:06:47 +01:00
|
|
|
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
|
2019-01-23 21:36:42 -07:00
|
|
|
|
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.
|
2019-01-23 21:36:42 -07:00
|
|
|
*/
|
|
|
|
|
|
2025-02-05 13:25:06 +00:00
|
|
|
import React, { type ReactElement, useCallback, useEffect, useState } from "react";
|
2021-08-04 10:37:35 +01:00
|
|
|
|
2025-02-05 13:25:06 +00:00
|
|
|
import { type NonEmptyArray } from "../../../../../@types/common";
|
2024-07-05 23:04:27 +01:00
|
|
|
import { _t, getCurrentLanguage } from "../../../../../languageHandler";
|
2019-02-22 10:47:18 -07:00
|
|
|
import SettingsStore from "../../../../../settings/SettingsStore";
|
|
|
|
|
import Field from "../../../elements/Field";
|
2024-09-02 11:07:07 +02:00
|
|
|
import Dropdown from "../../../elements/Dropdown";
|
2021-06-29 13:11:58 +01:00
|
|
|
import { SettingLevel } from "../../../../../settings/SettingLevel";
|
2021-07-02 18:15:05 +02:00
|
|
|
import SettingsFlag from "../../../elements/SettingsFlag";
|
2021-07-01 19:03:49 +02:00
|
|
|
import AccessibleButton from "../../../elements/AccessibleButton";
|
2021-08-04 10:37:35 +01:00
|
|
|
import dis from "../../../../../dispatcher/dispatcher";
|
2022-03-24 16:42:53 -06:00
|
|
|
import { UserTab } from "../../../dialogs/UserTab";
|
2025-02-05 13:25:06 +00:00
|
|
|
import { type OpenToTabPayload } from "../../../../../dispatcher/payloads/OpenToTabPayload";
|
2022-01-12 20:12:28 +00:00
|
|
|
import { Action } from "../../../../../dispatcher/actions";
|
2022-05-23 11:23:40 +01:00
|
|
|
import SdkConfig from "../../../../../SdkConfig";
|
2024-11-05 18:36:26 +00:00
|
|
|
import { SettingsSubsection } from "../../shared/SettingsSubsection";
|
2023-05-17 13:16:49 +12:00
|
|
|
import SettingsTab from "../SettingsTab";
|
|
|
|
|
import { SettingsSection } from "../../shared/SettingsSection";
|
2024-07-05 23:04:27 +01:00
|
|
|
import LanguageDropdown from "../../../elements/LanguageDropdown";
|
|
|
|
|
import PlatformPeg from "../../../../../PlatformPeg";
|
|
|
|
|
import { IS_MAC } from "../../../../../Keyboard";
|
|
|
|
|
import SpellCheckSettings from "../../SpellCheckSettings";
|
|
|
|
|
import LabelledToggleSwitch from "../../../elements/LabelledToggleSwitch";
|
2024-09-02 11:07:07 +02:00
|
|
|
import * as TimezoneHandler from "../../../../../TimezoneHandler";
|
2025-02-05 13:25:06 +00:00
|
|
|
import { type BooleanSettingKey } from "../../../../../settings/Settings.tsx";
|
2021-08-04 10:37:35 +01:00
|
|
|
|
|
|
|
|
interface IProps {
|
|
|
|
|
closeSettingsFn(success: boolean): void;
|
|
|
|
|
}
|
2021-04-06 12:26:50 +01:00
|
|
|
|
|
|
|
|
interface IState {
|
2024-09-02 11:07:07 +02:00
|
|
|
timezone: string | undefined;
|
|
|
|
|
timezones: string[];
|
|
|
|
|
timezoneSearch: string | undefined;
|
2021-04-26 14:07:45 +01:00
|
|
|
autocompleteDelay: string;
|
|
|
|
|
readMarkerInViewThresholdMs: string;
|
|
|
|
|
readMarkerOutOfViewThresholdMs: string;
|
2021-04-06 12:26:50 +01:00
|
|
|
}
|
2019-01-23 21:36:42 -07:00
|
|
|
|
2024-07-05 23:04:27 +01:00
|
|
|
const LanguageSection: React.FC = () => {
|
|
|
|
|
const [language, setLanguage] = useState(getCurrentLanguage());
|
|
|
|
|
|
|
|
|
|
const onLanguageChange = useCallback(
|
|
|
|
|
(newLanguage: string) => {
|
|
|
|
|
if (language === newLanguage) return;
|
|
|
|
|
|
|
|
|
|
SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLanguage);
|
|
|
|
|
setLanguage(newLanguage);
|
|
|
|
|
const platform = PlatformPeg.get();
|
|
|
|
|
if (platform) {
|
|
|
|
|
platform.setLanguage([newLanguage]);
|
|
|
|
|
platform.reload();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
[language],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return (
|
2024-09-02 11:07:07 +02:00
|
|
|
<div className="mx_SettingsSubsection_dropdown">
|
2024-07-05 23:04:27 +01:00
|
|
|
{_t("settings|general|application_language")}
|
2024-08-01 18:38:21 +01:00
|
|
|
<LanguageDropdown onOptionChange={onLanguageChange} value={language} />
|
|
|
|
|
<div className="mx_PreferencesUserSettingsTab_section_hint">
|
2024-07-05 23:04:27 +01:00
|
|
|
{_t("settings|general|application_language_reload_hint")}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const SpellCheckSection: React.FC = () => {
|
|
|
|
|
const [spellCheckEnabled, setSpellCheckEnabled] = useState<boolean | undefined>();
|
|
|
|
|
const [spellCheckLanguages, setSpellCheckLanguages] = useState<string[] | undefined>();
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
(async () => {
|
|
|
|
|
const plaf = PlatformPeg.get();
|
|
|
|
|
const [enabled, langs] = await Promise.all([plaf?.getSpellCheckEnabled(), plaf?.getSpellCheckLanguages()]);
|
|
|
|
|
|
|
|
|
|
setSpellCheckEnabled(enabled);
|
|
|
|
|
setSpellCheckLanguages(langs || undefined);
|
|
|
|
|
})();
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const onSpellCheckEnabledChange = useCallback((enabled: boolean) => {
|
|
|
|
|
setSpellCheckEnabled(enabled);
|
|
|
|
|
PlatformPeg.get()?.setSpellCheckEnabled(enabled);
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const onSpellCheckLanguagesChange = useCallback((languages: string[]): void => {
|
|
|
|
|
setSpellCheckLanguages(languages);
|
|
|
|
|
PlatformPeg.get()?.setSpellCheckLanguages(languages);
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
if (!PlatformPeg.get()?.supportsSpellCheckSettings()) return null;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<LabelledToggleSwitch
|
|
|
|
|
label={_t("settings|general|allow_spellcheck")}
|
|
|
|
|
value={Boolean(spellCheckEnabled)}
|
|
|
|
|
onChange={onSpellCheckEnabledChange}
|
|
|
|
|
/>
|
|
|
|
|
{spellCheckEnabled && spellCheckLanguages !== undefined && !IS_MAC && (
|
|
|
|
|
<SpellCheckSettings languages={spellCheckLanguages} onLanguagesChange={onSpellCheckLanguagesChange} />
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2021-08-04 10:37:35 +01:00
|
|
|
export default class PreferencesUserSettingsTab extends React.Component<IProps, IState> {
|
2025-01-14 13:35:20 +00:00
|
|
|
private static ROOM_LIST_SETTINGS: BooleanSettingKey[] = ["breadcrumbs"];
|
2020-02-26 23:07:43 +00:00
|
|
|
|
2024-12-23 20:25:15 +00:00
|
|
|
private static SPACES_SETTINGS: BooleanSettingKey[] = ["Spaces.allRoomsInHome"];
|
2021-07-28 14:39:19 +01:00
|
|
|
|
2024-12-23 20:25:15 +00:00
|
|
|
private static KEYBINDINGS_SETTINGS: BooleanSettingKey[] = ["ctrlFForSearch"];
|
2021-03-10 15:34:45 +01:00
|
|
|
|
2024-12-23 20:25:15 +00:00
|
|
|
private static PRESENCE_SETTINGS: BooleanSettingKey[] = ["sendReadReceipts", "sendTypingNotifications"];
|
2022-08-05 17:33:57 +02:00
|
|
|
|
2024-12-23 20:25:15 +00:00
|
|
|
private static COMPOSER_SETTINGS: BooleanSettingKey[] = [
|
2019-01-23 21:36:42 -07:00
|
|
|
"MessageComposerInput.autoReplaceEmoji",
|
2022-04-19 15:53:59 +02:00
|
|
|
"MessageComposerInput.useMarkdown",
|
2019-01-24 20:57:40 -07:00
|
|
|
"MessageComposerInput.suggestEmoji",
|
2020-08-30 20:17:08 +12:00
|
|
|
"MessageComposerInput.ctrlEnterToSend",
|
2021-02-12 07:53:09 +01:00
|
|
|
"MessageComposerInput.surroundWith",
|
2021-01-02 15:31:49 -06:00
|
|
|
"MessageComposerInput.showStickersButton",
|
2022-03-04 16:13:50 +01:00
|
|
|
"MessageComposerInput.insertTrailingColon",
|
2019-01-23 21:36:42 -07:00
|
|
|
];
|
|
|
|
|
|
2024-12-23 20:25:15 +00:00
|
|
|
private static TIME_SETTINGS: BooleanSettingKey[] = ["showTwelveHourTimestamps", "alwaysShowTimestamps"];
|
2022-08-05 17:33:57 +02:00
|
|
|
|
2024-12-23 20:25:15 +00:00
|
|
|
private static CODE_BLOCKS_SETTINGS: BooleanSettingKey[] = [
|
2019-01-23 21:36:42 -07:00
|
|
|
"enableSyntaxHighlightLanguageDetection",
|
2021-01-18 17:44:32 +01:00
|
|
|
"expandCodeByDefault",
|
2021-01-21 13:08:55 +01:00
|
|
|
"showCodeLineNumbers",
|
2019-01-23 21:36:42 -07:00
|
|
|
];
|
2022-08-05 17:33:57 +02:00
|
|
|
|
2024-12-23 20:25:15 +00:00
|
|
|
private static IMAGES_AND_VIDEOS_SETTINGS: BooleanSettingKey[] = [
|
|
|
|
|
"urlPreviewsEnabled",
|
|
|
|
|
"autoplayGifs",
|
|
|
|
|
"autoplayVideo",
|
|
|
|
|
"showImages",
|
|
|
|
|
];
|
2022-08-05 17:33:57 +02:00
|
|
|
|
2024-12-23 20:25:15 +00:00
|
|
|
private static TIMELINE_SETTINGS: BooleanSettingKey[] = [
|
2021-03-10 15:34:45 +01:00
|
|
|
"showTypingNotifications",
|
|
|
|
|
"showRedactions",
|
|
|
|
|
"showReadReceipts",
|
|
|
|
|
"showJoinLeaves",
|
|
|
|
|
"showDisplaynameChanges",
|
2020-10-19 21:25:01 +02:00
|
|
|
"showChatEffects",
|
2021-03-10 15:34:45 +01:00
|
|
|
"showAvatarChanges",
|
2021-04-30 11:03:22 +02:00
|
|
|
"Pill.shouldShowPillAvatar",
|
2021-03-10 15:34:45 +01:00
|
|
|
"TextualBody.enableBigEmoji",
|
|
|
|
|
"scrollToBottomOnMessageSent",
|
2022-07-04 21:37:48 +02:00
|
|
|
"useOnlyCurrentProfiles",
|
2019-01-23 21:36:42 -07:00
|
|
|
];
|
2022-08-05 17:33:57 +02:00
|
|
|
|
2024-12-23 20:25:15 +00:00
|
|
|
private static ROOM_DIRECTORY_SETTINGS: BooleanSettingKey[] = ["SpotlightSearch.showNsfwPublicRooms"];
|
2023-02-22 23:23:52 +13:00
|
|
|
|
2024-12-23 20:25:15 +00:00
|
|
|
private static GENERAL_SETTINGS: BooleanSettingKey[] = [
|
2019-01-23 21:36:42 -07:00
|
|
|
"promptBeforeInviteUnknownUsers",
|
|
|
|
|
// Start automatically after startup (electron-only)
|
|
|
|
|
// Autocomplete delay (niche text box)
|
|
|
|
|
];
|
|
|
|
|
|
2023-02-13 11:39:16 +00:00
|
|
|
public constructor(props: IProps) {
|
2021-04-06 12:26:50 +01:00
|
|
|
super(props);
|
2019-01-23 21:36:42 -07:00
|
|
|
|
|
|
|
|
this.state = {
|
2024-09-02 11:07:07 +02:00
|
|
|
timezone: TimezoneHandler.getUserTimezone(),
|
|
|
|
|
timezones: TimezoneHandler.getAllTimezones(),
|
|
|
|
|
timezoneSearch: undefined,
|
2019-09-17 17:34:30 +01:00
|
|
|
autocompleteDelay: SettingsStore.getValueAt(SettingLevel.DEVICE, "autocompleteDelay").toString(10),
|
|
|
|
|
readMarkerInViewThresholdMs: SettingsStore.getValueAt(
|
|
|
|
|
SettingLevel.DEVICE,
|
|
|
|
|
"readMarkerInViewThresholdMs",
|
|
|
|
|
).toString(10),
|
|
|
|
|
readMarkerOutOfViewThresholdMs: SettingsStore.getValueAt(
|
|
|
|
|
SettingLevel.DEVICE,
|
|
|
|
|
"readMarkerOutOfViewThresholdMs",
|
|
|
|
|
).toString(10),
|
2019-01-23 21:36:42 -07:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-02 11:07:07 +02:00
|
|
|
private onTimezoneChange = (tz: string): void => {
|
|
|
|
|
this.setState({ timezone: tz });
|
|
|
|
|
TimezoneHandler.setUserTimezone(tz);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* If present filter the time zones matching the search term
|
|
|
|
|
*/
|
|
|
|
|
private onTimezoneSearchChange = (search: string): void => {
|
|
|
|
|
const timezoneSearch = search.toLowerCase();
|
|
|
|
|
const timezones = timezoneSearch
|
|
|
|
|
? TimezoneHandler.getAllTimezones().filter((tz) => {
|
|
|
|
|
return tz.toLowerCase().includes(timezoneSearch);
|
|
|
|
|
})
|
|
|
|
|
: TimezoneHandler.getAllTimezones();
|
|
|
|
|
|
|
|
|
|
this.setState({ timezones, timezoneSearch });
|
|
|
|
|
};
|
|
|
|
|
|
2023-01-12 13:25:14 +00:00
|
|
|
private onAutocompleteDelayChange = (e: React.ChangeEvent<HTMLInputElement>): void => {
|
2021-06-29 13:11:58 +01:00
|
|
|
this.setState({ autocompleteDelay: e.target.value });
|
2019-01-23 21:36:42 -07:00
|
|
|
SettingsStore.setValue("autocompleteDelay", null, SettingLevel.DEVICE, e.target.value);
|
|
|
|
|
};
|
|
|
|
|
|
2023-01-12 13:25:14 +00:00
|
|
|
private onReadMarkerInViewThresholdMs = (e: React.ChangeEvent<HTMLInputElement>): void => {
|
2021-06-29 13:11:58 +01:00
|
|
|
this.setState({ readMarkerInViewThresholdMs: e.target.value });
|
2019-09-17 17:34:30 +01:00
|
|
|
SettingsStore.setValue("readMarkerInViewThresholdMs", null, SettingLevel.DEVICE, e.target.value);
|
|
|
|
|
};
|
|
|
|
|
|
2023-01-12 13:25:14 +00:00
|
|
|
private onReadMarkerOutOfViewThresholdMs = (e: React.ChangeEvent<HTMLInputElement>): void => {
|
2021-06-29 13:11:58 +01:00
|
|
|
this.setState({ readMarkerOutOfViewThresholdMs: e.target.value });
|
2019-09-17 17:34:30 +01:00
|
|
|
SettingsStore.setValue("readMarkerOutOfViewThresholdMs", null, SettingLevel.DEVICE, e.target.value);
|
|
|
|
|
};
|
|
|
|
|
|
2024-12-23 20:25:15 +00:00
|
|
|
private renderGroup(settingIds: BooleanSettingKey[], level = SettingLevel.ACCOUNT): React.ReactNodeArray {
|
2023-03-15 08:37:41 +00:00
|
|
|
return settingIds.map((i) => <SettingsFlag key={i} name={i} level={level} />);
|
2019-01-23 21:36:42 -07:00
|
|
|
}
|
|
|
|
|
|
2022-01-17 12:53:10 +01:00
|
|
|
private onKeyboardShortcutsClicked = (): void => {
|
|
|
|
|
dis.dispatch<OpenToTabPayload>({
|
|
|
|
|
action: Action.ViewUserSettings,
|
|
|
|
|
initialTabId: UserTab.Keyboard,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2023-02-13 17:01:43 +00:00
|
|
|
public render(): React.ReactNode {
|
2025-01-14 13:35:20 +00:00
|
|
|
const roomListSettings = PreferencesUserSettingsTab.ROOM_LIST_SETTINGS;
|
2022-07-29 13:43:29 +02:00
|
|
|
|
2024-09-02 11:07:07 +02:00
|
|
|
const browserTimezoneLabel: string = _t("settings|preferences|default_timezone", {
|
|
|
|
|
timezone: TimezoneHandler.shortBrowserTimezone(),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Always Preprend the default option
|
|
|
|
|
const timezones = this.state.timezones.map((tz) => {
|
|
|
|
|
return <div key={tz}>{tz}</div>;
|
|
|
|
|
});
|
|
|
|
|
timezones.unshift(<div key="">{browserTimezoneLabel}</div>);
|
|
|
|
|
|
2019-01-23 21:36:42 -07:00
|
|
|
return (
|
2023-05-17 13:16:49 +12:00
|
|
|
<SettingsTab data-testid="mx_PreferencesUserSettingsTab">
|
2024-05-07 10:32:24 +01:00
|
|
|
<SettingsSection>
|
2024-07-05 23:04:27 +01:00
|
|
|
{/* The heading string is still 'general' from where it was moved, but this section should become 'general' */}
|
|
|
|
|
<SettingsSubsection heading={_t("settings|general|language_section")}>
|
|
|
|
|
<LanguageSection />
|
|
|
|
|
<SpellCheckSection />
|
|
|
|
|
</SettingsSubsection>
|
|
|
|
|
|
2023-05-17 13:16:49 +12:00
|
|
|
{roomListSettings.length > 0 && (
|
2023-09-19 17:16:38 +01:00
|
|
|
<SettingsSubsection heading={_t("settings|preferences|room_list_heading")}>
|
2023-05-17 13:16:49 +12:00
|
|
|
{this.renderGroup(roomListSettings)}
|
|
|
|
|
</SettingsSubsection>
|
|
|
|
|
)}
|
2019-11-26 13:43:47 +01:00
|
|
|
|
2023-09-26 13:04:17 +01:00
|
|
|
<SettingsSubsection heading={_t("common|spaces")}>
|
2023-05-17 13:16:49 +12:00
|
|
|
{this.renderGroup(PreferencesUserSettingsTab.SPACES_SETTINGS, SettingLevel.ACCOUNT)}
|
|
|
|
|
</SettingsSubsection>
|
2020-02-26 23:07:43 +00:00
|
|
|
|
2023-05-17 13:16:49 +12:00
|
|
|
<SettingsSubsection
|
2023-09-19 17:16:38 +01:00
|
|
|
heading={_t("settings|preferences|keyboard_heading")}
|
2023-05-17 13:16:49 +12:00
|
|
|
description={_t(
|
2023-09-19 17:16:38 +01:00
|
|
|
"settings|preferences|keyboard_view_shortcuts_button",
|
2021-12-02 13:43:10 +00:00
|
|
|
{},
|
|
|
|
|
{
|
2022-06-29 22:37:34 +00:00
|
|
|
a: (sub) => (
|
|
|
|
|
<AccessibleButton kind="link_inline" onClick={this.onKeyboardShortcutsClicked}>
|
2021-12-02 13:43:10 +00:00
|
|
|
{sub}
|
|
|
|
|
</AccessibleButton>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
)}
|
2023-05-17 13:16:49 +12:00
|
|
|
>
|
|
|
|
|
{this.renderGroup(PreferencesUserSettingsTab.KEYBINDINGS_SETTINGS)}
|
|
|
|
|
</SettingsSubsection>
|
2021-03-10 15:34:45 +01:00
|
|
|
|
2023-09-19 17:16:38 +01:00
|
|
|
<SettingsSubsection heading={_t("settings|preferences|time_heading")}>
|
2024-09-02 11:07:07 +02:00
|
|
|
<div className="mx_SettingsSubsection_dropdown">
|
|
|
|
|
{_t("settings|preferences|user_timezone")}
|
|
|
|
|
<Dropdown
|
|
|
|
|
id="mx_dropdownUserTimezone"
|
|
|
|
|
className="mx_dropdownUserTimezone"
|
|
|
|
|
data-testid="mx_dropdownUserTimezone"
|
|
|
|
|
searchEnabled={true}
|
|
|
|
|
value={this.state.timezone}
|
|
|
|
|
label={_t("settings|preferences|user_timezone")}
|
|
|
|
|
placeholder={browserTimezoneLabel}
|
|
|
|
|
onOptionChange={this.onTimezoneChange}
|
|
|
|
|
onSearchChange={this.onTimezoneSearchChange}
|
|
|
|
|
>
|
|
|
|
|
{timezones as NonEmptyArray<ReactElement & { key: string }>}
|
|
|
|
|
</Dropdown>
|
|
|
|
|
</div>
|
|
|
|
|
|
2023-05-17 13:16:49 +12:00
|
|
|
{this.renderGroup(PreferencesUserSettingsTab.TIME_SETTINGS)}
|
2024-09-12 14:18:25 +01:00
|
|
|
<SettingsFlag name="userTimezonePublish" level={SettingLevel.DEVICE} />
|
2023-05-17 13:16:49 +12:00
|
|
|
</SettingsSubsection>
|
2022-08-05 17:33:57 +02:00
|
|
|
|
2023-05-17 13:16:49 +12:00
|
|
|
<SettingsSubsection
|
2023-08-31 11:22:10 +01:00
|
|
|
heading={_t("common|presence")}
|
2023-09-19 17:16:38 +01:00
|
|
|
description={_t("settings|preferences|presence_description")}
|
2023-05-17 13:16:49 +12:00
|
|
|
>
|
|
|
|
|
{this.renderGroup(PreferencesUserSettingsTab.PRESENCE_SETTINGS)}
|
|
|
|
|
</SettingsSubsection>
|
2021-03-10 15:34:45 +01:00
|
|
|
|
2023-09-19 17:16:38 +01:00
|
|
|
<SettingsSubsection heading={_t("settings|preferences|composer_heading")}>
|
2023-05-17 13:16:49 +12:00
|
|
|
{this.renderGroup(PreferencesUserSettingsTab.COMPOSER_SETTINGS)}
|
|
|
|
|
</SettingsSubsection>
|
2019-01-23 21:36:42 -07:00
|
|
|
|
2023-09-19 17:16:38 +01:00
|
|
|
<SettingsSubsection heading={_t("settings|preferences|code_blocks_heading")}>
|
2023-05-17 13:16:49 +12:00
|
|
|
{this.renderGroup(PreferencesUserSettingsTab.CODE_BLOCKS_SETTINGS)}
|
|
|
|
|
</SettingsSubsection>
|
2021-03-10 15:34:45 +01:00
|
|
|
|
2023-09-19 17:16:38 +01:00
|
|
|
<SettingsSubsection heading={_t("settings|preferences|media_heading")}>
|
2023-05-17 13:16:49 +12:00
|
|
|
{this.renderGroup(PreferencesUserSettingsTab.IMAGES_AND_VIDEOS_SETTINGS)}
|
|
|
|
|
</SettingsSubsection>
|
2021-03-10 15:34:45 +01:00
|
|
|
|
2023-08-31 11:22:10 +01:00
|
|
|
<SettingsSubsection heading={_t("common|timeline")}>
|
2023-05-17 13:16:49 +12:00
|
|
|
{this.renderGroup(PreferencesUserSettingsTab.TIMELINE_SETTINGS)}
|
|
|
|
|
</SettingsSubsection>
|
2023-02-22 23:23:52 +13:00
|
|
|
|
2023-09-19 17:16:38 +01:00
|
|
|
<SettingsSubsection heading={_t("settings|preferences|room_directory_heading")}>
|
2023-05-17 13:16:49 +12:00
|
|
|
{this.renderGroup(PreferencesUserSettingsTab.ROOM_DIRECTORY_SETTINGS)}
|
|
|
|
|
</SettingsSubsection>
|
2019-01-23 21:36:42 -07:00
|
|
|
|
2023-09-26 13:04:17 +01:00
|
|
|
<SettingsSubsection heading={_t("common|general")} stretchContent>
|
2023-05-17 13:16:49 +12:00
|
|
|
{this.renderGroup(PreferencesUserSettingsTab.GENERAL_SETTINGS)}
|
2022-06-10 22:38:50 +01:00
|
|
|
|
2023-05-17 13:16:49 +12:00
|
|
|
<SettingsFlag name="Electron.showTrayIcon" level={SettingLevel.PLATFORM} hideIfCannotSet />
|
|
|
|
|
<SettingsFlag
|
|
|
|
|
name="Electron.enableHardwareAcceleration"
|
|
|
|
|
level={SettingLevel.PLATFORM}
|
|
|
|
|
hideIfCannotSet
|
2023-09-19 17:16:38 +01:00
|
|
|
label={_t("settings|preferences|Electron.enableHardwareAcceleration", {
|
2023-05-17 13:16:49 +12:00
|
|
|
appName: SdkConfig.get().brand,
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<SettingsFlag name="Electron.alwaysShowMenuBar" level={SettingLevel.PLATFORM} hideIfCannotSet />
|
|
|
|
|
<SettingsFlag name="Electron.autoLaunch" level={SettingLevel.PLATFORM} hideIfCannotSet />
|
|
|
|
|
<SettingsFlag name="Electron.warnBeforeExit" level={SettingLevel.PLATFORM} hideIfCannotSet />
|
2022-06-10 22:38:50 +01:00
|
|
|
|
2023-05-17 13:16:49 +12:00
|
|
|
<Field
|
2023-09-19 17:16:38 +01:00
|
|
|
label={_t("settings|preferences|autocomplete_delay")}
|
2023-05-17 13:16:49 +12:00
|
|
|
type="number"
|
|
|
|
|
value={this.state.autocompleteDelay}
|
|
|
|
|
onChange={this.onAutocompleteDelayChange}
|
|
|
|
|
/>
|
|
|
|
|
<Field
|
2023-09-19 17:16:38 +01:00
|
|
|
label={_t("settings|preferences|rm_lifetime")}
|
2023-05-17 13:16:49 +12:00
|
|
|
type="number"
|
|
|
|
|
value={this.state.readMarkerInViewThresholdMs}
|
|
|
|
|
onChange={this.onReadMarkerInViewThresholdMs}
|
|
|
|
|
/>
|
|
|
|
|
<Field
|
2023-09-19 17:16:38 +01:00
|
|
|
label={_t("settings|preferences|rm_lifetime_offscreen")}
|
2023-05-17 13:16:49 +12:00
|
|
|
type="number"
|
|
|
|
|
value={this.state.readMarkerOutOfViewThresholdMs}
|
|
|
|
|
onChange={this.onReadMarkerOutOfViewThresholdMs}
|
|
|
|
|
/>
|
|
|
|
|
</SettingsSubsection>
|
|
|
|
|
</SettingsSection>
|
|
|
|
|
</SettingsTab>
|
2019-01-23 21:36:42 -07:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|