From df65e2a568da6ccafad677b6791db9ede15f67f0 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Tue, 18 Mar 2025 17:00:33 -0500 Subject: [PATCH] get rid of the thumbnail setting (#575) --- .../Exts/Microsoft.CmdPal.Ext.Apps/AllAppsPage.cs | 11 +++++------ .../exts/Microsoft.CmdPal.Ext.Apps/AllAppsSettings.cs | 11 +---------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.Apps/AllAppsPage.cs b/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.Apps/AllAppsPage.cs index e968c136f4..ed724794fd 100644 --- a/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.Apps/AllAppsPage.cs +++ b/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.Apps/AllAppsPage.cs @@ -57,11 +57,10 @@ public sealed partial class AllAppsPage : ListPage Stopwatch stopwatch = new(); stopwatch.Start(); - var apps = GetPrograms(); + List apps = GetPrograms(); - var useThumbnails = AllAppsSettings.Instance.UseThumbnails; this.allAppsSection = apps - .Select((app) => new AppListItem(app, useThumbnails)) + .Select((app) => new AppListItem(app, true)) .ToArray(); this.IsLoading = false; @@ -74,7 +73,7 @@ public sealed partial class AllAppsPage : ListPage internal List GetPrograms() { - var uwpResults = AppCache.Instance.Value.UWPs + IEnumerable uwpResults = AppCache.Instance.Value.UWPs .Where((application) => application.Enabled) .Select(app => new AppItem() @@ -89,11 +88,11 @@ public sealed partial class AllAppsPage : ListPage Commands = app.GetCommands(), }); - var win32Results = AppCache.Instance.Value.Win32s + IEnumerable win32Results = AppCache.Instance.Value.Win32s .Where((application) => application.Enabled && application.Valid) .Select(app => { - var icoPath = string.IsNullOrEmpty(app.IcoPath) ? + string icoPath = string.IsNullOrEmpty(app.IcoPath) ? (app.AppType == Win32Program.ApplicationType.InternetShortcutApplication ? app.IcoPath : app.FullPath) : diff --git a/src/modules/cmdpal/exts/Microsoft.CmdPal.Ext.Apps/AllAppsSettings.cs b/src/modules/cmdpal/exts/Microsoft.CmdPal.Ext.Apps/AllAppsSettings.cs index f4ff524d8c..91d5cd5736 100644 --- a/src/modules/cmdpal/exts/Microsoft.CmdPal.Ext.Apps/AllAppsSettings.cs +++ b/src/modules/cmdpal/exts/Microsoft.CmdPal.Ext.Apps/AllAppsSettings.cs @@ -41,8 +41,6 @@ public class AllAppsSettings : JsonSettingsManager public bool EnablePathEnvironmentVariableSource => _enablePathEnvironmentVariableSource.Value; - public bool UseThumbnails => _useThumbnails.Value; - private readonly ToggleSetting _enableStartMenuSource = new( Namespaced(nameof(EnableStartMenuSource)), Resources.enable_start_menu_source, @@ -67,19 +65,13 @@ public class AllAppsSettings : JsonSettingsManager Resources.enable_path_environment_variable_source, false); // this one is very VERY noisy - private readonly ToggleSetting _useThumbnails = new( - Experimental(nameof(UseThumbnails)), - Resources.use_thumbnails_setting_label, - Resources.use_thumbnails_setting_description, - false); // This one can cause a crash on launch - public double MinScoreThreshold { get; set; } = 0.75; internal const char SuffixSeparator = ';'; internal static string SettingsJsonPath() { - var directory = Utilities.BaseSettingsPath("Microsoft.CmdPal"); + string directory = Utilities.BaseSettingsPath("Microsoft.CmdPal"); Directory.CreateDirectory(directory); // now, the state is just next to the exe @@ -94,7 +86,6 @@ public class AllAppsSettings : JsonSettingsManager Settings.Add(_enableDesktopSource); Settings.Add(_enableRegistrySource); Settings.Add(_enablePathEnvironmentVariableSource); - Settings.Add(_useThumbnails); // Load settings from file upon initialization LoadSettings();