2019-08-13 18:02:26 +08:00
|
|
|
using System;
|
2016-05-23 03:50:06 +08:00
|
|
|
using System.Collections.ObjectModel;
|
2015-10-31 07:17:34 +08:00
|
|
|
using System.Drawing;
|
2016-03-25 09:22:24 +08:00
|
|
|
using Newtonsoft.Json;
|
2017-02-13 06:34:12 +08:00
|
|
|
using Newtonsoft.Json.Converters;
|
2016-05-24 05:08:13 +08:00
|
|
|
using Wox.Plugin;
|
2014-01-29 22:44:57 +08:00
|
|
|
|
2016-06-19 23:18:43 +08:00
|
|
|
namespace Wox.Infrastructure.UserSettings
|
2014-01-29 22:44:57 +08:00
|
|
|
{
|
2016-05-24 05:08:13 +08:00
|
|
|
public class Settings : BaseModel
|
2014-01-29 22:44:57 +08:00
|
|
|
{
|
2016-04-21 08:53:21 +08:00
|
|
|
public string Hotkey { get; set; } = "Alt + Space";
|
|
|
|
public string Language { get; set; } = "en";
|
|
|
|
public string Theme { get; set; } = "Dark";
|
|
|
|
public string QueryBoxFont { get; set; } = FontFamily.GenericSansSerif.Name;
|
2014-03-25 13:25:43 +08:00
|
|
|
public string QueryBoxFontStyle { get; set; }
|
|
|
|
public string QueryBoxFontWeight { get; set; }
|
|
|
|
public string QueryBoxFontStretch { get; set; }
|
2016-04-21 08:53:21 +08:00
|
|
|
public string ResultFont { get; set; } = FontFamily.GenericSansSerif.Name;
|
2016-02-21 23:19:42 +08:00
|
|
|
public string ResultFontStyle { get; set; }
|
|
|
|
public string ResultFontWeight { get; set; }
|
|
|
|
public string ResultFontStretch { get; set; }
|
2014-03-25 13:25:43 +08:00
|
|
|
|
2019-09-29 12:27:46 +08:00
|
|
|
private string _querySearchPrecision { get; set; } = StringMatcher.SearchPrecisionScore.Regular.ToString();
|
|
|
|
public string QuerySearchPrecision
|
|
|
|
{
|
|
|
|
get { return _querySearchPrecision; }
|
|
|
|
set
|
|
|
|
{
|
|
|
|
_querySearchPrecision = value;
|
|
|
|
StringMatcher.UserSettingSearchPrecision = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-13 18:02:26 +08:00
|
|
|
public bool AutoUpdates { get; set; } = false;
|
2016-05-12 10:01:33 +08:00
|
|
|
|
2014-06-16 14:06:24 +08:00
|
|
|
public double WindowLeft { get; set; }
|
|
|
|
public double WindowTop { get; set; }
|
2016-04-21 08:53:21 +08:00
|
|
|
public int MaxResultsToShow { get; set; } = 6;
|
|
|
|
public int ActivateTimes { get; set; }
|
2014-06-16 14:06:24 +08:00
|
|
|
|
2016-03-25 09:22:24 +08:00
|
|
|
// Order defaults to 0 or -1, so 1 will let this property appear last
|
|
|
|
[JsonProperty(Order = 1)]
|
2016-05-05 08:57:03 +08:00
|
|
|
public PluginsSettings PluginSettings { get; set; } = new PluginsSettings();
|
2016-05-23 03:50:06 +08:00
|
|
|
public ObservableCollection<CustomPluginHotkey> CustomPluginHotkeys { get; set; } = new ObservableCollection<CustomPluginHotkey>();
|
2014-03-23 16:17:41 +08:00
|
|
|
|
2015-01-26 22:50:38 +08:00
|
|
|
[Obsolete]
|
2016-04-21 08:53:21 +08:00
|
|
|
public double Opacity { get; set; } = 1;
|
2014-03-26 17:34:19 +08:00
|
|
|
|
2015-01-26 22:50:38 +08:00
|
|
|
[Obsolete]
|
2016-04-21 08:53:21 +08:00
|
|
|
public OpacityMode OpacityMode { get; set; } = OpacityMode.Normal;
|
2014-03-26 17:34:19 +08:00
|
|
|
|
2016-04-21 08:53:21 +08:00
|
|
|
public bool DontPromptUpdateMsg { get; set; }
|
|
|
|
public bool EnableUpdateLog { get; set; }
|
2014-04-11 05:44:57 +08:00
|
|
|
|
2016-05-19 02:35:34 +08:00
|
|
|
public bool StartWoxOnSystemStartup { get; set; } = true;
|
2016-05-14 21:48:58 +08:00
|
|
|
public bool HideOnStartup { get; set; }
|
2018-12-19 11:46:27 +08:00
|
|
|
bool _hideNotifyIcon { get; set; }
|
|
|
|
public bool HideNotifyIcon
|
|
|
|
{
|
|
|
|
get { return _hideNotifyIcon; }
|
|
|
|
set
|
|
|
|
{
|
|
|
|
_hideNotifyIcon = value;
|
|
|
|
OnPropertyChanged();
|
|
|
|
}
|
|
|
|
}
|
2016-04-21 08:53:21 +08:00
|
|
|
public bool LeaveCmdOpen { get; set; }
|
2019-10-24 05:20:12 +08:00
|
|
|
public bool HideWhenDeactive { get; set; } = true;
|
2015-02-20 21:45:42 +08:00
|
|
|
public bool RememberLastLaunchLocation { get; set; }
|
2015-10-08 07:02:36 +08:00
|
|
|
public bool IgnoreHotkeysOnFullscreen { get; set; }
|
2015-10-08 06:17:37 +08:00
|
|
|
|
2016-06-19 23:18:43 +08:00
|
|
|
public HttpProxy Proxy { get; set; } = new HttpProxy();
|
2017-02-13 06:34:12 +08:00
|
|
|
|
|
|
|
[JsonConverter(typeof(StringEnumConverter))]
|
|
|
|
public LastQueryMode LastQueryMode { get; set; } = LastQueryMode.Selected;
|
|
|
|
}
|
|
|
|
|
|
|
|
public enum LastQueryMode
|
|
|
|
{
|
|
|
|
Selected,
|
|
|
|
Empty,
|
|
|
|
Preserved
|
2014-03-26 17:34:19 +08:00
|
|
|
}
|
|
|
|
|
2016-05-05 08:57:03 +08:00
|
|
|
[Obsolete]
|
2014-03-26 17:34:19 +08:00
|
|
|
public enum OpacityMode
|
|
|
|
{
|
|
|
|
Normal = 0,
|
|
|
|
LayeredWindow = 1,
|
|
|
|
DWM = 2
|
2014-01-29 22:44:57 +08:00
|
|
|
}
|
2015-07-17 15:08:39 +08:00
|
|
|
}
|