Skip to content

Commit 264aed9

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into pr/835
2 parents dafd7d2 + 365f7e7 commit 264aed9

File tree

7 files changed

+37
-36
lines changed

7 files changed

+37
-36
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +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";
18+
public string ColorScheme { get; set; } = "System";
1919
public bool ShowOpenResultHotkey { get; set; } = true;
2020
public double WindowSize { get; set; } = 580;
2121

@@ -133,7 +133,7 @@ public string QuerySearchPrecisionString
133133
public bool DontPromptUpdateMsg { get; set; }
134134
public bool EnableUpdateLog { get; set; }
135135

136-
public bool StartFlowLauncherOnSystemStartup { get; set; } = true;
136+
public bool StartFlowLauncherOnSystemStartup { get; set; } = false;
137137
public bool HideOnStartup { get; set; }
138138
bool _hideNotifyIcon { get; set; }
139139
public bool HideNotifyIcon
@@ -167,7 +167,7 @@ public enum LastQueryMode
167167
Preserved
168168
}
169169

170-
public enum DarkMode
170+
public enum ColorSchemes
171171
{
172172
System,
173173
Light,

Flow.Launcher/Languages/en.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@
8787
<system:String x:Key="theme_load_failure_parse_error">Fail to load theme {0}, fallback to default theme</system:String>
8888
<system:String x:Key="ThemeFolder">Theme Folder</system:String>
8989
<system:String x:Key="OpenThemeFolder">Open Theme Folder</system:String>
90-
<system:String x:Key="DarkMode">Dark Mode</system:String>
91-
<system:String x:Key="DarkModeSystem">System Default</system:String>
92-
<system:String x:Key="DarkModeLight">Light</system:String>
93-
<system:String x:Key="DarkModeDark">Dark</system:String>
90+
<system:String x:Key="ColorScheme">Color Scheme</system:String>
91+
<system:String x:Key="ColorSchemeSystem">System Default</system:String>
92+
<system:String x:Key="ColorSchemeLight">Light</system:String>
93+
<system:String x:Key="ColorSchemeDark">Dark</system:String>
9494
<system:String x:Key="SoundEffect">Sound Effect</system:String>
9595
<system:String x:Key="SoundEffectTip">Play a small sound when the search window opens</system:String>
9696
<system:String x:Key="Animation">Animation</system:String>

Flow.Launcher/Languages/ko.xaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,10 @@
8787
<system:String x:Key="theme_load_failure_parse_error">{0} 테마 로드에 실패했습니다. 기본 테마로 변경합니다.</system:String>
8888
<system:String x:Key="ThemeFolder">테마 폴더</system:String>
8989
<system:String x:Key="OpenThemeFolder">테마 폴더 열기</system:String>
90-
<system:String x:Key="DarkMode">다크 모드</system:String>
91-
<system:String x:Key="DarkModeTip">System settings will take effect from the next run</system:String>
92-
<system:String x:Key="DarkModeSystem">시스템 기본</system:String>
93-
<system:String x:Key="DarkModeLight">밝게</system:String>
94-
<system:String x:Key="DarkModeDark">어둡게</system:String>
90+
<system:String x:Key="ColorScheme">앱 색상</system:String>
91+
<system:String x:Key="ColorSchemeSystem">시스템 기본</system:String>
92+
<system:String x:Key="ColorSchemeLight">밝게</system:String>
93+
<system:String x:Key="ColorSchemeDark">어둡게</system:String>
9594
<system:String x:Key="SoundEffect">소리 효과</system:String>
9695
<system:String x:Key="SoundEffectTip">검색창을 열 때 작은 소리를 재생합니다.</system:String>
9796
<system:String x:Key="Animation">애니메이션</system:String>

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private void OnLoaded(object sender, RoutedEventArgs _)
6868
HideStartup();
6969
// show notify icon when flowlauncher is hidden
7070
InitializeNotifyIcon();
71-
InitializeDarkMode();
71+
InitializeColorScheme();
7272
WindowsInteropHelper.DisableControlBox(this);
7373
InitProgressbarAnimation();
7474
// since the default main window visibility is visible
@@ -480,13 +480,13 @@ private void MoveQueryTextToEnd()
480480
QueryTextBox.CaretIndex = QueryTextBox.Text.Length;
481481
}
482482

