- Adjust Style

- Adjust General Page
This commit is contained in:
DB p 2024-04-28 20:58:28 +09:00
parent 6a2f23cf6b
commit c9fc49473b
5 changed files with 8 additions and 116 deletions

View file

@ -24,6 +24,7 @@
</ui:ThemeResources>
<ui:XamlControlsResources />
<ResourceDictionary Source="pack://application:,,,/Resources/CustomControlTemplate.xaml" />
<ResourceDictionary Source="pack://application:,,,/Resources/SettingWindowStyle.xaml" />
<ResourceDictionary Source="pack://application:,,,/Themes/Win11System.xaml" />
<ResourceDictionary Source="pack://application:,,,/Languages/en.xaml" />
</ResourceDictionary.MergedDictionaries>

View file

@ -11,14 +11,6 @@
d:DesignWidth="800"
Style="{DynamicResource SettingPageBasic}"
mc:Ignorable="d">
<Page.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Resources/SettingWindowStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<CollectionViewSource x:Key="SortedFonts" Source="{Binding Source={x:Static Fonts.SystemFontFamilies}}" />
</ResourceDictionary>
</Page.Resources>
<ScrollViewer
Margin="0,0,0,0"
Background="{DynamicResource Color01B}"

View file

@ -47,5 +47,7 @@ namespace Flow.Launcher.SettingPages.Views
}
base.OnNavigatedTo(e);
}
}
}

View file

@ -42,9 +42,6 @@
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Resources/SettingWindowStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<CollectionViewSource x:Key="SortedFonts" Source="{Binding Source={x:Static Fonts.SystemFontFamilies}}">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="Source" />

View file

@ -107,6 +107,10 @@ namespace Flow.Launcher.ViewModel
}
public CultureInfo Culture => CultureInfo.DefaultThreadCurrentCulture;
private Internationalization _translater => InternationalizationManager.Instance;
public string AlwaysPreviewToolTip =>
string.Format(_translater.GetTranslation("AlwaysPreviewToolTip"), Settings.PreviewHotkey);
public bool StartFlowLauncherOnSystemStartup
{
@ -191,109 +195,7 @@ namespace Flow.Launcher.ViewModel
}
}
#region general
// todo a better name?
public class LastQueryMode : BaseModel
{
public string Display { get; set; }
public Infrastructure.UserSettings.LastQueryMode Value { get; set; }
}
private List<LastQueryMode> _lastQueryModes = new List<LastQueryMode>();
public List<LastQueryMode> LastQueryModes
{
get
{
if (_lastQueryModes.Count == 0)
{
_lastQueryModes = InitLastQueryModes();
}
return _lastQueryModes;
}
}
private List<LastQueryMode> InitLastQueryModes()
{
var modes = new List<LastQueryMode>();
var enums = (Infrastructure.UserSettings.LastQueryMode[])Enum.GetValues(
typeof(Infrastructure.UserSettings.LastQueryMode));
foreach (var e in enums)
{
var key = $"LastQuery{e}";
var display = _translater.GetTranslation(key);
var m = new LastQueryMode { Display = display, Value = e, };
modes.Add(m);
}
return modes;
}
private void UpdateLastQueryModeDisplay()
{
foreach (var item in LastQueryModes)
{
item.Display = _translater.GetTranslation($"LastQuery{item.Value}");
}
}
public string Language
{
get
{
return Settings.Language;
}
set
{
InternationalizationManager.Instance.ChangeLanguage(value);
if (InternationalizationManager.Instance.PromptShouldUsePinyin(value))
ShouldUsePinyin = true;
UpdateLastQueryModeDisplay();
}
}
public bool ShouldUsePinyin
{
get
{
return Settings.ShouldUsePinyin;
}
set
{
Settings.ShouldUsePinyin = value;
}
}
public List<string> QuerySearchPrecisionStrings
{
get
{
var precisionStrings = new List<string>();
var enumList = Enum.GetValues(typeof(SearchPrecisionScore)).Cast<SearchPrecisionScore>().ToList();
enumList.ForEach(x => precisionStrings.Add(x.ToString()));
return precisionStrings;
}
}
public List<string> OpenResultModifiersList => new List<string>
{
KeyConstant.Alt, KeyConstant.Ctrl, $"{KeyConstant.Ctrl}+{KeyConstant.Alt}"
};
private Internationalization _translater => InternationalizationManager.Instance;
public List<Language> Languages => _translater.LoadAvailableLanguages();
public IEnumerable<int> MaxResultsRange => Enumerable.Range(2, 16);
public string AlwaysPreviewToolTip =>
string.Format(_translater.GetTranslation("AlwaysPreviewToolTip"), Settings.PreviewHotkey);
public string TestProxy()
{
var proxyServer = Settings.Proxy.Server;
@ -340,8 +242,6 @@ namespace Flow.Launcher.ViewModel
}
}
#endregion
#region plugin
public static string Plugin => @"https://github.com/Flow-Launcher/Flow.Launcher.PluginsManifest";