Skip to content

Commit 2ebdead

Browse files
authored
Merge pull request #817 from onesounds/DarkMode
Dark mode
2 parents 5204643 + 83feb09 commit 2ebdead

27 files changed

+8253
-3433
lines changed

Flow.Launcher.Infrastructure/Constant.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,16 @@ public static class Constant
3535

3636
public const string DefaultTheme = "Win11Light";
3737

38+
public const string Light = "Light";
39+
public const string Dark = "Dark";
40+
public const string System = "System";
41+
3842
public const string Themes = "Themes";
43+
public const string Settings = "Settings";
44+
public const string Logs = "Logs";
3945

4046
public const string Website = "https://flow-launcher.github.io";
47+
public const string GitHub = "https://github.com/Flow-Launcher/Flow.Launcher";
48+
public const string Docs = "https://flow-launcher.github.io/docs";
4149
}
4250
}

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class Settings : BaseModel
1515
private string language = "en";
1616
public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}";
1717
public string OpenResultModifiers { get; set; } = KeyConstant.Alt;
18+
public string DarkMode { get; set; } = "System";
1819
public bool ShowOpenResultHotkey { get; set; } = true;
1920
public double WindowSize { get; set; } = 580;
2021

@@ -165,4 +166,11 @@ public enum LastQueryMode
165166
Empty,
166167
Preserved
167168
}
169+
170+
public enum DarkMode
171+
{
172+
System,
173+
Light,
174+
Dark
175+
}
168176
}

Flow.Launcher/ActionKeywords.xaml

Lines changed: 120 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,136 @@
1-
<Window x:Class="Flow.Launcher.ActionKeywords"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
Title="{DynamicResource actionKeywordsTitle}"
5-
Icon="Images\app.png"
6-
ResizeMode="NoResize"
7-
Loaded="ActionKeyword_OnLoaded"
8-
WindowStartupLocation="CenterScreen"
9-
Height="365" Width="450" Background="#F3F3F3" BorderBrush="#cecece">
1+
<Window
2+
x:Class="Flow.Launcher.ActionKeywords"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
Title="{DynamicResource actionKeywordsTitle}"
6+
Width="450"
7+
Height="345"
8+
Background="{DynamicResource PopuBGColor}"
9+
Foreground="{DynamicResource PopupTextColor}"
10+
Icon="Images\app.png"
11+
Loaded="ActionKeyword_OnLoaded"
12+
ResizeMode="NoResize"
13+
WindowStartupLocation="CenterScreen">
14+
<WindowChrome.WindowChrome>
15+
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
16+
</WindowChrome.WindowChrome>
1017
<Grid>
1118
<Grid.RowDefinitions>
1219
<RowDefinition />
13-
<RowDefinition Height="80"/>
20+
<RowDefinition Height="80" />
1421
</Grid.RowDefinitions>
15-
<Border BorderThickness="0 0 0 1" BorderBrush="#e5e5e5" Background="#ffffff" Padding="26 26 26 0">
16-
<Grid>
22+
<Grid>
23+
<StackPanel Grid.Row="0">
1724
<StackPanel>
18-
<StackPanel Grid.Row="0" Margin="0 0 0 12">
19-
<TextBlock Grid.Column="0" Text="{DynamicResource actionKeywordsTitle}" FontSize="20" FontWeight="SemiBold" FontFamily="Segoe UI" TextAlignment="Left"
20-
Margin="0 0 0 0" />
25+
<Grid>
26+
<Grid.ColumnDefinitions>
27+
<ColumnDefinition Width="Auto" />
28+
<ColumnDefinition Width="*" />
29+
<ColumnDefinition Width="Auto" />
30+
<ColumnDefinition Width="Auto" />
31+
<ColumnDefinition Width="Auto" />
32+
</Grid.ColumnDefinitions>
33+
<Button
34+
Grid.Column="4"
35+
Click="BtnCancel_OnClick"
36+
Style="{StaticResource TitleBarCloseButtonStyle}">
37+
<Path
38+
Width="46"
39+
Height="32"
40+
Data="M 18,11 27,20 M 18,20 27,11"
41+
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
42+
StrokeThickness="1">
43+
<Path.Style>
44+
<Style TargetType="Path">
45+
<Style.Triggers>
46+
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
47+
<Setter Property="Opacity" Value="0.5" />
48+
</DataTrigger>
49+
</Style.Triggers>
50+
</Style>
51+
</Path.Style>
52+
</Path>
53+
</Button>
54+
</Grid>
55+
</StackPanel>
56+
<StackPanel Margin="26,12,26,0">
57+
<StackPanel Grid.Row="0" Margin="0,0,0,12">
58+
<TextBlock
59+
Grid.Column="0"
60+
Margin="0,0,0,0"
61+
FontFamily="Segoe UI"
62+
FontSize="20"
63+
FontWeight="SemiBold"
64+
Text="{DynamicResource actionKeywordsTitle}"
65+
TextAlignment="Left" />
2166
</StackPanel>
2267
<StackPanel>
23-
<TextBlock
24-
Text="{DynamicResource actionkeyword_tips}" Foreground="#1b1b1b" FontSize="14" TextWrapping="WrapWithOverflow" TextAlignment="Left"/>
68+
<TextBlock
69+
FontSize="14"
70+
Text="{DynamicResource actionkeyword_tips}"
71+
TextAlignment="Left"
72+
TextWrapping="WrapWithOverflow" />
2573
</StackPanel>
2674

