Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions Flow.Launcher.Core/Resource/Theme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,31 @@ public ResourceDictionary GetResourceDictionary()
var dict = CurrentThemeResourceDictionary();

Style queryBoxStyle = dict["QueryBoxStyle"] as Style;
if (queryBoxStyle != null)
Style querySuggestionBoxStyle = dict["QuerySuggestionBoxStyle"] as Style;

if (queryBoxStyle != null && querySuggestionBoxStyle != null)
{
queryBoxStyle.Setters.Add(new Setter(TextBox.FontFamilyProperty, new FontFamily(Settings.QueryBoxFont)));
queryBoxStyle.Setters.Add(new Setter(TextBox.FontStyleProperty, FontHelper.GetFontStyleFromInvariantStringOrNormal(Settings.QueryBoxFontStyle)));
queryBoxStyle.Setters.Add(new Setter(TextBox.FontWeightProperty, FontHelper.GetFontWeightFromInvariantStringOrNormal(Settings.QueryBoxFontWeight)));
queryBoxStyle.Setters.Add(new Setter(TextBox.FontStretchProperty, FontHelper.GetFontStretchFromInvariantStringOrNormal(Settings.QueryBoxFontStretch)));
var fontFamily = new FontFamily(Settings.QueryBoxFont);
var fontStyle = FontHelper.GetFontStyleFromInvariantStringOrNormal(Settings.QueryBoxFontStyle);
var fontWeight = FontHelper.GetFontWeightFromInvariantStringOrNormal(Settings.QueryBoxFontWeight);
var fontStretch = FontHelper.GetFontStretchFromInvariantStringOrNormal(Settings.QueryBoxFontStretch);

queryBoxStyle.Setters.Add(new Setter(TextBox.FontFamilyProperty, fontFamily));
queryBoxStyle.Setters.Add(new Setter(TextBox.FontStyleProperty, fontStyle));
queryBoxStyle.Setters.Add(new Setter(TextBox.FontWeightProperty, fontWeight));
queryBoxStyle.Setters.Add(new Setter(TextBox.FontStretchProperty, fontStretch));

var caretBrushPropertyValue = queryBoxStyle.Setters.OfType<Setter>().Any(x => x.Property.Name == "CaretBrush");
var foregroundPropertyValue = queryBoxStyle.Setters.OfType<Setter>().Where(x => x.Property.Name == "Foreground")
.Select(x => x.Value).FirstOrDefault();
if (!caretBrushPropertyValue && foregroundPropertyValue != null) //otherwise BaseQueryBoxStyle will handle styling
queryBoxStyle.Setters.Add(new Setter(TextBox.CaretBrushProperty, foregroundPropertyValue));

// Query suggestion box's font style is aligned with query box
querySuggestionBoxStyle.Setters.Add(new Setter(TextBox.FontFamilyProperty, fontFamily));
querySuggestionBoxStyle.Setters.Add(new Setter(TextBox.FontStyleProperty, fontStyle));
querySuggestionBoxStyle.Setters.Add(new Setter(TextBox.FontWeightProperty, fontWeight));
querySuggestionBoxStyle.Setters.Add(new Setter(TextBox.FontStretchProperty, fontStretch));
}

Style resultItemStyle = dict["ItemTitleStyle"] as Style;
Expand Down
3 changes: 1 addition & 2 deletions Flow.Launcher/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@
<StackPanel Orientation="Vertical">
<Grid>
<TextBox x:Name="QueryTextSuggestionBox"
Style="{DynamicResource QueryBoxStyle}"
Foreground="DarkGray"
Style="{DynamicResource QuerySuggestionBoxStyle}"
IsEnabled="False"
Margin="18,0,56,0">
<TextBox.Text>
Expand Down
9 changes: 9 additions & 0 deletions Flow.Launcher/Themes/Base.xaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<!-- Further font customisations are dynamically loaded in Theme.cs -->
<Style x:Key="BaseQueryBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="FontSize" Value="28" />
Expand Down Expand Up @@ -30,6 +32,13 @@
</Setter.Value>
</Setter>
</Style>

