Skip to content

Commit 8a9c338

Browse files
authored
Merge pull request #112 from Flow-Launcher/dev
Release 1.1.2
2 parents 5f23f3d + fd56af7 commit 8a9c338

File tree

13 files changed

+105
-14
lines changed

13 files changed

+105
-14
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,31 @@ public ResourceDictionary GetResourceDictionary()
137137
var dict = CurrentThemeResourceDictionary();
138138

139139
Style queryBoxStyle = dict["QueryBoxStyle"] as Style;
140-
if (queryBoxStyle != null)
140+
Style querySuggestionBoxStyle = dict["QuerySuggestionBoxStyle"] as Style;
141+
142+
if (queryBoxStyle != null && querySuggestionBoxStyle != null)
141143
{
142-
queryBoxStyle.Setters.Add(new Setter(TextBox.FontFamilyProperty, new FontFamily(Settings.QueryBoxFont)));
143-
queryBoxStyle.Setters.Add(new Setter(TextBox.FontStyleProperty, FontHelper.GetFontStyleFromInvariantStringOrNormal(Settings.QueryBoxFontStyle)));
144-
queryBoxStyle.Setters.Add(new Setter(TextBox.FontWeightProperty, FontHelper.GetFontWeightFromInvariantStringOrNormal(Settings.QueryBoxFontWeight)));
145-
queryBoxStyle.Setters.Add(new Setter(TextBox.FontStretchProperty, FontHelper.GetFontStretchFromInvariantStringOrNormal(Settings.QueryBoxFontStretch)));
144+
var fontFamily = new FontFamily(Settings.QueryBoxFont);
145+
var fontStyle = FontHelper.GetFontStyleFromInvariantStringOrNormal(Settings.QueryBoxFontStyle);
146+
var fontWeight = FontHelper.GetFontWeightFromInvariantStringOrNormal(Settings.QueryBoxFontWeight);
147+
var fontStretch = FontHelper.GetFontStretchFromInvariantStringOrNormal(Settings.QueryBoxFontStretch);
148+
149+
queryBoxStyle.Setters.Add(new Setter(TextBox.FontFamilyProperty, fontFamily));
150+
queryBoxStyle.Setters.Add(new Setter(TextBox.FontStyleProperty, fontStyle));
151+
queryBoxStyle.Setters.Add(new Setter(TextBox.FontWeightProperty, fontWeight));
152+
queryBoxStyle.Setters.Add(new Setter(TextBox.FontStretchProperty, fontStretch));
146153

147154
var caretBrushPropertyValue = queryBoxStyle.Setters.OfType<Setter>().Any(x => x.Property.Name == "CaretBrush");
148155
var foregroundPropertyValue = queryBoxStyle.Setters.OfType<Setter>().Where(x => x.Property.Name == "Foreground")
149156
.Select(x => x.Value).FirstOrDefault();
150157
if (!caretBrushPropertyValue && foregroundPropertyValue != null) //otherwise BaseQueryBoxStyle will handle styling
151158
queryBoxStyle.Setters.Add(new Setter(TextBox.CaretBrushProperty, foregroundPropertyValue));
159+
160+
// Query suggestion box's font style is aligned with query box
161+
querySuggestionBoxStyle.Setters.Add(new Setter(TextBox.FontFamilyProperty, fontFamily));
162+
querySuggestionBoxStyle.Setters.Add(new Setter(TextBox.FontStyleProperty, fontStyle));
163+
querySuggestionBoxStyle.Setters.Add(new Setter(TextBox.FontWeightProperty, fontWeight));
164+
querySuggestionBoxStyle.Setters.Add(new Setter(TextBox.FontStretchProperty, fontStretch));
152165
}
153166

154167
Style resultItemStyle = dict["ItemTitleStyle"] as Style;

