| | | 1 | | using System.Collections.Generic; |
| | | 2 | | |
| | | 3 | | namespace SwitchBlade.Services |
| | | 4 | | { |
| | | 5 | | /// <summary> |
| | | 6 | | /// Represents all user-configurable settings for the application. |
| | | 7 | | /// Persisted to and loaded from the Windows Registry. |
| | | 8 | | /// </summary> |
| | | 9 | | public class UserSettings |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// List of process names to exclude from the window list. |
| | | 13 | | /// </summary> |
| | 255 | 14 | | public List<string> ExcludedProcesses { get; set; } = new List<string> { "SwitchBlade" }; |
| | | 15 | | |
| | | 16 | | /// <summary> |
| | | 17 | | /// List of plugin names that have been disabled by the user. |
| | | 18 | | /// </summary> |
| | 253 | 19 | | public List<string> DisabledPlugins { get; set; } = new List<string>(); |
| | | 20 | | |
| | | 21 | | /// <summary> |
| | | 22 | | /// Current theme name (e.g., "Light", "Dark"). |
| | | 23 | | /// </summary> |
| | 279 | 24 | | public string CurrentTheme { get; set; } = "Super Light"; |
| | | 25 | | |
| | | 26 | | // UI Options |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Whether to show live DWM thumbnails of the selected window. |
| | | 30 | | /// </summary> |
| | 245 | 31 | | public bool EnablePreviews { get; set; } = true; |
| | | 32 | | |
| | | 33 | | /// <summary> |
| | | 34 | | /// Duration of fade in/out animations in milliseconds. |
| | | 35 | | /// </summary> |
| | 216 | 36 | | public int FadeDurationMs { get; set; } = 200; |
| | | 37 | | |
| | | 38 | | /// <summary> |
| | | 39 | | /// Target opacity of the main window (0.0 to 1.0). |
| | | 40 | | /// </summary> |
| | 216 | 41 | | public double WindowOpacity { get; set; } = 1.0; |
| | | 42 | | |
| | | 43 | | /// <summary> |
| | | 44 | | /// Height of each item in the window list in pixels. |
| | | 45 | | /// </summary> |
| | 228 | 46 | | public double ItemHeight { get; set; } = 64.0; |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// Whether to show window icons in the list. |
| | | 50 | | /// </summary> |
| | 218 | 51 | | public bool ShowIcons { get; set; } = true; |
| | | 52 | | |
| | | 53 | | /// <summary> |
| | | 54 | | /// Whether to hide the taskbar icon (tray-only mode). |
| | | 55 | | /// </summary> |
| | 218 | 56 | | public bool HideTaskbarIcon { get; set; } = true; |
| | | 57 | | |
| | | 58 | | /// <summary> |
| | | 59 | | /// Whether to launch the application on Windows startup. |
| | | 60 | | /// </summary> |
| | 262 | 61 | | public bool LaunchOnStartup { get; set; } = false; |
| | | 62 | | |
| | | 63 | | /// <summary> |
| | | 64 | | /// Whether to run the application with Administrator privileges. |
| | | 65 | | /// Some plugins require this for full inspection of elevated windows. |
| | | 66 | | /// </summary> |
| | 238 | 67 | | public bool RunAsAdministrator { get; set; } = false; |
| | | 68 | | |
| | | 69 | | // Background Polling Options |
| | | 70 | | |
| | | 71 | | /// <summary> |
| | | 72 | | /// Whether to enable automatic background polling of window lists. |
| | | 73 | | /// </summary> |
| | 241 | 74 | | public bool EnableBackgroundPolling { get; set; } = true; |
| | | 75 | | |
| | | 76 | | /// <summary> |
| | | 77 | | /// Interval between background polls in seconds. |
| | | 78 | | /// </summary> |
| | 237 | 79 | | public int BackgroundPollingIntervalSeconds { get; set; } = 30; |
| | | 80 | | |
| | | 81 | | // Number Shortcuts (press 1-9, 0 to quick-switch) |
| | | 82 | | |
| | | 83 | | /// <summary> |
| | | 84 | | /// Whether to enable number key shortcuts for quick window switching. |
| | | 85 | | /// </summary> |
| | 256 | 86 | | public bool EnableNumberShortcuts { get; set; } = true; |
| | | 87 | | |
| | | 88 | | /// <summary> |
| | | 89 | | /// Whether to enable staggered badge animations when showing window list. |
| | | 90 | | /// </summary> |
| | 217 | 91 | | public bool EnableBadgeAnimations { get; set; } = true; |
| | | 92 | | |
| | | 93 | | /// <summary> |
| | | 94 | | /// Modifier key for number shortcuts. Values: Alt=1, Ctrl=2, Shift=4, Win=8, None=0. |
| | | 95 | | /// </summary> |
| | 258 | 96 | | public uint NumberShortcutModifier { get; set; } = ModifierKeyFlags.Alt; |
| | | 97 | | |
| | | 98 | | /// <summary> |
| | | 99 | | /// Behavior for preserving selection state when the window list refreshes. |
| | | 100 | | /// </summary> |
| | 258 | 101 | | public RefreshBehavior RefreshBehavior { get; set; } = RefreshBehavior.PreserveScroll; |
| | | 102 | | |
| | | 103 | | // Window Size |
| | | 104 | | |
| | | 105 | | /// <summary> |
| | | 106 | | /// Persisted width of the main window. |
| | | 107 | | /// </summary> |
| | 216 | 108 | | public double WindowWidth { get; set; } = 800.0; |
| | | 109 | | |
| | | 110 | | /// <summary> |
| | | 111 | | /// Persisted height of the main window. |
| | | 112 | | /// </summary> |
| | 214 | 113 | | public double WindowHeight { get; set; } = 600.0; |
| | | 114 | | |
| | | 115 | | // Hotkey Options (Defaults: Ctrl + Shift + Q) |
| | | 116 | | |
| | | 117 | | /// <summary> |
| | | 118 | | /// Modifier keys for the global hotkey. Values: Alt=1, Ctrl=2, Shift=4, Win=8 (can be combined). |
| | | 119 | | /// </summary> |
| | 222 | 120 | | public uint HotKeyModifiers { get; set; } = ModifierKeyFlags.Ctrl | ModifierKeyFlags.Shift; // 6 |
| | | 121 | | |
| | | 122 | | /// <summary> |
| | | 123 | | /// Virtual key code for the global hotkey. |
| | | 124 | | /// </summary> |
| | 222 | 125 | | public uint HotKeyKey { get; set; } = 0x51; // VK_Q |
| | | 126 | | |
| | | 127 | | /// <summary> |
| | | 128 | | /// Maximum number of compiled regex objects to cache for search operations. |
| | | 129 | | /// </summary> |
| | 223 | 130 | | public int RegexCacheSize { get; set; } = 50; |
| | | 131 | | |
| | | 132 | | /// <summary> |
| | | 133 | | /// Whether to enable fuzzy search for window matching. |
| | | 134 | | /// When enabled, searches use intelligent subsequence matching that treats |
| | | 135 | | /// spaces, underscores, and dashes as equivalent delimiters. |
| | | 136 | | /// When disabled, uses exact substring/regex matching. |
| | | 137 | | /// </summary> |
| | 245 | 138 | | public bool EnableFuzzySearch { get; set; } = true; |
| | | 139 | | |
| | | 140 | | /// <summary> |
| | | 141 | | /// Whether to highlight matching search characters in window titles with bold text. |
| | | 142 | | /// When enabled, characters matching the search query are displayed bold in the result list. |
| | | 143 | | /// </summary> |
| | 220 | 144 | | public bool EnableSearchHighlighting { get; set; } = true; |
| | | 145 | | |
| | | 146 | | /// <summary> |
| | | 147 | | /// Hex color string for search highlighting (format: #AARRGGBB or #RRGGBB). |
| | | 148 | | /// Default: Windows Blue (#FF0078D4). |
| | | 149 | | /// </summary> |
| | 224 | 150 | | public string SearchHighlightColor { get; set; } = "#FF0078D4"; |
| | | 151 | | |
| | | 152 | | /// <summary> |
| | | 153 | | /// Maximum number of icons to cache in memory. |
| | | 154 | | /// Caching prevents expensive icon extraction, but too many cached icons can cause memory growth. |
| | | 155 | | /// Default: 200. |
| | | 156 | | /// </summary> |
| | 204 | 157 | | public int IconCacheSize { get; set; } = 200; |
| | | 158 | | |
| | | 159 | | /// <summary> |
| | | 160 | | /// Timeout in seconds for the UIA Worker process. |
| | | 161 | | /// Increase this value if tab discovery fails on slower systems. |
| | | 162 | | /// Default: 60. |
| | | 163 | | /// </summary> |
| | 223 | 164 | | public int UiaWorkerTimeoutSeconds { get; set; } = 60; |
| | | 165 | | } |
| | | 166 | | } |