@@ -76,7 +76,7 @@ public Theme(IPublicAPI publicAPI, Settings settings)
76
76
{
77
77
_api . LogError ( ClassName , "Current theme resource not found. Initializing with default theme." ) ;
78
78
_oldTheme = Constant . DefaultTheme ;
79
- } ;
79
+ }
80
80
}
81
81
82
82
#endregion
@@ -126,7 +126,7 @@ public void UpdateFonts()
126
126
// Load a ResourceDictionary for the specified theme.
127
127
var themeName = _settings . Theme ;
128
128
var dict = GetThemeResourceDictionary ( themeName ) ;
129
-
129
+
130
130
// Apply font settings to the theme resource.
131
131
ApplyFontSettings ( dict ) ;
132
132
UpdateResourceDictionary ( dict ) ;
@@ -152,11 +152,11 @@ private void ApplyFontSettings(ResourceDictionary dict)
152
152
var fontStyle = FontHelper . GetFontStyleFromInvariantStringOrNormal ( _settings . QueryBoxFontStyle ) ;
153
153
var fontWeight = FontHelper . GetFontWeightFromInvariantStringOrNormal ( _settings . QueryBoxFontWeight ) ;
154
154
var fontStretch = FontHelper . GetFontStretchFromInvariantStringOrNormal ( _settings . QueryBoxFontStretch ) ;
155
-
155
+
156
156
SetFontProperties ( queryBoxStyle , fontFamily , fontStyle , fontWeight , fontStretch , true ) ;
157
157
SetFontProperties ( querySuggestionBoxStyle , fontFamily , fontStyle , fontWeight , fontStretch , false ) ;
158
158
}
159
-
159
+
160
160
if ( dict [ "ItemTitleStyle" ] is Style resultItemStyle &&
161
161
dict [ "ItemTitleSelectedStyle" ] is Style resultItemSelectedStyle &&
162
162
dict [ "ItemHotkeyStyle" ] is Style resultHotkeyItemStyle &&
@@ -172,7 +172,7 @@ private void ApplyFontSettings(ResourceDictionary dict)
172
172
SetFontProperties ( resultHotkeyItemStyle , fontFamily , fontStyle , fontWeight , fontStretch , false ) ;
173
173
SetFontProperties ( resultHotkeyItemSelectedStyle , fontFamily , fontStyle , fontWeight , fontStretch , false ) ;
174
174
}
175
-
175
+
176
176
if ( dict [ "ItemSubTitleStyle" ] is Style resultSubItemStyle &&
177
177
dict [ "ItemSubTitleSelectedStyle" ] is Style resultSubItemSelectedStyle )
178
178
{
@@ -197,7 +197,7 @@ private static void SetFontProperties(Style style, FontFamily fontFamily, FontSt
197
197
// First, find the setters to remove and store them in a list
198
198
var settersToRemove = style . Setters
199
199
. OfType < Setter > ( )
200
- . Where ( setter =>
200
+ . Where ( setter =>
201
201
setter . Property == Control . FontFamilyProperty ||
202
202
setter . Property == Control . FontStyleProperty ||
203
203
setter . Property == Control . FontWeightProperty ||
@@ -227,18 +227,18 @@ private static void SetFontProperties(Style style, FontFamily fontFamily, FontSt
227
227
{
228
228
var settersToRemove = style . Setters
229
229
. OfType < Setter > ( )
230
- . Where ( setter =>
230
+ . Where ( setter =>
231
231
setter . Property == TextBlock . FontFamilyProperty ||
232
232
setter . Property == TextBlock . FontStyleProperty ||
233
233
setter . Property == TextBlock . FontWeightProperty ||
234
234
setter . Property == TextBlock . FontStretchProperty )
235
235
. ToList ( ) ;
236
-
236
+
237
237
foreach ( var setter in settersToRemove )
238
238
{
239
239
style . Setters . Remove ( setter ) ;
240
240
}
241
-
241
+
242
242
style . Setters . Add ( new Setter ( TextBlock . FontFamilyProperty , fontFamily ) ) ;
243
243
style . Setters . Add ( new Setter ( TextBlock . FontStyleProperty , fontStyle ) ) ;
244
244
style . Setters . Add ( new Setter ( TextBlock . FontWeightProperty , fontWeight ) ) ;
@@ -421,7 +421,7 @@ public bool ChangeTheme(string theme = null)
421
421
422
422
// Retrieve theme resource – always use the resource with font settings applied.
423
423
var resourceDict = GetResourceDictionary ( theme ) ;
424
-
424
+
425
425
UpdateResourceDictionary ( resourceDict ) ;
426
426
427
427
_settings . Theme = theme ;
0 commit comments