Flow.Launcher/MainWindow.xaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@
6464
<StackPanel Orientation="Vertical">
6565
<Grid>
6666
<TextBox x:Name="QueryTextSuggestionBox"
67-
Style="{DynamicResource QueryBoxStyle}"
68-
Foreground="DarkGray"
67+
Style="{DynamicResource QuerySuggestionBoxStyle}"
6968
IsEnabled="False"
7069
Margin="18,0,56,0">
7170
<TextBox.Text>

Flow.Launcher/Themes/Base.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:system="clr-namespace:System;assembly=mscorlib">
4+
5+
<!-- Further font customisations are dynamically loaded in Theme.cs -->
46
<Style x:Key="BaseQueryBoxStyle" TargetType="{x:Type TextBox}">
57
<Setter Property="BorderThickness" Value="0" />
68
<Setter Property="FontSize" Value="28" />
@@ -30,6 +32,13 @@
3032
</Setter.Value>
3133
</Setter>
3234
</Style>
35+
36+
<!-- Further font customisations are dynamically loaded in Theme.cs -->
37+
<Style x:Key="BaseQuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
38+
<Setter Property="Foreground" Value="DarkGray" />
39+
<Setter Property="Background" Value="Transparent" />
40+
</Style>
41+
3342
<Style x:Key="BaseWindowBorderStyle" TargetType="{x:Type Border}">
3443
<Setter Property="BorderThickness" Value="0" />
3544
<Setter Property="CornerRadius" Value="0" />
Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,34 @@
1-
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Base.xaml"></ResourceDictionary> </ResourceDictionary.MergedDictionaries> <Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}"> <Setter Property="Background" Value="#000000"/> <Setter Property="Foreground" Value="#ffffff" /> </Style> <Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}"> <Setter Property="Background" Value="#000000"></Setter> </Style> <Style x:Key="WindowStyle" TargetType="{x:Type Window}" BasedOn="{StaticResource BaseWindowStyle}" > </Style> <Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}" > </Style> <Style x:Key="ItemTitleStyle" BasedOn="{StaticResource BaseItemTitleStyle}" TargetType="{x:Type TextBlock}" > <Setter Property="Foreground" Value="#FFFFF8"></Setter> </Style> <Style x:Key="ItemSubTitleStyle" BasedOn="{StaticResource BaseItemSubTitleStyle}" TargetType="{x:Type TextBlock}" > <Setter Property="Foreground" Value="#D9D9D4"></Setter> </Style> <Style x:Key="ItemTitleSelectedStyle" BasedOn="{StaticResource BaseItemTitleSelectedStyle}" TargetType="{x:Type TextBlock}"> <Setter Property="Foreground" Value="#FFFFF8" /> </Style> <Style x:Key="ItemSubTitleSelectedStyle" BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}" TargetType="{x:Type TextBlock}"> <Setter Property="Foreground" Value="#D9D9D4" /> </Style> <SolidColorBrush x:Key="ItemSelectedBackgroundColor">#4F6180</SolidColorBrush> <Style x:Key="ThumbStyle" BasedOn="{StaticResource BaseThumbStyle}" TargetType="{x:Type Thumb}"> </Style> <Style x:Key="ScrollBarStyle" BasedOn="{StaticResource BaseScrollBarStyle}" TargetType="{x:Type ScrollBar}"> </Style> </ResourceDictionary>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3+
<ResourceDictionary.MergedDictionaries>
4+
<ResourceDictionary Source="Base.xaml" />
5+
</ResourceDictionary.MergedDictionaries>
6+
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
7+
<Setter Property="Background" Value="#000000" />
8+
<Setter Property="Foreground" Value="#ffffff" />
9+
</Style>
10+
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
11+
<Setter Property="Background" Value="#000000" />
12+
<Setter Property="Foreground" Value="#ffffff" />
13+
</Style>
14+
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
15+
<Setter Property="Background" Value="#000000" />
16+
</Style>
17+
<Style x:Key="WindowStyle" TargetType="{x:Type Window}" BasedOn="{StaticResource BaseWindowStyle}" />
18+
<Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}" />
19+
<Style x:Key="ItemTitleStyle" BasedOn="{StaticResource BaseItemTitleStyle}" TargetType="{x:Type TextBlock}">
20+
<Setter Property="Foreground" Value="#FFFFF8" />
21+
</Style>
22+
<Style x:Key="ItemSubTitleStyle" BasedOn="{StaticResource BaseItemSubTitleStyle}" TargetType="{x:Type TextBlock}">
23+
<Setter Property="Foreground" Value="#D9D9D4" />
24+
</Style>
25+
<Style x:Key="ItemTitleSelectedStyle" BasedOn="{StaticResource BaseItemTitleSelectedStyle}" TargetType="{x:Type TextBlock}">
26+
<Setter Property="Foreground" Value="#FFFFF8" />
27+
</Style>
28+
<Style x:Key="ItemSubTitleSelectedStyle" BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}" TargetType="{x:Type TextBlock}">
29+
<Setter Property="Foreground" Value="#D9D9D4" />
30+
</Style>
31+
<SolidColorBrush x:Key="ItemSelectedBackgroundColor">#4F6180</SolidColorBrush>
32+
<Style x:Key="ThumbStyle" BasedOn="{StaticResource BaseThumbStyle}" TargetType="{x:Type Thumb}" />
33+
<Style x:Key="ScrollBarStyle" BasedOn="{StaticResource BaseScrollBarStyle}" TargetType="{x:Type ScrollBar}" />
34+
</ResourceDictionary>

