mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge remote-tracking branch 'upstream/dev' into pr/835
This commit is contained in:
commit
264aed9408
7 changed files with 37 additions and 36 deletions
|
|
@ -15,7 +15,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
private string language = "en";
|
||||
public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}";
|
||||
public string OpenResultModifiers { get; set; } = KeyConstant.Alt;
|
||||
public string DarkMode { get; set; } = "System";
|
||||
public string ColorScheme { get; set; } = "System";
|
||||
public bool ShowOpenResultHotkey { get; set; } = true;
|
||||
public double WindowSize { get; set; } = 580;
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
public bool DontPromptUpdateMsg { get; set; }
|
||||
public bool EnableUpdateLog { get; set; }
|
||||
|
||||
public bool StartFlowLauncherOnSystemStartup { get; set; } = true;
|
||||
public bool StartFlowLauncherOnSystemStartup { get; set; } = false;
|
||||
public bool HideOnStartup { get; set; }
|
||||
bool _hideNotifyIcon { get; set; }
|
||||
public bool HideNotifyIcon
|
||||
|
|
@ -167,7 +167,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
Preserved
|
||||
}
|
||||
|
||||
public enum DarkMode
|
||||
public enum ColorSchemes
|
||||
{
|
||||
System,
|
||||
Light,
|
||||
|
|
|
|||
|
|
@ -87,10 +87,10 @@
|
|||
<system:String x:Key="theme_load_failure_parse_error">Fail to load theme {0}, fallback to default theme</system:String>
|
||||
<system:String x:Key="ThemeFolder">Theme Folder</system:String>
|
||||
<system:String x:Key="OpenThemeFolder">Open Theme Folder</system:String>
|
||||
<system:String x:Key="DarkMode">Dark Mode</system:String>
|
||||
<system:String x:Key="DarkModeSystem">System Default</system:String>
|
||||
<system:String x:Key="DarkModeLight">Light</system:String>
|
||||
<system:String x:Key="DarkModeDark">Dark</system:String>
|
||||
<system:String x:Key="ColorScheme">Color Scheme</system:String>
|
||||
<system:String x:Key="ColorSchemeSystem">System Default</system:String>
|
||||
<system:String x:Key="ColorSchemeLight">Light</system:String>
|
||||
<system:String x:Key="ColorSchemeDark">Dark</system:String>
|
||||
<system:String x:Key="SoundEffect">Sound Effect</system:String>
|
||||
<system:String x:Key="SoundEffectTip">Play a small sound when the search window opens</system:String>
|
||||
<system:String x:Key="Animation">Animation</system:String>
|
||||
|
|
|
|||
|
|
@ -87,11 +87,10 @@
|
|||
<system:String x:Key="theme_load_failure_parse_error">{0} 테마 로드에 실패했습니다. 기본 테마로 변경합니다.</system:String>
|
||||
<system:String x:Key="ThemeFolder">테마 폴더</system:String>
|
||||
<system:String x:Key="OpenThemeFolder">테마 폴더 열기</system:String>
|
||||
<system:String x:Key="DarkMode">다크 모드</system:String>
|
||||
<system:String x:Key="DarkModeTip">System settings will take effect from the next run</system:String>
|
||||
<system:String x:Key="DarkModeSystem">시스템 기본</system:String>
|
||||
<system:String x:Key="DarkModeLight">밝게</system:String>
|
||||
<system:String x:Key="DarkModeDark">어둡게</system:String>
|
||||
<system:String x:Key="ColorScheme">앱 색상</system:String>
|
||||
<system:String x:Key="ColorSchemeSystem">시스템 기본</system:String>
|
||||
<system:String x:Key="ColorSchemeLight">밝게</system:String>
|
||||
<system:String x:Key="ColorSchemeDark">어둡게</system:String>
|
||||
<system:String x:Key="SoundEffect">소리 효과</system:String>
|
||||
<system:String x:Key="SoundEffectTip">검색창을 열 때 작은 소리를 재생합니다.</system:String>
|
||||
<system:String x:Key="Animation">애니메이션</system:String>
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ namespace Flow.Launcher
|
|||
HideStartup();
|
||||
// show notify icon when flowlauncher is hidden
|
||||
InitializeNotifyIcon();
|
||||
InitializeDarkMode();
|
||||
InitializeColorScheme();
|
||||
WindowsInteropHelper.DisableControlBox(this);
|
||||
InitProgressbarAnimation();
|
||||
// since the default main window visibility is visible
|
||||
|
|
@ -480,13 +480,13 @@ namespace Flow.Launcher
|
|||
QueryTextBox.CaretIndex = QueryTextBox.Text.Length;
|
||||
}
|
||||
|
||||
public void InitializeDarkMode()
|
||||
public void InitializeColorScheme()
|
||||
{
|
||||
if (_settings.DarkMode == Constant.Light)
|
||||
if (_settings.ColorScheme == Constant.Light)
|
||||
{
|
||||
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Light;
|
||||
}
|
||||
else if (_settings.DarkMode == Constant.Dark)
|
||||
else if (_settings.ColorScheme == Constant.Dark)
|
||||
{
|
||||
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Dark;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1919,21 +1919,21 @@
|
|||
<Border Margin="0,12,0,12" Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource DarkMode}" />
|
||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource ColorScheme}" />
|
||||
</StackPanel>
|
||||
<ComboBox
|
||||
x:Name="DarkModeComboBox"
|
||||
x:Name="ColorSchemeComboBox"
|
||||
Grid.Column="2"
|
||||
Width="180"
|
||||
Margin="0,0,18,0"
|
||||
DisplayMemberPath="Display"
|
||||
FontSize="14"
|
||||
ItemsSource="{Binding DarkModes}"
|
||||
SelectedValue="{Binding Settings.DarkMode}"
|
||||
ItemsSource="{Binding ColorSchemes}"
|
||||
SelectedValue="{Binding Settings.ColorScheme}"
|
||||
SelectedValuePath="Value"
|
||||
SelectionChanged="DarkModeSelectedIndexChanged" />
|
||||
SelectionChanged="ColorSchemeSelectedIndexChanged" />
|
||||
<TextBlock Style="{StaticResource Glyph}">
|
||||