<!-- Further font customisations are dynamically loaded in Theme.cs -->
<Style x:Key="BaseQuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="DarkGray" />
<Setter Property="Background" Value="Transparent" />
</Style>

<Style x:Key="BaseWindowBorderStyle" TargetType="{x:Type Border}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="CornerRadius" Value="0" />
Expand Down
35 changes: 34 additions & 1 deletion Flow.Launcher/Themes/BlackAndWhite.xaml
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
<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>
<?xml version="1.0" encoding="UTF-8"?>
<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.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="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" 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" />
</Style>
<Style x:Key="WindowStyle" TargetType="{x:Type Window}" BasedOn="{StaticResource BaseWindowStyle}" />
<Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}" />
<Style x:Key="ItemTitleStyle" BasedOn="{StaticResource BaseItemTitleStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#FFFFF8" />
</Style>
<Style x:Key="ItemSubTitleStyle" BasedOn="{StaticResource BaseItemSubTitleStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#D9D9D4" />
</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 x:Key="ScrollBarStyle" BasedOn="{StaticResource BaseScrollBarStyle}" TargetType="{x:Type ScrollBar}" />
</ResourceDictionary>
6 changes: 5 additions & 1 deletion Flow.Launcher/Themes/BlurBlack.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FFFFFFFF" />
<Setter Property="Background" Value="#01000001" />
<Setter Property="Background" Value="Transparent" />
</Style>

<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="LightGray" />
</Style>

<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
Expand Down
5 changes: 5 additions & 0 deletions Flow.Launcher/Themes/BlurWhite.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<Setter Property="Background" Value="#01FFFFFF" />
</Style>

<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FF000000" />
<Setter Property="Background" Value="#01FFFFFF" />
</Style>

<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
<Setter Property="Background">
<Setter.Value>
Expand Down
5 changes: 4 additions & 1 deletion Flow.Launcher/Themes/Darker.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="SelectionBrush" Value="#4D4D4D"/>
</Style>


<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}"/>


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

Expand Down
7 changes: 7 additions & 0 deletions Flow.Launcher/Themes/Gray.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
<Setter Property="Foreground" Value="#222222" />
<Setter Property="FontSize" Value="38" />
</Style>

<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#EDEDED" />
<Setter Property="Foreground" Value="#222222" />
<Setter Property="FontSize" Value="38" />
</Style>

<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="#B0B0B0" />
<Setter Property="BorderThickness" Value="1" />
Expand Down
6 changes: 6 additions & 0 deletions Flow.Launcher/Themes/Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
<Setter Property="Background" Value="#EBEBEB"/>
<Setter Property="Foreground" Value="#000000" />
</Style>

<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#EBEBEB"/>
<Setter Property="Foreground" Value="#000000" />
</Style>

<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="#AAAAAA" />
<Setter Property="BorderThickness" Value="5" />
Expand Down
6 changes: 6 additions & 0 deletions Flow.Launcher/Themes/Metro Server.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
<Setter Property="Background" Value="#ffffff"/>
<Setter Property="Foreground" Value="#000000" />
</Style>

<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#ffffff"/>
<Setter Property="Foreground" Value="#000000" />
</Style>

<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
<Setter Property="Background" Value="#001e4e"></Setter>
</Style>
Expand Down
6 changes: 6 additions & 0 deletions Flow.Launcher/Themes/Pink.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
<Setter Property="Background" Value="#1f1d1f"/>
<Setter Property="Foreground" Value="#cc1081" />
</Style>

<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#1f1d1f"/>
<Setter Property="Foreground" Value="#cc1081" />
</Style>

<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
<Setter Property="Background" Value="#1f1d1f"></Setter>
</Style>
Expand Down
6 changes: 3 additions & 3 deletions SolutionAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.1.1")]
[assembly: AssemblyFileVersion("1.1.1")]
[assembly: AssemblyInformationalVersion("1.1.1")]
[assembly: AssemblyVersion("1.1.2")]
[assembly: AssemblyFileVersion("1.1.2")]
[assembly: AssemblyInformationalVersion("1.1.2")]
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '1.1.1.{build}'
version: '1.1.2.{build}'

init:
- ps: |
Expand Down