mirror of
https://github.com/zadam/trilium.git
synced 2025-10-13 00:47:56 +08:00
client/settings/disable motion: add an option to allow transitions and animations to be disabled
This commit is contained in:
parent
4c8da70ef3
commit
03681d23c5
6 changed files with 20 additions and 1 deletions
|
@ -88,6 +88,7 @@ export default function AppearanceSettings() {
|
||||||
<ApplicationTheme />
|
<ApplicationTheme />
|
||||||
{overrideThemeFonts === "true" && <Fonts />}
|
{overrideThemeFonts === "true" && <Fonts />}
|
||||||
{isElectron() && <ElectronIntegration /> }
|
{isElectron() && <ElectronIntegration /> }
|
||||||
|
<Performance />
|
||||||
<MaxContentWidth />
|
<MaxContentWidth />
|
||||||
<RelatedSettings items={[
|
<RelatedSettings items={[
|
||||||
{
|
{
|
||||||
|
@ -245,6 +246,20 @@ function ElectronIntegration() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Performance() {
|
||||||
|
const [ motionEnabled, setMotionEnabled ] = useTriliumOptionBool("motionEnabled", true);
|
||||||
|
|
||||||
|
return <OptionsSection title="Performance">
|
||||||
|
<FormGroup name="motion-enabled">
|
||||||
|
<FormCheckbox
|
||||||
|
label={"Use transitions and animations"}
|
||||||
|
currentValue={motionEnabled} onChange={setMotionEnabled}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
|
</OptionsSection>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function MaxContentWidth() {
|
function MaxContentWidth() {
|
||||||
const [ maxContentWidth, setMaxContentWidth ] = useTriliumOption("maxContentWidth");
|
const [ maxContentWidth, setMaxContentWidth ] = useTriliumOption("maxContentWidth");
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<link rel="manifest" crossorigin="use-credentials" href="manifest.webmanifest">
|
<link rel="manifest" crossorigin="use-credentials" href="manifest.webmanifest">
|
||||||
<title>Trilium Notes</title>
|
<title>Trilium Notes</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="desktop heading-style-<%= headingStyle %> layout-<%= layoutOrientation %> platform-<%= platform %> <%= isElectron ? 'electron' : '' %> <%= hasNativeTitleBar ? 'native-titlebar' : '' %> <%= hasBackgroundEffects ? 'background-effects' : '' %>">
|
<body class="desktop heading-style-<%= headingStyle %> layout-<%= layoutOrientation %> platform-<%= platform %> <%= isElectron ? 'electron' : '' %> <%= hasNativeTitleBar ? 'native-titlebar' : '' %> <%= hasBackgroundEffects ? 'background-effects' : '' %> <%= motionEnabled ? '' : 'motion-disabled' %>">
|
||||||
<noscript><%= t("javascript-required") %></noscript>
|
<noscript><%= t("javascript-required") %></noscript>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -63,6 +63,7 @@ const ALLOWED_OPTIONS = new Set<OptionNames>([
|
||||||
"dailyBackupEnabled",
|
"dailyBackupEnabled",
|
||||||
"weeklyBackupEnabled",
|
"weeklyBackupEnabled",
|
||||||
"monthlyBackupEnabled",
|
"monthlyBackupEnabled",
|
||||||
|
"motionEnabled",
|
||||||
"maxContentWidth",
|
"maxContentWidth",
|
||||||
"compressImages",
|
"compressImages",
|
||||||
"downloadImagesAutomatically",
|
"downloadImagesAutomatically",
|
||||||
|
|
|
@ -53,6 +53,7 @@ function index(req: Request, res: Response) {
|
||||||
isDev,
|
isDev,
|
||||||
isMainWindow: view === "mobile" ? true : !req.query.extraWindow,
|
isMainWindow: view === "mobile" ? true : !req.query.extraWindow,
|
||||||
isProtectedSessionAvailable: protectedSessionService.isProtectedSessionAvailable(),
|
isProtectedSessionAvailable: protectedSessionService.isProtectedSessionAvailable(),
|
||||||
|
motionEnabled: options.motionEnabled === "true",
|
||||||
maxContentWidth: Math.max(640, parseInt(options.maxContentWidth)),
|
maxContentWidth: Math.max(640, parseInt(options.maxContentWidth)),
|
||||||
triliumVersion: packageJson.version,
|
triliumVersion: packageJson.version,
|
||||||
assetPath: assetPath,
|
assetPath: assetPath,
|
||||||
|
|
|
@ -152,6 +152,7 @@ const defaultOptions: DefaultOption[] = [
|
||||||
},
|
},
|
||||||
isSynced: false
|
isSynced: false
|
||||||
},
|
},
|
||||||
|
{ name: "motionEnabled", value: "true", isSynced: false },
|
||||||
|
|
||||||
// Internationalization
|
// Internationalization
|
||||||
{ name: "locale", value: "en", isSynced: true },
|
{ name: "locale", value: "en", isSynced: true },
|
||||||
|
|
|
@ -93,6 +93,7 @@ export interface OptionDefinitions extends KeyboardShortcutsOptions<KeyboardActi
|
||||||
|
|
||||||
// Appearance
|
// Appearance
|
||||||
splitEditorOrientation: "horziontal" | "vertical";
|
splitEditorOrientation: "horziontal" | "vertical";
|
||||||
|
motionEnabled: boolean;
|
||||||
codeNoteTheme: string;
|
codeNoteTheme: string;
|
||||||
|
|
||||||
initialized: boolean;
|
initialized: boolean;
|
||||||
|
|
Loading…
Add table
Reference in a new issue