Commit graph

202 commits

Author SHA1 Message Date
Jack251970
46cecb2acc Improve code quality 2026-03-01 14:26:12 +08:00
Jack251970
e3d71f94ef Refactor window border style creation and copying
Replaces GetNewWindowBorderStyle with direct instantiation of a new Style for Border and uses CopyStyle to transfer properties. Removes the old helper method and moves style copying logic inline for improved clarity and maintainability.
2026-03-01 14:23:57 +08:00
Jack251970
4767b444ec Optimize SolidColorBrush usage for window background
Freeze SolidColorBrush instances before assigning them to mainWindow.Background to improve performance and immutability. Applied to both transparent and selected background scenarios.
2026-03-01 14:16:36 +08:00
Jack251970
428a7ad0c2 Prioritize user ColorScheme over system dark mode setting
Refactored dark mode logic to first use user's ColorScheme
preference when "SystemBG" is set to "Auto". Only falls back
to system dark mode setting if ColorScheme is not explicitly
set to "Dark" or "Light". This ensures user preferences take
precedence over system defaults.
2026-03-01 14:15:15 +08:00
Jack251970
2e6fb61248 Refactor blur theme logic and helper function
Renamed IsBlurTheme to IsThemeBlurEnabled and moved system
backdrop support checks out of the helper function. Blur
availability is now determined by combining theme settings
and system capability in the calling code. Updated all
usages to reflect the new logic for improved clarity.
2026-03-01 14:13:32 +08:00
Jack251970
c87f3d3447 Improve theme resource access robustness
Refactored theme resource dictionary lookups to safely check for "WindowBorderStyle" before accessing, preventing potential exceptions. Updated three methods to handle missing styles gracefully and standardized resource key checks. GetWindowBorderStyleBackground now returns transparent if style is missing.
2026-03-01 14:05:36 +08:00
Jack251970
3db201f4a3 Use DispatcherPriority.Render for theme UI updates
Explicitly set DispatcherPriority.Render when invoking RefreshFrameAsync and SetBlurForWindowAsync on the application's dispatcher. This ensures theme-related UI changes are processed with rendering priority, improving responsiveness and visual consistency. Also added System.Windows.Threading import for access to DispatcherPriority.
2026-03-01 14:00:07 +08:00
Jack251970
9943b72839 Refactor drop shadow handling for window border style
Reworked how drop shadow effects are added and removed by creating new unsealed Style instances instead of modifying sealed ones. Resources, triggers, and setters are copied, with margin adjustments and effect setter management to ensure reliability. Introduced GetNewWindowBorderStyle helper for style copying.
2026-03-01 13:59:32 +08:00
Jack251970
5b6b7e728e Rename themeName to theme in UpdateFonts for consistency
Renamed the variable themeName to theme in the UpdateFonts method
to improve naming consistency. No functional changes were made.
2026-03-01 13:59:15 +08:00
Jack251970
340f2cbc04 Refactor blur theme detection for accuracy
Improve IsBlurTheme to check blur support directly in the
current theme's resource dictionary, ensuring precise and
context-specific detection. Updated related logic and comments
for clarity.
2026-03-01 12:19:26 +08:00
Jack251970
84ed1fa1e1 Add null checks and fix dispatcher invocation in Theme
Added early returns if Application.Current is null in RefreshFrameAsync and SetBlurForWindowAsync to prevent null reference exceptions. Updated dispatcher access checks and ensured the correct method is invoked asynchronously for each case, improving robustness and reliability.
2026-02-28 23:22:06 +08:00
Jack251970
a83da2b00f Improve Theme resource handling and suppress async warnings
Add try-catch to UpdateResourceDictionary to prevent crashes from InvalidCastException when updating resources. Set _oldResource to null on error. Suppress VSTHRD103 warnings around SetBlurForWindow to clarify intentional async usage and avoid build warnings.
2026-02-28 23:08:53 +08:00
Jack251970
7b855745d9 Refactor drop shadow logic in Theme.cs for accuracy
Moved RemoveDropShadowEffectFromCurrentTheme() into specific conditional branches within AutoDropShadow to ensure it is only called when appropriate. Explicitly set window corner preference and drop shadow effect based on theme and blur support, improving appearance consistency and logic clarity.
2026-02-28 22:45:23 +08:00
Jack251970
966bcdd5ec Refactor UI thread checks in Theme async methods
Refactored RefreshFrameAsync and SetBlurForWindowAsync to check Dispatcher access before invoking UI updates, ensuring thread safety and reducing unnecessary Dispatcher calls. Also removed redundant code and unused using directive.
2026-02-28 22:03:55 +08:00
Jack251970
60b92c5b96 Improve brush handling and resource safety in theme styles
Refactored caret and background brush assignment to avoid sharing mutable instances and ensure proper resource referencing. Added GetNewCaretValue helper for safe caret brush creation. Brushes for backgrounds are now frozen for performance. Improved foreground value retrieval and dynamic resource key extraction. Made some methods static for clarity and consistency. Enhances resource management and reliability in theme handling.
2026-02-28 15:14:34 +08:00
Jack Ye
a2d12eb225
Merge branch 'dev' into plugin_initialization 2025-10-05 19:25:01 +08:00
Jack Ye
5ae159de5b
Move to iNKORE.UI.WPF.Modern UI Framework (#3593) 2025-10-05 13:44:40 +03:00
Jack251970
5ed94c8abc Resolve conflicts 2025-10-02 20:25:45 +08:00
Jack Ye
6213193cda
Merge branch 'dev' into plugin_initialization 2025-10-02 20:22:20 +08:00
Jack251970
0e366a6269 Use PublicApi.Instance instead of private one 2025-09-23 17:40:54 +08:00
Jack251970
7350c1d4d5 Use Flow.Launcher.Localization to improve code quality 2025-09-23 17:14:30 +08:00
Jack Ye
3116f3d363
Merge branch 'dev' into plugin_initialization 2025-09-21 13:22:31 +08:00
Jack251970
0f6245a072 Handle exceptions inside ChangeLanguageAsync to avoid unobserved task crashes 2025-09-18 18:18:02 +08:00
Jack251970
86581e6a00 Add disposable for internalization 2025-09-18 18:17:27 +08:00
Jack251970
330e6c09e7 Add language change lock 2025-09-18 18:07:18 +08:00
Jack251970
6c695f09e7 Use clear function 2025-09-18 17:55:06 +08:00
Jack251970
b05c2c1e1a Remove old dictionaries references to fix possible memory leak 2025-09-18 16:25:21 +08:00
Jack Ye
cf8096f276
Merge branch 'dev' into plugin_initialization 2025-09-05 20:35:05 +08:00
Jeremy Wu
e1cc50c579 Merge remote-tracking branch 'origin/master' into resolve_conflicts 2025-08-31 17:53:21 +10:00
Jeremy Wu
a9b5b3aa38
Merge pull request #3860 from Flow-Launcher/taooceros-patch-1
Add Srpski (Cyrillic)
2025-08-20 18:31:51 +10:00
Jack251970
d8f8de2abe Use Српски instead of Српска 2025-08-16 11:41:25 +08:00
Kevin Zhang
7664944ff2
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-28 16:27:47 -05:00
Kevin Zhang
16603697a5
Add Srpski (Cyrillic) 2025-07-22 22:48:19 -05:00
Jack251970
d4e672d630 Add support to update translation for one plugin 2025-07-21 13:55:47 +08:00
Jack Ye
71eaf2d789
Merge branch 'dev' into code_quality 2025-07-21 10:23:08 +08:00
Jack Ye
ed0524d207
Merge branch 'dev' into code_quality 2025-07-20 20:02:51 +08:00
Jack251970
fea899d09a No need to get lower for language code 2025-07-20 17:37:12 +08:00
Jack251970
f77f14b0ee Improve code quality 2025-07-20 17:35:07 +08:00
Jack251970
ac7da2d2d6 Do not check if the language directory contains default language file 2025-07-20 17:26:14 +08:00
Jack251970
5e8acf7d74 Use OrdinalIgnoreCase 2025-07-20 15:29:27 +08:00
Jack251970
634bdc5bd6 Do not check Flow Launcher default language file since it is binary embedded 2025-07-20 15:26:07 +08:00
Jack251970
2ee53dfbf7 Initialize language before portable clean up since it needs translations 2025-07-20 15:20:18 +08:00
Jack251970
0682e9bed1 Improve code quality for public api 2025-07-20 11:38:44 +08:00
Jack Ye
fc6ff5a7a0
Merge branch 'dev' into code_quality 2025-07-14 09:09:09 +08:00
Jeremy Wu
2e0dd1cfa1
Release 1.20.2 | Plugin 4.7.0 (#3820) 2025-07-13 17:18:34 +03:00
Jack251970
d3f5274b24 Make GetPluginsForInterface private & Code quality 2025-07-03 20:45:20 +08:00
Jack251970
9be2ef0924 Remove unused class 2025-06-23 13:03:45 +08:00
Jack Ye
43c74f04ac
Merge branch 'dev' into winform_language_issue 2025-06-16 21:10:19 +08:00
Jeremy Wu
7ae91b1af3
Release 1.20.1 | Plugin 4.6.0 (#3706) 2025-06-14 13:45:30 +03:00
Jack Ye
a02a236ca4
Merge branch 'dev' into explorer_plugin_code_quality 2025-06-06 21:30:54 +08:00