27-
<StackPanel Orientation="Horizontal" Margin="0 18 0 0">
28-
<TextBlock FontSize="14" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"
29-
HorizontalAlignment="Left" Text="{DynamicResource currentActionKeywords}" />
30-
<TextBlock x:Name="tbOldActionKeyword" Grid.Row="0" Grid.Column="1" Margin="14 10 10 10" FontSize="14"
31-
VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="SemiBold"/>
75+
<StackPanel Margin="0,18,0,0" Orientation="Horizontal">
76+
<TextBlock
77+
Grid.Row="0"
78+
Grid.Column="1"
79+
HorizontalAlignment="Left"
80+
VerticalAlignment="Center"
81+
FontSize="14"
82+
Text="{DynamicResource currentActionKeywords}" />
83+
<TextBlock
84+
x:Name="tbOldActionKeyword"
85+
Grid.Row="0"
86+
Grid.Column="1"
87+
Margin="14,10,10,10"
88+
HorizontalAlignment="Left"
89+
VerticalAlignment="Center"
90+
FontSize="14"
91+
FontWeight="SemiBold"
92+
Foreground="{DynamicResource Color05B}" />
3293
</StackPanel>
3394
<StackPanel Orientation="Horizontal">
34-
<TextBlock FontSize="14" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"
35-
HorizontalAlignment="Left" Text="{DynamicResource newActionKeyword}" />
36-
37-
<TextBox x:Name="tbAction" Margin="10 10 15 10" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" />
38-
95+
<TextBlock
96+
Grid.Row="1"
97+
Grid.Column="1"
98+
HorizontalAlignment="Left"
99+
VerticalAlignment="Center"
100+
FontSize="14"
101+
Text="{DynamicResource newActionKeyword}" />
102+
<TextBox
103+
x:Name="tbAction"
104+
Width="105"
105+
Margin="10,10,15,10"
106+
HorizontalAlignment="Left"
107+
VerticalAlignment="Center" />
39108
</StackPanel>
40109
</StackPanel>
41-
</Grid>
42-
</Border>
43-
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
44-
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 5 0" Width="100" Height="30"
45-
Content="{DynamicResource cancel}" />
46-
<Button x:Name="btnDone" Margin="5 0 10 0" Width="100" Height="30" Click="btnDone_OnClick">
47-
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
48-
</Button>
49-
</StackPanel>
50-
</Grid>
51-
<!--
52-
<Grid.RowDefinitions>
53-
<RowDefinition />
54-
<RowDefinition Height="60"/>
55-
<RowDefinition />
56-
<RowDefinition />
57-
</Grid.RowDefinitions>
58-
<Grid.ColumnDefinitions>
59-
<ColumnDefinition Width="150" />
60-
<ColumnDefinition />
61-
</Grid.ColumnDefinitions>
62-
<TextBlock FontSize="14" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"
63-
HorizontalAlignment="Left" Text="{DynamicResource currentActionKeywords}" />
64-
<TextBlock x:Name="tbOldActionKeyword" Grid.Row="0" Grid.Column="1" Margin="170 10 10 10" FontSize="14"
65-
VerticalAlignment="Center" HorizontalAlignment="Left" />
66-
67-
<TextBlock FontSize="14" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"
68-
HorizontalAlignment="Left" Text="{DynamicResource newActionKeyword}" />
69-
<StackPanel Grid.Row="1" Orientation="Horizontal" Grid.Column="1">
70-
<TextBox x:Name="tbAction" Margin="170 10 15 10" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" />
71-
</StackPanel>
72-
73-
<TextBlock Grid.Row="2" Grid.ColumnSpan="1" Grid.Column="1" Foreground="Gray"
74-
Text="{DynamicResource actionkeyword_tips}" />
75-
76-
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="3" Grid.Column="1">
77-
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="30"
110+
</StackPanel>
111+
</Grid>
112+
<Border
113+
Grid.Row="1"
114+
Background="{DynamicResource PopupButtonAreaBGColor}"
115+
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
116+
BorderThickness="0,1,0,0">
117+
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
118+
<Button
119+
x:Name="btnCancel"
120+
Width="100"
121+
Height="30"
122+
Margin="10,0,5,0"
123+
Click="BtnCancel_OnClick"
78124
Content="{DynamicResource cancel}" />
79-
<Button x:Name="btnDone" Margin="10 0 10 0" Width="80" Height="30" Click="btnDone_OnClick">
80-
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
81-
</Button>
82-
</StackPanel>
125+
<Button
126+
x:Name="btnDone"
127+
Width="100"
128+
Height="30"
129+
Margin="5,0,10,0"
130+
Click="btnDone_OnClick">
131+
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
132+
</Button>
133+
</StackPanel>
134+
</Border>
83135
</Grid>
84-
-->
85136
</Window>

