Compare commits

...

4 Commits

7 changed files with 34 additions and 5 deletions

View File

@@ -36,6 +36,13 @@ body#trilium-app.motion-disabled *::after {
animation: none !important; animation: none !important;
} }
body#trilium-app.shadows-disabled *,
body#trilium-app.shadows-disabled *::before,
body#trilium-app.shadows-disabled *::after {
/* Disable shadows */
box-shadow: none !important;
}
.table { .table {
--bs-table-bg: transparent !important; --bs-table-bg: transparent !important;
} }

View File

@@ -1115,7 +1115,8 @@
}, },
"ui-performance": { "ui-performance": {
"title": "Performance", "title": "Performance",
"enable-motion": "Enable transitions and animations" "enable-motion": "Enable transitions and animations",
"enable-shadows": "Enable shadows"
}, },
"ai_llm": { "ai_llm": {
"not_started": "Not started", "not_started": "Not started",

View File

@@ -31,6 +31,7 @@ export default class RootContainer extends FlexContainer<BasicWidget> {
} }
this.#setMotion(options.is("motionEnabled")); this.#setMotion(options.is("motionEnabled"));
this.#setShadows(options.is("shadowsEnabled"));
return super.render(); return super.render();
} }
@@ -39,6 +40,10 @@ export default class RootContainer extends FlexContainer<BasicWidget> {
if (loadResults.isOptionReloaded("motionEnabled")) { if (loadResults.isOptionReloaded("motionEnabled")) {
this.#setMotion(options.is("motionEnabled")); this.#setMotion(options.is("motionEnabled"));
} }
if (loadResults.isOptionReloaded("shadowsEnabled")) {
this.#setShadows(options.is("shadowsEnabled"));
}
} }
#onMobileResize() { #onMobileResize() {
@@ -51,6 +56,10 @@ export default class RootContainer extends FlexContainer<BasicWidget> {
document.body.classList.toggle("motion-disabled", !enabled); document.body.classList.toggle("motion-disabled", !enabled);
jQuery.fx.off = !enabled; jQuery.fx.off = !enabled;
} }
#setShadows(enabled: boolean) {
document.body.classList.toggle("shadows-disabled", !enabled);
}
} }
function getViewportHeight() { function getViewportHeight() {

View File

@@ -248,6 +248,8 @@ function ElectronIntegration() {
function Performance() { function Performance() {
const [ motionEnabled, setMotionEnabled ] = useTriliumOptionBool("motionEnabled"); const [ motionEnabled, setMotionEnabled ] = useTriliumOptionBool("motionEnabled");
const [ shadowsEnabled, setShadowsEnabled ] = useTriliumOptionBool("shadowsEnabled");
return <OptionsSection title={t("ui-performance.title")}> return <OptionsSection title={t("ui-performance.title")}>
<FormGroup name="motion-enabled"> <FormGroup name="motion-enabled">
@@ -256,6 +258,12 @@ function Performance() {
currentValue={motionEnabled} onChange={setMotionEnabled} currentValue={motionEnabled} onChange={setMotionEnabled}
/> />
</FormGroup> </FormGroup>
<FormGroup name="shadows-enabled">
<FormCheckbox
label={t("ui-performance.enable-shadows")}
currentValue={shadowsEnabled} onChange={setShadowsEnabled}
/>
</FormGroup>
</OptionsSection> </OptionsSection>
} }

View File

@@ -64,6 +64,7 @@ const ALLOWED_OPTIONS = new Set<OptionNames>([
"weeklyBackupEnabled", "weeklyBackupEnabled",
"monthlyBackupEnabled", "monthlyBackupEnabled",
"motionEnabled", "motionEnabled",
"shadowsEnabled",
"maxContentWidth", "maxContentWidth",
"compressImages", "compressImages",
"downloadImagesAutomatically", "downloadImagesAutomatically",

View File

@@ -153,6 +153,8 @@ const defaultOptions: DefaultOption[] = [
isSynced: false isSynced: false
}, },
{ name: "motionEnabled", value: "true", isSynced: false }, { name: "motionEnabled", value: "true", isSynced: false },
{ name: "shadowsEnabled", value: "true", isSynced: false },
// Internationalization // Internationalization
{ name: "locale", value: "en", isSynced: true }, { name: "locale", value: "en", isSynced: true },

View File

@@ -94,6 +94,7 @@ export interface OptionDefinitions extends KeyboardShortcutsOptions<KeyboardActi
// Appearance // Appearance
splitEditorOrientation: "horziontal" | "vertical"; splitEditorOrientation: "horziontal" | "vertical";
motionEnabled: boolean; motionEnabled: boolean;
shadowsEnabled: boolean;
codeNoteTheme: string; codeNoteTheme: string;
initialized: boolean; initialized: boolean;