mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 07:08:55 +02:00
Add an option to disable smooth scrolling for the Electron app (#6912)
This commit is contained in:
commit
86a620bc08
@ -1118,7 +1118,9 @@
|
||||
"title": "Performance",
|
||||
"enable-motion": "Enable transitions and animations",
|
||||
"enable-shadows": "Enable shadows",
|
||||
"enable-backdrop-effects": "Enable background effects for menus, popups and panels"
|
||||
"enable-backdrop-effects": "Enable background effects for menus, popups and panels",
|
||||
"enable-smooth-scroll": "Enable smooth scrolling",
|
||||
"app-restart-required": "(a restart of the application is required for the change to take effect)"
|
||||
},
|
||||
"ai_llm": {
|
||||
"not_started": "Not started",
|
||||
|
@ -2013,7 +2013,9 @@
|
||||
"title": "Setări de performanță",
|
||||
"enable-motion": "Activează tranzițiile și animațiile",
|
||||
"enable-shadows": "Activează umbrirea elementelor",
|
||||
"enable-backdrop-effects": "Activează efectele de fundal pentru meniuri, popup-uri și panouri"
|
||||
"enable-backdrop-effects": "Activează efectele de fundal pentru meniuri, popup-uri și panouri",
|
||||
"enable-smooth-scroll": "Activează derularea lină",
|
||||
"app-restart-required": "(este necesară repornirea aplicației pentru ca modificarea să aibă efect)"
|
||||
},
|
||||
"settings": {
|
||||
"related_settings": "Setări similare"
|
||||
|
@ -266,9 +266,20 @@ function Performance() {
|
||||
label={t("ui-performance.enable-backdrop-effects")}
|
||||
currentValue={backdropEffectsEnabled} onChange={setBackdropEffectsEnabled}
|
||||
/>
|
||||
|
||||
{isElectron() && <SmoothScrollEnabledOption />}
|
||||
|
||||
</OptionsSection>
|
||||
}
|
||||
|
||||
function SmoothScrollEnabledOption() {
|
||||
const [ smoothScrollEnabled, setSmoothScrollEnabled ] = useTriliumOptionBool("smoothScrollEnabled");
|
||||
|
||||
return <FormCheckbox
|
||||
label={`${t("ui-performance.enable-smooth-scroll")} ${t("ui-performance.app-restart-required")}`}
|
||||
currentValue={smoothScrollEnabled} onChange={setSmoothScrollEnabled}
|
||||
/>
|
||||
}
|
||||
|
||||
function MaxContentWidth() {
|
||||
const [ maxContentWidth, setMaxContentWidth ] = useTriliumOption("maxContentWidth");
|
||||
|
@ -25,6 +25,12 @@ async function main() {
|
||||
// needed for excalidraw export https://github.com/zadam/trilium/issues/4271
|
||||
electron.app.commandLine.appendSwitch("enable-experimental-web-platform-features");
|
||||
electron.app.commandLine.appendSwitch("lang", options.getOptionOrNull("formattingLocale") ?? "en");
|
||||
|
||||
// Disable smooth scroll if the option is set
|
||||
const smoothScrollEnabled = options.getOptionOrNull("smoothScrollEnabled");
|
||||
if (smoothScrollEnabled === "false") {
|
||||
electron.app.commandLine.appendSwitch("disable-smooth-scrolling");
|
||||
}
|
||||
|
||||
// Electron 36 crashes with "Using GTK 2/3 and GTK 4 in the same process is not supported" on some distributions.
|
||||
// See https://github.com/electron/electron/issues/46538 for more info.
|
||||
|
@ -65,6 +65,7 @@ const ALLOWED_OPTIONS = new Set<OptionNames>([
|
||||
"monthlyBackupEnabled",
|
||||
"motionEnabled",
|
||||
"shadowsEnabled",
|
||||
"smoothScrollEnabled",
|
||||
"backdropEffectsEnabled",
|
||||
"maxContentWidth",
|
||||
"compressImages",
|
||||
|
@ -155,7 +155,7 @@ const defaultOptions: DefaultOption[] = [
|
||||
{ name: "motionEnabled", value: "true", isSynced: false },
|
||||
{ name: "shadowsEnabled", value: "true", isSynced: false },
|
||||
{ name: "backdropEffectsEnabled", value: "true", isSynced: false },
|
||||
|
||||
{ name: "smoothScrollEnabled", value: "true", isSynced: false },
|
||||
|
||||
// Internationalization
|
||||
{ name: "locale", value: "en", isSynced: true },
|
||||
|
@ -96,6 +96,7 @@ export interface OptionDefinitions extends KeyboardShortcutsOptions<KeyboardActi
|
||||
motionEnabled: boolean;
|
||||
shadowsEnabled: boolean;
|
||||
backdropEffectsEnabled: boolean;
|
||||
smoothScrollEnabled: boolean;
|
||||
codeNoteTheme: string;
|
||||
|
||||
initialized: boolean;
|
||||
|
Loading…
x
Reference in New Issue
Block a user