mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	Compare commits
	
		
			4 Commits
		
	
	
		
			feat/ui-op
			...
			feat/ui-op
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | d35dbca18b | ||
|  | 7468d6147a | ||
|  | 7c78d749de | ||
|  | 85dd99a3c4 | 
| @@ -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; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -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", | ||||||
|   | |||||||
| @@ -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() { | ||||||
|   | |||||||
| @@ -248,13 +248,21 @@ 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"> | ||||||
|                 <FormCheckbox |             <FormCheckbox | ||||||
|                     label={t("ui-performance.enable-motion")} |                 label={t("ui-performance.enable-motion")} | ||||||
|                     currentValue={motionEnabled} onChange={setMotionEnabled} |                 currentValue={motionEnabled} onChange={setMotionEnabled} | ||||||
|                 /> |             /> | ||||||
|  |         </FormGroup> | ||||||
|  |         <FormGroup name="shadows-enabled"> | ||||||
|  |             <FormCheckbox | ||||||
|  |                 label={t("ui-performance.enable-shadows")} | ||||||
|  |                 currentValue={shadowsEnabled} onChange={setShadowsEnabled} | ||||||
|  |             /> | ||||||
|         </FormGroup> |         </FormGroup> | ||||||
|     </OptionsSection> |     </OptionsSection> | ||||||
| } | } | ||||||
|   | |||||||
| @@ -64,6 +64,7 @@ const ALLOWED_OPTIONS = new Set<OptionNames>([ | |||||||
|     "weeklyBackupEnabled", |     "weeklyBackupEnabled", | ||||||
|     "monthlyBackupEnabled", |     "monthlyBackupEnabled", | ||||||
|     "motionEnabled", |     "motionEnabled", | ||||||
|  |     "shadowsEnabled", | ||||||
|     "maxContentWidth", |     "maxContentWidth", | ||||||
|     "compressImages", |     "compressImages", | ||||||
|     "downloadImagesAutomatically", |     "downloadImagesAutomatically", | ||||||
|   | |||||||
| @@ -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 }, | ||||||
|   | |||||||
| @@ -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; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user