Commit graph

112 commits

Author SHA1 Message Date
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
5ae159de5b
Move to iNKORE.UI.WPF.Modern UI Framework (#3593) 2025-10-05 13:44:40 +03:00
Jack251970
7350c1d4d5 Use Flow.Launcher.Localization to improve code quality 2025-09-23 17:14:30 +08:00
DB P
c6ed0bdc2a Adjust window border style for blur themes and update border brush resource 2025-06-02 18:01:09 +09:00
Jack Ye
8bb96d7f58
Fix copy to clipboard STA thread issue & Support retry for copy & Async build-in shortcut model & Fix build shortcuts text replace issue & Fix startup window hide issue (#3314) 2025-05-02 14:26:14 +10:00
DB P
b2a3782f63
Merge branch 'dev' into 250412-ImportThemePreset 2025-04-14 09:09:04 +09:00
Jack251970
dde933a96b Use api functions instead 2025-04-13 17:26:21 +08:00
DB P
3d96a368ff Fix Preview CornerRadius (Get BasedOn Style) 2025-04-13 14:20:57 +09:00
DB P
2cf7f97a8b Add Import Function 2025-04-13 07:37:55 +09:00
Jack251970
dd210ad419 Remove RefreshFrameAsync since ChangeTheme calls this function 2025-04-08 16:41:06 +08:00
Jack Ye
a2d9957385
Log warning if cannot find matched theme
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-08 16:20:11 +08:00
Jack251970
ecd019dd6b Move ThemeData class to SharedModels 2025-04-08 15:56:54 +08:00
Jack251970
358b1fd7c8 Move theme data and functions into api 2025-04-04 20:10:39 +08:00
Jack251970
cd01260ee9 Fix typos 2025-03-29 16:41:11 +08:00
Jack Ye
356f229fd4
Update Flow.Launcher.Core/Resource/Theme.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-03-29 16:38:54 +08:00
Jack251970
91c5e84ca0 Integrate resize window to fixed window height 2025-03-29 15:27:25 +08:00
Jack251970
1a97a429b7 Support change resize boarder thinkness 2025-03-29 14:15:24 +08:00
Jack251970
d212e0eb6d Add code comments 2025-03-24 23:02:51 +08:00
Jack251970
2af033b316 Cleanup codes 2025-03-24 22:07:19 +08:00
DB p
2b67f5bc8d Avoid referencing _oldResource when it’s null 2025-03-24 19:08:54 +09:00
DB p
a078777608 - Fixed an issue where font settings were not applied when using the Blur theme
- Removed bold style from highlight and delegated it to individual themes
2025-03-24 18:10:12 +09:00
DB p
ec22f596d4 Fix Non Resource situation when change theme 2025-03-24 16:26:07 +09:00
Jack251970
95f151b196 Organize usings 2025-03-17 19:58:32 +08:00
Jack251970
da30e2e595 Improve code quality 2025-03-17 09:37:34 +08:00
Jack251970
0bcc187b5d Keep user settings when changing theme 2025-03-16 23:55:15 +08:00
Jack251970
9a6175e848 Remove useless position initialization & Remove useless dispatcher invoke 2025-03-16 16:44:36 +08:00
Jack251970
200c32b830 Code cleanup 2025-03-16 14:52:55 +08:00
Jack251970
7a854392fa Improve code quality 2025-03-16 14:43:53 +08:00
Jack251970
db37ab7373 Use PInvoke.DwmSetWindowAttribute instead of DllImport 2025-03-16 14:39:56 +08:00
Jack251970
e4ade45d83 Use PInvoke.DwmSetWindowAttribute instead of DllImport 2025-03-16 14:23:29 +08:00
Jack251970
07b0e7263f Code cleanup 2025-03-16 14:09:37 +08:00
DB p
0086a9e478 Add a condition to disable blur on unsupported Windows versions. 2025-03-16 12:55:47 +09:00
DB p
ce55303e9e - Fix Logic for dwmBG
- Remove Cornertypes in themes
2025-03-16 12:04:11 +09:00
DB p
d90b82a3ef Code Cleanup 2025-03-15 13:33:20 +09:00
DB p
4e15cb0f49 Comment cleanup 2025-03-15 13:26:38 +09:00
DB p
fd344a35b0 Fix Preview border 2025-03-14 19:07:33 +09:00
DB p
57d206ff7e Fix SystemBG color select 2025-03-14 17:43:51 +09:00
DB p
2cd769b1e9 Fix UI thread issue and preview 2025-03-14 10:00:31 +09:00
DB p
6c1730e79a Merge Dev 2025-03-13 14:45:34 +09:00
DB p
ec5d52e46d Fix Preview background 2025-03-13 13:50:09 +09:00
DB p
f4b074c617 Fix shadow effec tissue 2025-03-12 20:45:14 +09:00
Jack Ye
59fbef1d78 Use public current theme 2025-03-12 18:45:57 +08:00