Skip to content

Commit d212e0e

Browse files
committed
Add code comments
1 parent 2af033b commit d212e0e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,15 @@ public void UpdateFonts()
124124
{
125125
try
126126
{
127-
// Loads a ResourceDictionary for the specified theme.
127+
// Load a ResourceDictionary for the specified theme.
128128
var themeName = GetCurrentTheme();
129129
var dict = GetThemeResourceDictionary(themeName);
130130

131-
// Applies font settings to the theme resource.
131+
// Apply font settings to the theme resource.
132132
ApplyFontSettings(dict);
133133
UpdateResourceDictionary(dict);
134+
135+
// Must apply blur and drop shadow effects
134136
_ = RefreshFrameAsync();
135137
}
136138
catch (Exception e)
@@ -405,7 +407,7 @@ public bool ChangeTheme(string theme = null)
405407
try
406408
{
407409
if (string.IsNullOrEmpty(path))
408-
throw new DirectoryNotFoundException("Theme path can't be found <{path}>");
410+
throw new DirectoryNotFoundException($"Theme path can't be found <{path}>");
409411

410412
// Retrieve theme resource – always use the resource with font settings applied.
411413
var resourceDict = GetResourceDictionary(theme);
@@ -422,9 +424,9 @@ public bool ChangeTheme(string theme = null)
422424

423425
BlurEnabled = IsBlurTheme();
424426

425-
// Apply blur and drop shadow effects
427+
// Can only apply blur but here also apply drop shadow effect to avoid possible drop shadow effect issues
426428
_ = RefreshFrameAsync();
427-
429+
428430
return true;
429431
}
430432
catch (DirectoryNotFoundException)

Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ public BackdropTypes BackdropType
229229

230230
Settings.BackdropType = value;
231231

232+
// Can only apply blur because drop shadow effect is not supported with backdrop
233+
// So drop shadow effect has been disabled
232234
_ = _theme.SetBlurForWindowAsync();
233235

234236
OnPropertyChanged(nameof(IsDropShadowEnabled));

0 commit comments

Comments
 (0)