mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
- 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
This commit is contained in:
parent
c1b0929ed5
commit
1c96f04965
10 changed files with 56 additions and 35 deletions
|
|
@ -145,11 +145,9 @@ namespace Flow.Launcher.Core.Resource
|
|||
public ResourceDictionary GetResourceDictionary()
|
||||
{
|
||||
var dict = CurrentThemeResourceDictionary();
|
||||
|
||||
Style queryBoxStyle = dict["QueryBoxStyle"] as Style;
|
||||
Style querySuggestionBoxStyle = dict["QuerySuggestionBoxStyle"] as Style;
|
||||
|
||||
if (queryBoxStyle != null && querySuggestionBoxStyle != null)
|
||||
|
||||
if (dict["QueryBoxStyle"] is Style queryBoxStyle &&
|
||||
dict["QuerySuggestionBoxStyle"] is Style querySuggestionBoxStyle)
|
||||
{
|
||||
var fontFamily = new FontFamily(Settings.QueryBoxFont);
|
||||
var fontStyle = FontHelper.GetFontStyleFromInvariantStringOrNormal(Settings.QueryBoxFontStyle);
|
||||
|
|
@ -174,14 +172,11 @@ namespace Flow.Launcher.Core.Resource
|
|||
querySuggestionBoxStyle.Setters.Add(new Setter(TextBox.FontStretchProperty, fontStretch));
|
||||
}
|
||||
|
||||
Style resultItemStyle = dict["ItemTitleStyle"] as Style;
|
||||
Style resultSubItemStyle = dict["ItemSubTitleStyle"] as Style;
|
||||
Style resultHotkeyItemStyle = dict["ItemHotkeyStyle"] as Style;
|
||||
Style resultItemSelectedStyle = dict["ItemTitleSelectedStyle"] as Style;
|
||||
Style resultSubItemSelectedStyle = dict["ItemSubTitleSelectedStyle"] as Style;
|
||||
Style resultHotkeyItemSelectedStyle = dict["ItemHotkeySelectedStyle"] as Style;
|
||||
|
||||
if (resultItemStyle != null && resultSubItemStyle != null && resultSubItemSelectedStyle != null && resultItemSelectedStyle != null)
|
||||
if (dict["ItemTitleStyle"] is Style resultItemStyle &&
|
||||
dict["ItemSubTitleStyle"] is Style resultSubItemStyle &&
|
||||
dict["ItemSubTitleSelectedStyle"] is Style resultSubItemSelectedStyle &&
|
||||
dict["ItemTitleSelectedStyle"] is Style resultItemSelectedStyle &&
|
||||
dict["ItemHotkeySelectedStyle"] is Style resultHotkeyItemSelectedStyle)
|
||||
{
|
||||
Setter fontFamily = new Setter(TextBlock.FontFamilyProperty, new FontFamily(Settings.ResultFont));
|
||||
Setter fontStyle = new Setter(TextBlock.FontStyleProperty, FontHelper.GetFontStyleFromInvariantStringOrNormal(Settings.ResultFontStyle));
|
||||
|
|
@ -189,7 +184,7 @@ namespace Flow.Launcher.Core.Resource
|
|||
Setter fontStretch = new Setter(TextBlock.FontStretchProperty, FontHelper.GetFontStretchFromInvariantStringOrNormal(Settings.ResultFontStretch));
|
||||
|
||||
Setter[] setters = { fontFamily, fontStyle, fontWeight, fontStretch };
|
||||
Array.ForEach(new[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle, resultHotkeyItemStyle, resultHotkeyItemSelectedStyle }, o => Array.ForEach(setters, p => o.Setters.Add(p)));
|
||||
Array.ForEach(new[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle, resultHotkeyItemSelectedStyle }, o => Array.ForEach(setters, p => o.Setters.Add(p)));
|
||||
}
|
||||
|
||||
var windowStyle = dict["WindowStyle"] as Style;
|
||||
|
|
@ -239,17 +234,19 @@ namespace Flow.Launcher.Core.Resource
|
|||
|
||||
public void AddDropShadowEffectToCurrentTheme()
|
||||
{
|
||||
var dict = CurrentThemeResourceDictionary();
|
||||
var dict = GetResourceDictionary();
|
||||
|
||||
var windowBorderStyle = dict["WindowBorderStyle"] as Style;
|
||||
|
||||
var effectSetter = new Setter();
|
||||
effectSetter.Property = Border.EffectProperty;
|
||||
effectSetter.Value = new DropShadowEffect
|
||||
var effectSetter = new Setter
|
||||
{
|
||||
Opacity = 0.4,
|
||||
ShadowDepth = 2,
|
||||
BlurRadius = 15
|
||||
Property = Border.EffectProperty,
|
||||
Value = new DropShadowEffect
|
||||
{
|
||||
Opacity = 0.9,
|
||||
ShadowDepth = 2,
|
||||
BlurRadius = 15
|
||||
}
|
||||
};
|
||||
|
||||
var marginSetter = windowBorderStyle.Setters.FirstOrDefault(setterBase => setterBase is Setter setter && setter.Property == Border.MarginProperty) as Setter;
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
Title="{DynamicResource flowlauncher_settings}"
|
||||
ResizeMode="CanResizeWithGrip"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Height="800" Width="1280"
|
||||
MinWidth="1280"
|
||||
MinHeight="700"
|
||||
Height="700" Width="900"
|
||||
MinWidth="850"
|
||||
MinHeight="600"
|
||||
Loaded="OnLoaded"
|
||||
Closed="OnClosed"
|
||||
d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}">
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="FontSize" Value="28" />
|
||||
<Setter Property="FontWeight" Value="Regular" />
|
||||
<Setter Property="Height" Value="40" />
|
||||
<Setter Property="Margin" Value="16 7 0 7" />
|
||||
<Setter Property="Padding" Value="0 4 0 0" />
|
||||
<Setter Property="Background" Value="#2F2F2F" />
|
||||
<Setter Property="Width" Value="470" />
|
||||
<Setter Property="Width" Value="664" />
|
||||
<Setter Property="Height" Value="48" />
|
||||
<Setter Property="Foreground" Value="#E3E0E3" />
|
||||
<Setter Property="CaretBrush" Value="#E3E0E3" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
|
|
@ -40,9 +40,9 @@
|
|||
<!-- 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="Height" Value="40" />
|
||||
<Setter Property="Height" Value="48" />
|
||||
<Setter Property="Margin" Value="16 7 0 7" />
|
||||
<Setter Property="Width" Value="470" />
|
||||
<Setter Property="Width" Value="664" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Padding" Value="0 4 0 0" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
<Setter Property="CornerRadius" Value="5" />
|
||||
</Style>
|
||||
<Style x:Key="BaseWindowStyle" TargetType="{x:Type Window}">
|
||||
<Setter Property="Width" Value="576" />
|
||||
<Setter Property="Width" Value="750" />
|
||||
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
|
||||
</Style>
|
||||
|
||||
|
|
|
|||
|
|
@ -10,11 +10,15 @@
|
|||
<Setter Property="Background" Value="#36393f" />
|
||||
<Setter Property="CaretBrush" Value="#ffffff" />
|
||||
<Setter Property="SelectionBrush" Value="#0a68d8"/>
|
||||
<Setter Property="Width" Value="490" />
|
||||
<Setter Property="Height" Value="42" />
|
||||
<Setter Property="FontSize" Value="24" />
|
||||
</Style>
|
||||
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
|
||||
<Setter Property="Foreground" Value="#72767d" />
|
||||
<Setter Property="Background" Value="#36393f" />
|
||||
<Setter Property="Width" Value="490" />
|
||||
<Setter Property="Height" Value="42" />
|
||||
<Setter Property="FontSize" Value="24" />
|
||||
</Style>
|
||||
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
|
||||
|
|
@ -24,7 +28,7 @@
|
|||
<Setter Property="Background" Value="#36393f" />
|
||||
</Style>
|
||||
<Style x:Key="WindowStyle" BasedOn="{StaticResource BaseWindowStyle}" TargetType="{x:Type Window}">
|
||||
<Setter Property="Width" Value="596" />
|
||||
<Setter Property="Width" Value="576" />
|
||||
|
||||
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
|
||||
</Style>
|
||||
|
|
|
|||
|
|
@ -6,11 +6,15 @@
|
|||
<Setter Property="Background" Value="#161614"/>
|
||||
<Setter Property="Foreground" Value="#b88f3a" />
|
||||
<Setter Property="CaretBrush" Value="#b88f3a" />
|
||||
<Setter Property="Width" Value="490" />
|
||||
<Setter Property="Height" Value="42" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
|
||||
<Setter Property="Background" Value="#161614"/>
|
||||
<Setter Property="Foreground" Value="#a09b8c" />
|
||||
<Setter Property="Width" Value="490" />
|
||||
<Setter Property="Height" Value="42" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
|
||||
|
|
@ -20,6 +24,7 @@
|
|||
<Setter Property="Background" Value="#161614"></Setter>
|
||||
</Style>
|
||||
<Style x:Key="WindowStyle" TargetType="{x:Type Window}" BasedOn="{StaticResource BaseWindowStyle}" >
|
||||
<Setter Property="Width" Value="576" />
|
||||
</Style>
|
||||
<Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}" ></Style>
|
||||
<Style x:Key="ItemTitleStyle" BasedOn="{StaticResource BaseItemTitleStyle}" TargetType="{x:Type TextBlock}" >
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
|
||||
<Setter Property="Background" Value="#1f1d1f"></Setter>
|
||||
<Setter Property="Width" Value="576" />
|
||||
<Setter Property="BorderThickness" Value="2"></Setter>
|
||||
<Setter Property="BorderBrush" Value="#000000"></Setter>
|
||||
</Style>
|
||||
|
|
|
|||
|
|
@ -11,12 +11,16 @@
|
|||
<Setter Property="Foreground" Value="#d2d8e5" />
|
||||
<Setter Property="CaretBrush" Value="#FFAA47" />
|
||||
<Setter Property="FontSize" Value="26" />
|
||||
<Setter Property="Width" Value="490" />
|
||||
<Setter Property="Height" Value="42" />
|
||||
<Setter Property="Padding" Value="0 4 0 0" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
|
||||
<Setter Property="Background" Value="#303840" />
|
||||
<Setter Property="Foreground" Value="#798189" />
|
||||
<Setter Property="FontSize" Value="26" />
|
||||
<Setter Property="Width" Value="490" />
|
||||
<Setter Property="Height" Value="42" />
|
||||
<Setter Property="Padding" Value="0 4 0 0" />
|
||||
</Style>
|
||||
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
|
||||
|
|
|
|||
|
|
@ -13,14 +13,18 @@
|
|||
<Setter Property="CaretBrush" Value="#000000" />
|
||||
<Setter Property="BorderBrush" Value="Black"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="FontSize" Value="26" />
|
||||
<Setter Property="FontSize" Value="28" />
|
||||
<Setter Property="Width" Value="490" />
|
||||
<Setter Property="Height" Value="42" />
|
||||
<Setter Property="Padding" Value="0 4 0 0" />
|
||||
</Style>
|
||||
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
|
||||
<Setter Property="Background" Value="#dddddd" />
|
||||
<Setter Property="Foreground" Value="#c6c6c6" />
|
||||
<Setter Property="FontSize" Value="26" />
|
||||
<Setter Property="FontSize" Value="28" />
|
||||
<Setter Property="Padding" Value="0 4 0 0" />
|
||||
<Setter Property="Width" Value="490" />
|
||||
<Setter Property="Height" Value="42" />
|
||||
</Style>
|
||||
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
|
|
|
|||
|
|
@ -13,12 +13,16 @@
|
|||
<Setter Property="CaretBrush" Value="#FFFFFF" />
|
||||
<Setter Property="FontSize" Value="26" />
|
||||
<Setter Property="Padding" Value="0 4 0 0" />
|
||||
<Setter Property="Width" Value="490" />
|
||||
<Setter Property="Height" Value="42" />
|
||||
</Style>
|
||||
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
|
||||
<Setter Property="Background" Value="#202020" />
|
||||
<Setter Property="Foreground" Value="#7b7b7b" />
|
||||
<Setter Property="FontSize" Value="26" />
|
||||
<Setter Property="Padding" Value="0 4 0 0" />
|
||||
<Setter Property="Width" Value="490" />
|
||||
<Setter Property="Height" Value="42" />
|
||||
</Style>
|
||||
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
|
|
|
|||
|
|
@ -13,12 +13,16 @@
|
|||
<Setter Property="CaretBrush" Value="#000000" />
|
||||
<Setter Property="FontSize" Value="26" />
|
||||
<Setter Property="Padding" Value="0 4 0 0" />
|
||||
</Style>
|
||||
<Setter Property="Width" Value="490" />
|
||||
<Setter Property="Height" Value="42" />
|
||||
</Style>
|
||||
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
|
||||
<Setter Property="Background" Value="#f3f3f3" />
|
||||
<Setter Property="Foreground" Value="#b5b5b5" />
|
||||
<Setter Property="FontSize" Value="26" />
|
||||
<Setter Property="Padding" Value="0 4 0 0" />
|
||||
<Setter Property="Width" Value="490" />
|
||||
<Setter Property="Height" Value="42" />
|
||||
</Style>
|
||||
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue