PowerLauncherProperties.cs
1 // Copyright (c) Microsoft Corporation 2 // The Microsoft Corporation licenses this file to you under the MIT license. 3 // See the LICENSE file in the project root for more information. 4 5 using System.Text.Json.Serialization; 6 7 using ManagedCommon; 8 using Settings.UI.Library.Attributes; 9 10 namespace Microsoft.PowerToys.Settings.UI.Library 11 { 12 public class PowerLauncherProperties 13 { 14 [JsonPropertyName("search_result_preference")] 15 [CmdConfigureIgnoreAttribute] 16 public string SearchResultPreference { get; set; } 17 18 [JsonPropertyName("search_type_preference")] 19 [CmdConfigureIgnoreAttribute] 20 public string SearchTypePreference { get; set; } 21 22 [JsonPropertyName("maximum_number_of_results")] 23 public int MaximumNumberOfResults { get; set; } 24 25 [JsonPropertyName("open_powerlauncher")] 26 public HotkeySettings OpenPowerLauncher { get; set; } 27 28 [JsonPropertyName("open_file_location")] 29 [CmdConfigureIgnoreAttribute] 30 public HotkeySettings OpenFileLocation { get; set; } 31 32 [JsonPropertyName("copy_path_location")] 33 [CmdConfigureIgnoreAttribute] 34 public HotkeySettings CopyPathLocation { get; set; } 35 36 [JsonPropertyName("open_console")] 37 [CmdConfigureIgnoreAttribute] 38 public HotkeySettings OpenConsole { get; set; } 39 40 [JsonPropertyName("override_win_r_key")] 41 [CmdConfigureIgnoreAttribute] 42 public bool OverrideWinkeyR { get; set; } 43 44 [JsonPropertyName("override_win_s_key")] 45 [CmdConfigureIgnoreAttribute] 46 public bool OverrideWinkeyS { get; set; } 47 48 [JsonPropertyName("ignore_hotkeys_in_fullscreen")] 49 public bool IgnoreHotkeysInFullscreen { get; set; } 50 51 [JsonPropertyName("clear_input_on_launch")] 52 public bool ClearInputOnLaunch { get; set; } 53 54 [JsonPropertyName("tab_selects_context_buttons")] 55 public bool TabSelectsContextButtons { get; set; } 56 57 [JsonPropertyName("theme")] 58 public Theme Theme { get; set; } 59 60 [JsonPropertyName("show_plugins_overview")] 61 [CmdConfigureIgnore] 62 public int ShowPluginsOverview { get; set; } 63 64 [JsonPropertyName("title_fontsize")] 65 public int TitleFontSize { get; set; } 66 67 [JsonPropertyName("startupPosition")] 68 public StartupPosition Position { get; set; } 69 70 [JsonPropertyName("use_centralized_keyboard_hook")] 71 public bool UseCentralizedKeyboardHook { get; set; } 72 73 [JsonPropertyName("search_query_results_with_delay")] 74 public bool SearchQueryResultsWithDelay { get; set; } 75 76 [JsonPropertyName("search_input_delay")] 77 public int SearchInputDelay { get; set; } 78 79 [JsonPropertyName("search_input_delay_fast")] 80 public int SearchInputDelayFast { get; set; } 81 82 [JsonPropertyName("search_clicked_item_weight")] 83 public int SearchClickedItemWeight { get; set; } 84 85 [JsonPropertyName("search_query_tuning_enabled")] 86 public bool SearchQueryTuningEnabled { get; set; } 87 88 [JsonPropertyName("search_wait_for_slow_results")] 89 public bool SearchWaitForSlowResults { get; set; } 90 91 [JsonPropertyName("use_pinyin")] 92 public bool UsePinyin { get; set; } 93 94 [JsonPropertyName("generate_thumbnails_from_files")] 95 public bool GenerateThumbnailsFromFiles { get; set; } 96 97 [JsonPropertyName("hotkey_changed")] 98 public bool HotkeyChanged { get; set; } = false; 99 100 [CmdConfigureIgnoreAttribute] 101 public HotkeySettings DefaultOpenPowerLauncher => new HotkeySettings(false, false, true, false, 32); 102 103 [CmdConfigureIgnoreAttribute] 104 public HotkeySettings DefaultOpenFileLocation => new HotkeySettings(); 105 106 [CmdConfigureIgnoreAttribute] 107 public HotkeySettings DefaultCopyPathLocation => new HotkeySettings(); 108 109 public PowerLauncherProperties() 110 { 111 OpenPowerLauncher = DefaultOpenPowerLauncher; 112 OpenFileLocation = DefaultOpenFileLocation; 113 CopyPathLocation = DefaultCopyPathLocation; 114 OpenConsole = new HotkeySettings(); 115 SearchResultPreference = "most_recently_used"; 116 SearchTypePreference = "application_name"; 117 IgnoreHotkeysInFullscreen = false; 118 ClearInputOnLaunch = false; 119 TabSelectsContextButtons = true; 120 MaximumNumberOfResults = 4; 121 Theme = Theme.System; 122 Position = StartupPosition.Cursor; 123 UseCentralizedKeyboardHook = false; 124 SearchQueryResultsWithDelay = true; 125 SearchInputDelayFast = 50; 126 SearchInputDelay = 150; 127 SearchClickedItemWeight = 5; 128 SearchQueryTuningEnabled = false; 129 SearchWaitForSlowResults = false; 130 GenerateThumbnailsFromFiles = true; 131 UsePinyin = false; 132 ShowPluginsOverview = 0; 133 TitleFontSize = 16; 134 } 135 } 136 }