Flow.Launcher/Themes/BlurBlack.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99

1010
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
1111
<Setter Property="Foreground" Value="#FFFFFFFF" />
12-
<Setter Property="Background" Value="#01000001" />
12+
<Setter Property="Background" Value="Transparent" />
13+
</Style>
14+
15+
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
16+
<Setter Property="Foreground" Value="LightGray" />
1317
</Style>
1418

1519
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">

Flow.Launcher/Themes/BlurWhite.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
<Setter Property="Background" Value="#01FFFFFF" />
1313
</Style>
1414

15+
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
16+
<Setter Property="Foreground" Value="#FF000000" />
17+
<Setter Property="Background" Value="#01FFFFFF" />
18+
</Style>
19+
1520
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
1621
<Setter Property="Background">
1722
<Setter.Value>

Flow.Launcher/Themes/Darker.xaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
99
<Setter Property="SelectionBrush" Value="#4D4D4D"/>
1010
</Style>
11-
11+
12+
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}"/>
13+
14+
1215
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
1316
</Style>
1417

Flow.Launcher/Themes/Gray.xaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
<Setter Property="Foreground" Value="#222222" />
99
<Setter Property="FontSize" Value="38" />
1010
</Style>
11+
12+
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
13+
<Setter Property="Background" Value="#EDEDED" />
14+
<Setter Property="Foreground" Value="#222222" />
15+
<Setter Property="FontSize" Value="38" />
16+
</Style>
17+
1118
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
1219
<Setter Property="BorderBrush" Value="#B0B0B0" />
1320
<Setter Property="BorderThickness" Value="1" />

Flow.Launcher/Themes/Light.xaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
<Setter Property="Background" Value="#EBEBEB"/>
1010
<Setter Property="Foreground" Value="#000000" />
1111
</Style>
12+
13+
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
14+
<Setter Property="Background" Value="#EBEBEB"/>
15+
<Setter Property="Foreground" Value="#000000" />
16+
</Style>
17+
1218
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
1319
<Setter Property="BorderBrush" Value="#AAAAAA" />
1420
<Setter Property="BorderThickness" Value="5" />

Flow.Launcher/Themes/Metro Server.xaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
<Setter Property="Background" Value="#ffffff"/>
77
<Setter Property="Foreground" Value="#000000" />
88
</Style>
9+
10+
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
11+
<Setter Property="Background" Value="#ffffff"/>
12+
<Setter Property="Foreground" Value="#000000" />
13+
</Style>
14+
915
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
1016
<Setter Property="Background" Value="#001e4e"></Setter>
1117
</Style>

0 commit comments

Comments
 (0)