483-
public void InitializeDarkMode()
483+
public void InitializeColorScheme()
484484
{
485-
if (_settings.DarkMode == Constant.Light)
485+
if (_settings.ColorScheme == Constant.Light)
486486
{
487487
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Light;
488488
}
489-
else if (_settings.DarkMode == Constant.Dark)
489+
else if (_settings.ColorScheme == Constant.Dark)
490490
{
491491
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Dark;
492492
}

Flow.Launcher/SettingWindow.xaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,21 +1919,21 @@
19191919
<Border Margin="0,12,0,12" Style="{DynamicResource SettingGroupBox}">
19201920
<ItemsControl Style="{StaticResource SettingGrid}">
19211921
<StackPanel Style="{StaticResource TextPanel}">
1922-
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource DarkMode}" />
1922+
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource ColorScheme}" />
19231923
</StackPanel>
19241924
<ComboBox
1925-
x:Name="DarkModeComboBox"
1925+
x:Name="ColorSchemeComboBox"
19261926
Grid.Column="2"
19271927
Width="180"
19281928
Margin="0,0,18,0"
19291929
DisplayMemberPath="Display"
19301930
FontSize="14"
1931-
ItemsSource="{Binding DarkModes}"
1932-
SelectedValue="{Binding Settings.DarkMode}"
1931+
ItemsSource="{Binding ColorSchemes}"
1932+
SelectedValue="{Binding Settings.ColorScheme}"
19331933
SelectedValuePath="Value"
1934-
SelectionChanged="DarkModeSelectedIndexChanged" />
1934+
SelectionChanged="ColorSchemeSelectedIndexChanged" />
19351935
<TextBlock Style="{StaticResource Glyph}">
1936-
&#xe708;
1936+
&#xe793;
19371937
</TextBlock>
19381938
</ItemsControl>
19391939
</Border>

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,14 @@ private void OnExternalPluginInstallClick(object sender, RoutedEventArgs e)
306306
textBox.MoveFocus(tRequest);
307307
}
308308

309-
private void DarkModeSelectedIndexChanged(object sender, EventArgs e) => ThemeManager.Current.ApplicationTheme = settings.DarkMode switch
310-
{
311-
Constant.Light => ApplicationTheme.Light,
312-
Constant.Dark => ApplicationTheme.Dark,
313-
Constant.System => null,
314-
_ => ThemeManager.Current.ApplicationTheme
315-
};
309+
private void ColorSchemeSelectedIndexChanged(object sender, EventArgs e)
310+
=> ThemeManager.Current.ApplicationTheme = settings.ColorScheme switch
311+
{
312+
Constant.Light => ApplicationTheme.Light,
313+
Constant.Dark => ApplicationTheme.Dark,
314+
Constant.System => null,
315+
_ => ThemeManager.Current.ApplicationTheme
316+
};
316317

317318
/* Custom TitleBar */
318319

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -315,22 +315,23 @@ public bool DropShadowEffect
315315
}
316316
}
317317

318-
public class DarkMode
318+
public class ColorScheme
319319
{
320320
public string Display { get; set; }
321-
public Infrastructure.UserSettings.DarkMode Value { get; set; }
321+
public ColorSchemes Value { get; set; }
322322
}
323-
public List<DarkMode> DarkModes
323+
324+
public List<ColorScheme> ColorSchemes
324325
{
325326
get
326327
{
327-
List<DarkMode> modes = new List<DarkMode>();
328-
var enums = (Infrastructure.UserSettings.DarkMode[])Enum.GetValues(typeof(Infrastructure.UserSettings.DarkMode));
328+
List<ColorScheme> modes = new List<ColorScheme>();
329+
var enums = (ColorSchemes[])Enum.GetValues(typeof(ColorSchemes));
329330
foreach (var e in enums)
330331
{
331-
var key = $"DarkMode{e}";
332+
var key = $"ColorScheme{e}";
332333
var display = _translater.GetTranslation(key);
333-
var m = new DarkMode { Display = display, Value = e, };
334+
var m = new ColorScheme { Display = display, Value = e, };
334335
modes.Add(m);
335336
}
336337
return modes;

0 commit comments

Comments
 (0)