|
||||

|
||||
</TextBlock>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
|
|
|
|||
|
|
@ -306,13 +306,14 @@ namespace Flow.Launcher
|
|||
textBox.MoveFocus(tRequest);
|
||||
}
|
||||
|
||||
private void DarkModeSelectedIndexChanged(object sender, EventArgs e) => ThemeManager.Current.ApplicationTheme = settings.DarkMode switch
|
||||
{
|
||||
Constant.Light => ApplicationTheme.Light,
|
||||
Constant.Dark => ApplicationTheme.Dark,
|
||||
Constant.System => null,
|
||||
_ => ThemeManager.Current.ApplicationTheme
|
||||
};
|
||||
private void ColorSchemeSelectedIndexChanged(object sender, EventArgs e)
|
||||
=> ThemeManager.Current.ApplicationTheme = settings.ColorScheme switch
|
||||
{
|
||||
Constant.Light => ApplicationTheme.Light,
|
||||
Constant.Dark => ApplicationTheme.Dark,
|
||||
Constant.System => null,
|
||||
_ => ThemeManager.Current.ApplicationTheme
|
||||
};
|
||||
|
||||
/* Custom TitleBar */
|
||||
|
||||
|
|
|
|||
|
|
@ -315,22 +315,23 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
public class DarkMode
|
||||
public class ColorScheme
|
||||
{
|
||||
public string Display { get; set; }
|
||||
public Infrastructure.UserSettings.DarkMode Value { get; set; }
|
||||
public ColorSchemes Value { get; set; }
|
||||
}
|
||||
public List<DarkMode> DarkModes
|
||||
|
||||
public List<ColorScheme> ColorSchemes
|
||||
{
|
||||
get
|
||||
{
|
||||
List<DarkMode> modes = new List<DarkMode>();
|
||||
var enums = (Infrastructure.UserSettings.DarkMode[])Enum.GetValues(typeof(Infrastructure.UserSettings.DarkMode));
|
||||
List<ColorScheme> modes = new List<ColorScheme>();
|
||||
var enums = (ColorSchemes[])Enum.GetValues(typeof(ColorSchemes));
|
||||
foreach (var e in enums)
|
||||
{
|
||||
var key = $"DarkMode{e}";
|
||||
var key = $"ColorScheme{e}";
|
||||
var display = _translater.GetTranslation(key);
|
||||
var m = new DarkMode { Display = display, Value = e, };
|
||||
var m = new ColorScheme { Display = display, Value = e, };
|
||||
modes.Add(m);
|
||||
}
|
||||
return modes;
|
||||
|
|
|
|||
Loading…
Reference in a new issue