Skip to content

Commit 832405a

Browse files
committed
- Adjust base.xaml to match original(1.8) size for classic themes
- Adjust Querybox Width - Add Width and height value for new themes - Merge #722
1 parent c1b0929 commit 832405a

File tree

9 files changed

+53
-32
lines changed

9 files changed

+53
-32
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,9 @@ private ResourceDictionary CurrentThemeResourceDictionary()
145145
public ResourceDictionary GetResourceDictionary()
146146
{
147147
var dict = CurrentThemeResourceDictionary();
148-
149-
Style queryBoxStyle = dict["QueryBoxStyle"] as Style;
150-
Style querySuggestionBoxStyle = dict["QuerySuggestionBoxStyle"] as Style;
151-
152-
if (queryBoxStyle != null && querySuggestionBoxStyle != null)
148+
149+
if (dict["QueryBoxStyle"] is Style queryBoxStyle &&
150+
dict["QuerySuggestionBoxStyle"] is Style querySuggestionBoxStyle)
153151
{
154152
var fontFamily = new FontFamily(Settings.QueryBoxFont);
155153
var fontStyle = FontHelper.GetFontStyleFromInvariantStringOrNormal(Settings.QueryBoxFontStyle);
@@ -174,22 +172,19 @@ public ResourceDictionary GetResourceDictionary()
174172
querySuggestionBoxStyle.Setters.Add(new Setter(TextBox.FontStretchProperty, fontStretch));
175173
}
176174

177-
Style resultItemStyle = dict["ItemTitleStyle"] as Style;
178-
Style resultSubItemStyle = dict["ItemSubTitleStyle"] as Style;
179-
Style resultHotkeyItemStyle = dict["ItemHotkeyStyle"] as Style;
180-
Style resultItemSelectedStyle = dict["ItemTitleSelectedStyle"] as Style;
181-
Style resultSubItemSelectedStyle = dict["ItemSubTitleSelectedStyle"] as Style;
182-
Style resultHotkeyItemSelectedStyle = dict["ItemHotkeySelectedStyle"] as Style;
183-
184-
if (resultItemStyle != null && resultSubItemStyle != null && resultSubItemSelectedStyle != null && resultItemSelectedStyle != null)
175+
if (dict["ItemTitleStyle"] is Style resultItemStyle &&
176+
dict["ItemSubTitleStyle"] is Style resultSubItemStyle &&
177+
dict["ItemSubTitleSelectedStyle"] is Style resultSubItemSelectedStyle &&
178+
dict["ItemTitleSelectedStyle"] is Style resultItemSelectedStyle &&
179+
dict["ItemHotkeySelectedStyle"] is Style resultHotkeyItemSelectedStyle)
185180
{
186181
Setter fontFamily = new Setter(TextBlock.FontFamilyProperty, new FontFamily(Settings.ResultFont));
187182
Setter fontStyle = new Setter(TextBlock.FontStyleProperty, FontHelper.GetFontStyleFromInvariantStringOrNormal(Settings.ResultFontStyle));
188183
Setter fontWeight = new Setter(TextBlock.FontWeightProperty, FontHelper.GetFontWeightFromInvariantStringOrNormal(Settings.ResultFontWeight));
189184
Setter fontStretch = new Setter(TextBlock.FontStretchProperty, FontHelper.GetFontStretchFromInvariantStringOrNormal(Settings.ResultFontStretch));
190185

191186
Setter[] setters = { fontFamily, fontStyle, fontWeight, fontStretch };
192-
Array.ForEach(new[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle, resultHotkeyItemStyle, resultHotkeyItemSelectedStyle }, o => Array.ForEach(setters, p => o.Setters.Add(p)));
187+
Array.ForEach(new[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle, resultHotkeyItemSelectedStyle }, o => Array.ForEach(setters, p => o.Setters.Add(p)));
193188
}
194189

195190
var windowStyle = dict["WindowStyle"] as Style;
@@ -239,17 +234,19 @@ private string GetThemePath(string themeName)
239234

240235
public void AddDropShadowEffectToCurrentTheme()
241236
{
242-
var dict = CurrentThemeResourceDictionary();
237+
var dict = GetResourceDictionary();
243238

244239
var windowBorderStyle = dict["WindowBorderStyle"] as Style;
245240

246-
var effectSetter = new Setter();
247-
effectSetter.Property = Border.EffectProperty;
248-
effectSetter.Value = new DropShadowEffect
241+
var effectSetter = new Setter
249242
{
250-
Opacity = 0.4,
251-
ShadowDepth = 2,
252-
BlurRadius = 15
243+
Property = Border.EffectProperty,
244+
Value = new DropShadowEffect
245+
{
246+
Opacity = 0.9,
247+
ShadowDepth = 2,
248+
BlurRadius = 15
249+
}
253250
};
254251

255252
var marginSetter = windowBorderStyle.Setters.FirstOrDefault(setterBase => setterBase is Setter setter && setter.Property == Border.MarginProperty) as Setter;

Flow.Launcher/Themes/Base.xaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<Setter Property="BorderThickness" Value="0" />
88
<Setter Property="FontSize" Value="28" />
99
<Setter Property="FontWeight" Value="Regular" />
10-
<Setter Property="Height" Value="40" />
1110
<Setter Property="Margin" Value="16 7 0 7" />
1211
<Setter Property="Padding" Value="0 4 0 0" />
1312
<Setter Property="Background" Value="#2F2F2F" />
14-
<Setter Property="Width" Value="470" />
13+
<Setter Property="Width" Value="664" />
14+
<Setter Property="Height" Value="48" />
1515
<Setter Property="Foreground" Value="#E3E0E3" />
1616
<Setter Property="CaretBrush" Value="#E3E0E3" />
1717
<Setter Property="VerticalContentAlignment" Value="Center" />
@@ -40,9 +40,9 @@
4040
<!-- Further font customisations are dynamically loaded in Theme.cs -->
4141
<Style x:Key="BaseQuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
4242
<Setter Property="Foreground" Value="DarkGray" />
43-
<Setter Property="Height" Value="40" />
43+
<Setter Property="Height" Value="48" />
4444
<Setter Property="Margin" Value="16 7 0 7" />
45-
<Setter Property="Width" Value="470" />
45+
<Setter Property="Width" Value="664" />
4646
<Setter Property="Background" Value="Transparent" />
4747
<Setter Property="Padding" Value="0 4 0 0" />
4848
<Setter Property="HorizontalAlignment" Value="Left" />
@@ -56,7 +56,7 @@
5656
<Setter Property="CornerRadius" Value="5" />
5757
</Style>
5858
<Style x:Key="BaseWindowStyle" TargetType="{x:Type Window}">
59-
<Setter Property="Width" Value="576" />
59+
<Setter Property="Width" Value="750" />
6060
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
6161
</Style>
6262

Flow.Launcher/Themes/Discord Dark.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010
<Setter Property="Background" Value="#36393f" />
1111
<Setter Property="CaretBrush" Value="#ffffff" />
1212
<Setter Property="SelectionBrush" Value="#0a68d8"/>
13+
<Setter Property="Width" Value="490" />
14+
<Setter Property="Height" Value="42" />
1315
<Setter Property="FontSize" Value="24" />
1416
</Style>
1517
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
1618
<Setter Property="Foreground" Value="#72767d" />
1719
<Setter Property="Background" Value="#36393f" />
20+
<Setter Property="Width" Value="490" />
21+
<Setter Property="Height" Value="42" />
1822
<Setter Property="FontSize" Value="24" />
1923
</Style>
2024
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
@@ -24,7 +28,7 @@
2428
<Setter Property="Background" Value="#36393f" />
2529
</Style>
2630
<Style x:Key="WindowStyle" BasedOn="{StaticResource BaseWindowStyle}" TargetType="{x:Type Window}">
27-
<Setter Property="Width" Value="596" />
31+
<Setter Property="Width" Value="576" />
2832

2933
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
3034
</Style>

Flow.Launcher/Themes/League.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66
<Setter Property="Background" Value="#161614"/>
77
<Setter Property="Foreground" Value="#b88f3a" />
88
<Setter Property="CaretBrush" Value="#b88f3a" />
9+
<Setter Property="Width" Value="490" />
10+
<Setter Property="Height" Value="42" />
911
</Style>
1012

1113
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
1214
<Setter Property="Background" Value="#161614"/>
1315
<Setter Property="Foreground" Value="#a09b8c" />
16+
<Setter Property="Width" Value="490" />
17+
<Setter Property="Height" Value="42" />
1418
</Style>
1519

1620
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
@@ -20,6 +24,7 @@
2024
<Setter Property="Background" Value="#161614"></Setter>
2125
</Style>
2226
<Style x:Key="WindowStyle" TargetType="{x:Type Window}" BasedOn="{StaticResource BaseWindowStyle}" >
27+
<Setter Property="Width" Value="576" />
2328
</Style>
2429
<Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}" ></Style>
2530
<Style x:Key="ItemTitleStyle" BasedOn="{StaticResource BaseItemTitleStyle}" TargetType="{x:Type TextBlock}" >

Flow.Launcher/Themes/Pink.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
1818
<Setter Property="Background" Value="#1f1d1f"></Setter>
19-
<Setter Property="Width" Value="576" />
2019
<Setter Property="BorderThickness" Value="2"></Setter>
2120
<Setter Property="BorderBrush" Value="#000000"></Setter>
2221
</Style>

Flow.Launcher/Themes/Sublime.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@
1111
<Setter Property="Foreground" Value="#d2d8e5" />
1212
<Setter Property="CaretBrush" Value="#FFAA47" />
1313
<Setter Property="FontSize" Value="26" />
14+
<Setter Property="Width" Value="490" />
15+
<Setter Property="Height" Value="42" />
1416
<Setter Property="Padding" Value="0 4 0 0" />
15-
</Style>
17+
</Style>
1618
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
1719
<Setter Property="Background" Value="#303840" />
1820
<Setter Property="Foreground" Value="#798189" />
1921
<Setter Property="FontSize" Value="26" />
22+
<Setter Property="Width" Value="490" />
23+
<Setter Property="Height" Value="42" />
2024
<Setter Property="Padding" Value="0 4 0 0" />
2125
</Style>
2226
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">

Flow.Launcher/Themes/Win10Light.xaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@
1313
<Setter Property="CaretBrush" Value="#000000" />
1414
<Setter Property="BorderBrush" Value="Black"/>
1515
<Setter Property="BorderThickness" Value="0"/>
16-
<Setter Property="FontSize" Value="26" />
16+
<Setter Property="FontSize" Value="28" />
17+
<Setter Property="Width" Value="490" />
18+
<Setter Property="Height" Value="42" />
1719
<Setter Property="Padding" Value="0 4 0 0" />
1820
</Style>
1921
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
2022
<Setter Property="Background" Value="#dddddd" />
2123
<Setter Property="Foreground" Value="#c6c6c6" />
22-
<Setter Property="FontSize" Value="26" />
24+
<Setter Property="FontSize" Value="28" />
2325
<Setter Property="Padding" Value="0 4 0 0" />
26+
<Setter Property="Width" Value="490" />
27+
<Setter Property="Height" Value="42" />
2428
</Style>
2529
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
2630
<Setter Property="BorderThickness" Value="1" />

Flow.Launcher/Themes/Win11Dark.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@
1313
<Setter Property="CaretBrush" Value="#FFFFFF" />
1414
<Setter Property="FontSize" Value="26" />
1515
<Setter Property="Padding" Value="0 4 0 0" />
16+
<Setter Property="Width" Value="490" />
17+
<Setter Property="Height" Value="42" />
1618
</Style>
1719
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
1820
<Setter Property="Background" Value="#202020" />
1921
<Setter Property="Foreground" Value="#7b7b7b" />
2022
<Setter Property="FontSize" Value="26" />
2123
<Setter Property="Padding" Value="0 4 0 0" />
24+
<Setter Property="Width" Value="490" />
25+
<Setter Property="Height" Value="42" />
2226
</Style>
2327
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
2428
<Setter Property="BorderThickness" Value="1" />

Flow.Launcher/Themes/Win11Light.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@
1313
<Setter Property="CaretBrush" Value="#000000" />
1414
<Setter Property="FontSize" Value="26" />
1515
<Setter Property="Padding" Value="0 4 0 0" />
16-
</Style>
16+
<Setter Property="Width" Value="490" />
17+
<Setter Property="Height" Value="42" />
18+
</Style>
1719
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
1820
<Setter Property="Background" Value="#f3f3f3" />
1921
<Setter Property="Foreground" Value="#b5b5b5" />
2022
<Setter Property="FontSize" Value="26" />
2123
<Setter Property="Padding" Value="0 4 0 0" />
24+
<Setter Property="Width" Value="490" />
25+
<Setter Property="Height" Value="42" />
2226
</Style>
2327
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
2428
<Setter Property="BorderThickness" Value="1" />

0 commit comments

Comments
 (0)