Flow.Launcher/App.xaml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
1-
<Application x:Class="Flow.Launcher.App"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:ui="http://schemas.modernwpf.com/2019"
5-
ShutdownMode="OnMainWindowClose"
6-
Startup="OnStartupAsync">
1+
<Application
2+
x:Class="Flow.Launcher.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:ui="http://schemas.modernwpf.com/2019"
6+
ShutdownMode="OnMainWindowClose"
7+
Startup="OnStartupAsync">
78
<Application.Resources>
89
<ResourceDictionary>
910
<ResourceDictionary.MergedDictionaries>
10-
<ui:ThemeResources RequestedTheme="Light" />
11+
<ui:ThemeResources>
12+
<ui:ThemeResources.ThemeDictionaries>
13+
<ResourceDictionary x:Key="Light">
14+
<ResourceDictionary.MergedDictionaries>
15+
<ResourceDictionary Source="pack://application:,,,/Resources/Light.xaml" />
16+
</ResourceDictionary.MergedDictionaries>
17+
</ResourceDictionary>
18+
<ResourceDictionary x:Key="Dark">
19+
<ResourceDictionary.MergedDictionaries>
20+
<ResourceDictionary Source="pack://application:,,,/Resources/Dark.xaml" />
21+
</ResourceDictionary.MergedDictionaries>
22+
</ResourceDictionary>
23+
</ui:ThemeResources.ThemeDictionaries>
24+
</ui:ThemeResources>
1125
<ui:XamlControlsResources />
1226
<ResourceDictionary Source="pack://application:,,,/Resources/CustomControlTemplate.xaml" />
13-
<ResourceDictionary Source="pack://application:,,,/Themes/Win11Light.xaml" />
27+
<ResourceDictionary Source="pack://application:,,,/Themes/Win11System.xaml" />
1428
<ResourceDictionary Source="pack://application:,,,/Languages/en.xaml" />
1529
</ResourceDictionary.MergedDictionaries>
1630
</ResourceDictionary>

0 commit comments

Comments
 (0)