Compare commits

..

1 Commits

Author SHA1 Message Date
Leilei Zhang
7c7c9cf43c Revert "[Peek] Use WebView2 for SVG preview to improve compatibility (#44209)"
This reverts commit d32ea86314.
2025-12-29 11:02:51 +08:00
52 changed files with 233 additions and 2492 deletions

View File

@@ -58,8 +58,8 @@ string validUIDisplayString = Resources.ValidUIDisplayString;
## More On Coding Guidance
Please review these brief docs below relating to our coding standards, etc.
* [Coding Style](development/style.md)
* [Code Organization](readme.md)
* [Coding Style](./style.md)
* [Code Organization](./readme.md)
[VS Resource Editor]: https://learn.microsoft.com/cpp/windows/resource-editors?view=vs-2019

View File

@@ -57,7 +57,7 @@ Once you've discussed your proposed feature/fix/etc. with a team member, and an
## Rules
- **Follow the pattern of what you already see in the code.**
- [Coding style](development/style.md).
- [Coding style](style.md).
- Try to package new functionality/components into libraries that have nicely defined interfaces.
- Package new functionality into classes or refactor existing functionality into a class as you extend the code.
- When adding new classes/methods/changing existing code, add new unit tests or update the existing tests.

View File

@@ -50,7 +50,6 @@ Contact the developers of a plugin directly for assistance with a specific plugi
| [Hotkeys](https://github.com/ruslanlap/PowerToysRun-Hotkeys) | [ruslanlap](https://github.com/ruslanlap) | Create, manage, and trigger custom keyboard shortcuts directly from PowerToys Run. |
| [RandomGen](https://github.com/ruslanlap/PowerToysRun-RandomGen) | [ruslanlap](https://github.com/ruslanlap) | 🎲 Generate random data instantly with a single keystroke. Perfect for developers, testers, designers, and anyone who needs quick access to random data. Features include secure passwords, PINs, names, business data, dates, numbers, GUIDs, color codes, and more. Especially useful for designers who need random color codes and placeholder content. |
| [Open With Cursor](https://github.com/VictorNoxx/PowerToys-Run-Cursor/) | [VictorNoxx](https://github.com/VictorNoxx) | Open Visual Studio, VS Code recents with Cursor AI |
| [Open With Antygravity](https://github.com/artickc/PowerToys-Run-Antygravity) | [artickc](https://github.com/artickc) | Open Visual Studio, VS Code recents with Cursor AI |
| [CheatSheets](https://github.com/ruslanlap/PowerToysRun-CheatSheets) | [ruslanlap](https://github.com/ruslanlap) | 📚 Find cheat sheets and command examples instantly from tldr pages, cheat.sh, and devhints.io. Features include favorites system, categories, offline mode, and smart caching. |
| [QuickAI](https://github.com/ruslanlap/PowerToysRun-QuickAi) | [ruslanlap](https://github.com/ruslanlap) | AI-powered assistance with instant, smart responses from multiple providers (Groq, Together, Fireworks, OpenRouter, Cohere) |

View File

@@ -466,39 +466,27 @@
TextChanged="EditVariableDialogValueTxtBox_TextChanged"
TextWrapping="Wrap" />
<MenuFlyoutSeparator Visibility="{Binding ShowAsList, Converter={StaticResource BoolToVisibilityConverter}}" />
<ListView
<ItemsControl
x:Name="EditVariableValuesList"
Margin="0,-8,0,12"
HorizontalAlignment="Stretch"
AllowDrop="True"
CanDragItems="True"
CanReorderItems="True"
DragItemsCompleted="EditVariableValuesList_DragItemsCompleted"
ItemsSource="{Binding ValuesList, Mode=TwoWay}"
Visibility="{Binding ShowAsList, Converter={StaticResource BoolToVisibilityConverter}}">
<ListView.ItemTemplate>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="32" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="40" />
</Grid.ColumnDefinitions>
<FontIcon
Grid.Column="0"
Margin="0,0,8,0"
FontSize="16"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Glyph="&#xE759;" />
<TextBox
Grid.Column="1"
Background="Transparent"
BorderBrush="Transparent"
LostFocus="EditVariableValuesListTextBox_LostFocus"
Text="{Binding Text}" />
<Button
x:Uid="More_Options_Button"
Grid.Column="2"
Grid.Column="1"
VerticalAlignment="Center"
Content="&#xE712;"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
@@ -535,8 +523,8 @@
</Button>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
</ContentDialog>

View File

@@ -16,8 +16,6 @@ namespace EnvironmentVariablesUILib
{
public sealed partial class EnvironmentVariablesMainPage : Page
{
private const string ValueListSeparator = ";";
private sealed class RelayCommandParameter
{
public RelayCommandParameter(Variable variable, VariablesSet set)
@@ -442,7 +440,7 @@ namespace EnvironmentVariablesUILib
variable.ValuesList.Move(index, index - 1);
}
var newValues = string.Join(ValueListSeparator, variable.ValuesList?.Select(x => x.Text).ToArray());
var newValues = string.Join(";", variable.ValuesList?.Select(x => x.Text).ToArray());
EditVariableDialogValueTxtBox.Text = newValues;
}
@@ -463,7 +461,7 @@ namespace EnvironmentVariablesUILib
variable.ValuesList.Move(index, index + 1);
}
var newValues = string.Join(ValueListSeparator, variable.ValuesList?.Select(x => x.Text).ToArray());
var newValues = string.Join(";", variable.ValuesList?.Select(x => x.Text).ToArray());
EditVariableDialogValueTxtBox.Text = newValues;
}
@@ -478,7 +476,7 @@ namespace EnvironmentVariablesUILib
var variable = EditVariableDialog.DataContext as Variable;
variable.ValuesList.Remove(listItem);
var newValues = string.Join(ValueListSeparator, variable.ValuesList?.Select(x => x.Text).ToArray());
var newValues = string.Join(";", variable.ValuesList?.Select(x => x.Text).ToArray());
EditVariableDialogValueTxtBox.Text = newValues;
}
@@ -494,7 +492,7 @@ namespace EnvironmentVariablesUILib
var index = variable.ValuesList.IndexOf(listItem);
variable.ValuesList.Insert(index, new Variable.ValuesListItem { Text = string.Empty });
var newValues = string.Join(ValueListSeparator, variable.ValuesList?.Select(x => x.Text).ToArray());
var newValues = string.Join(";", variable.ValuesList?.Select(x => x.Text).ToArray());
EditVariableDialogValueTxtBox.TextChanged -= EditVariableDialogValueTxtBox_TextChanged;
EditVariableDialogValueTxtBox.Text = newValues;
EditVariableDialogValueTxtBox.TextChanged += EditVariableDialogValueTxtBox_TextChanged;
@@ -512,7 +510,7 @@ namespace EnvironmentVariablesUILib
var index = variable.ValuesList.IndexOf(listItem);
variable.ValuesList.Insert(index + 1, new Variable.ValuesListItem { Text = string.Empty });
var newValues = string.Join(ValueListSeparator, variable.ValuesList?.Select(x => x.Text).ToArray());
var newValues = string.Join(";", variable.ValuesList?.Select(x => x.Text).ToArray());
EditVariableDialogValueTxtBox.TextChanged -= EditVariableDialogValueTxtBox_TextChanged;
EditVariableDialogValueTxtBox.Text = newValues;
EditVariableDialogValueTxtBox.TextChanged += EditVariableDialogValueTxtBox_TextChanged;
@@ -534,7 +532,7 @@ namespace EnvironmentVariablesUILib
listItem.Text = (sender as TextBox)?.Text;
var variable = EditVariableDialog.DataContext as Variable;
var newValues = string.Join(ValueListSeparator, variable.ValuesList?.Select(x => x.Text).ToArray());
var newValues = string.Join(";", variable.ValuesList?.Select(x => x.Text).ToArray());
EditVariableDialogValueTxtBox.TextChanged -= EditVariableDialogValueTxtBox_TextChanged;
EditVariableDialogValueTxtBox.Text = newValues;
EditVariableDialogValueTxtBox.TextChanged += EditVariableDialogValueTxtBox_TextChanged;
@@ -550,16 +548,5 @@ namespace EnvironmentVariablesUILib
CancelAddVariable();
ConfirmAddVariableBtn.IsEnabled = false;
}
private void EditVariableValuesList_DragItemsCompleted(ListViewBase sender, DragItemsCompletedEventArgs args)
{
if (EditVariableDialog.DataContext is Variable variable && variable.ValuesList != null)
{
var newValues = string.Join(ValueListSeparator, variable.ValuesList.Select(x => x.Text));
EditVariableDialogValueTxtBox.TextChanged -= EditVariableDialogValueTxtBox_TextChanged;
EditVariableDialogValueTxtBox.Text = newValues;
EditVariableDialogValueTxtBox.TextChanged += EditVariableDialogValueTxtBox_TextChanged;
}
}
}
}

View File

@@ -8,7 +8,6 @@ using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
namespace PowerToysExtension.Pages;
@@ -25,15 +24,15 @@ internal sealed partial class FancyZonesMonitorListItem : ListItem
var pickerPage = new FancyZonesMonitorLayoutPickerPage(monitor)
{
Name = Resources.FancyZones_SetActiveLayout,
Name = "Set active layout",
};
MoreCommands =
[
new CommandContextItem(pickerPage)
{
Title = Resources.FancyZones_SetActiveLayout,
Subtitle = Resources.FancyZones_PickLayoutForMonitor,
Title = "Set active layout",
Subtitle = "Pick a layout for this monitor",
},
];
}
@@ -43,14 +42,14 @@ internal sealed partial class FancyZonesMonitorListItem : ListItem
var currentVirtualDesktop = FancyZonesVirtualDesktop.GetCurrentVirtualDesktopIdString();
var tags = new List<IDetailsElement>
{
DetailTag(Resources.FancyZones_Monitor, monitor.Data.Monitor),
DetailTag(Resources.FancyZones_Instance, monitor.Data.MonitorInstanceId),
DetailTag(Resources.FancyZones_Serial, monitor.Data.MonitorSerialNumber),
DetailTag(Resources.FancyZones_Number, monitor.Data.MonitorNumber.ToString(CultureInfo.InvariantCulture)),
DetailTag(Resources.FancyZones_VirtualDesktop, currentVirtualDesktop),
DetailTag(Resources.FancyZones_WorkArea, $"{monitor.Data.LeftCoordinate},{monitor.Data.TopCoordinate} {monitor.Data.WorkAreaWidth}\u00D7{monitor.Data.WorkAreaHeight}"),
DetailTag(Resources.FancyZones_Resolution, $"{monitor.Data.MonitorWidth}\u00D7{monitor.Data.MonitorHeight}"),
DetailTag(Resources.FancyZones_DPI, monitor.Data.Dpi.ToString(CultureInfo.InvariantCulture)),
DetailTag("Monitor", monitor.Data.Monitor),
DetailTag("Instance", monitor.Data.MonitorInstanceId),
DetailTag("Serial", monitor.Data.MonitorSerialNumber),
DetailTag("Number", monitor.Data.MonitorNumber.ToString(CultureInfo.InvariantCulture)),
DetailTag("Virtual desktop", currentVirtualDesktop),
DetailTag("Work area", $"{monitor.Data.LeftCoordinate},{monitor.Data.TopCoordinate} {monitor.Data.WorkAreaWidth}\u00D7{monitor.Data.WorkAreaHeight}"),
DetailTag("Resolution", $"{monitor.Data.MonitorWidth}\u00D7{monitor.Data.MonitorHeight}"),
DetailTag("DPI", monitor.Data.Dpi.ToString(CultureInfo.InvariantCulture)),
};
return new Details
@@ -69,7 +68,7 @@ internal sealed partial class FancyZonesMonitorListItem : ListItem
Key = key,
Data = new DetailsTags
{
Tags = [new Tag(string.IsNullOrWhiteSpace(value) ? Resources.Common_NotAvailable : value)],
Tags = [new Tag(string.IsNullOrWhiteSpace(value) ? "n/a" : value)],
},
};
}

View File

@@ -5,24 +5,15 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using WorkspacesCsharpLibrary.Data;
namespace PowerToysExtension.Commands;
internal sealed partial class WorkspaceListItem : ListItem
{
private static readonly CompositeFormat ApplicationsFormat = CompositeFormat.Parse(Resources.Workspaces_Applications_Format);
private static readonly CompositeFormat LastLaunchedFormat = CompositeFormat.Parse(Resources.Workspaces_LastLaunched_Format);
private static readonly CompositeFormat ApplicationsCountFormat = CompositeFormat.Parse(Resources.Workspaces_ApplicationsCount_Format);
private static readonly CompositeFormat MinAgoFormat = CompositeFormat.Parse(Resources.Workspaces_MinAgo_Format);
private static readonly CompositeFormat HrAgoFormat = CompositeFormat.Parse(Resources.Workspaces_HrAgo_Format);
private static readonly CompositeFormat DaysAgoFormat = CompositeFormat.Parse(Resources.Workspaces_DaysAgo_Format);
public WorkspaceListItem(ProjectWrapper workspace, IconInfo icon)
: base(new LaunchWorkspaceCommand(workspace.Id))
{
@@ -37,13 +28,13 @@ internal sealed partial class WorkspaceListItem : ListItem
var appCount = workspace.Applications?.Count ?? 0;
var appsText = appCount switch
{
0 => Resources.Workspaces_NoApplications,
_ => string.Format(CultureInfo.CurrentCulture, ApplicationsFormat, appCount),
0 => "No applications",
_ => string.Format(CultureInfo.CurrentCulture, "{0} applications", appCount),
};
var lastLaunched = workspace.LastLaunchedTime > 0
? string.Format(CultureInfo.CurrentCulture, LastLaunchedFormat, FormatRelativeTime(workspace.LastLaunchedTime))
: Resources.Workspaces_NeverLaunched;
? $"Last launched {FormatRelativeTime(workspace.LastLaunchedTime)}"
: "Never launched";
return $"{appsText} \u2022 {lastLaunched}";
}
@@ -53,15 +44,15 @@ internal sealed partial class WorkspaceListItem : ListItem
var appCount = workspace.Applications?.Count ?? 0;
var body = appCount switch
{
0 => Resources.Workspaces_NoApplicationsInWorkspace,
1 => Resources.Workspaces_OneApplication,
_ => string.Format(CultureInfo.CurrentCulture, ApplicationsCountFormat, appCount),
0 => "No applications in this workspace",
1 => "1 application",
_ => $"{appCount} applications",
};
return new Details
{
HeroImage = icon,
Title = workspace.Name ?? Resources.Workspaces_Workspace,
Title = workspace.Name ?? "Workspace",
Body = body,
Metadata = BuildAppMetadata(workspace),
};
@@ -77,7 +68,7 @@ internal sealed partial class WorkspaceListItem : ListItem
var elements = new List<IDetailsElement>();
foreach (var app in workspace.Applications)
{
var appName = string.IsNullOrWhiteSpace(app.Application) ? Resources.Workspaces_App : app.Application;
var appName = string.IsNullOrWhiteSpace(app.Application) ? "App" : app.Application;
var title = string.IsNullOrWhiteSpace(app.Title) ? appName : app.Title;
var tags = new List<ITag>();
@@ -108,19 +99,19 @@ internal sealed partial class WorkspaceListItem : ListItem
if (delta.TotalMinutes < 1)
{
return Resources.Workspaces_JustNow;
return "just now";
}
if (delta.TotalMinutes < 60)
{
return string.Format(CultureInfo.CurrentCulture, MinAgoFormat, (int)delta.TotalMinutes);
return string.Format(CultureInfo.CurrentCulture, "{0} min ago", (int)delta.TotalMinutes);
}
if (delta.TotalHours < 24)
{
return string.Format(CultureInfo.CurrentCulture, HrAgoFormat, (int)delta.TotalHours);
return string.Format(CultureInfo.CurrentCulture, "{0} hr ago", (int)delta.TotalHours);
}
return string.Format(CultureInfo.CurrentCulture, DaysAgoFormat, (int)delta.TotalDays);
return string.Format(CultureInfo.CurrentCulture, "{0} days ago", (int)delta.TotalDays);
}
}

View File

@@ -4,16 +4,13 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.Json;
using FancyZonesEditorCommon.Data;
using FancyZonesEditorCommon.Utils;
using ManagedCommon;
using PowerToysExtension.Properties;
using FZPaths = FancyZonesEditorCommon.Data.FancyZonesPaths;
@@ -23,15 +20,6 @@ internal static class FancyZonesDataService
{
private const string ZeroUuid = "{00000000-0000-0000-0000-000000000000}";
private static readonly CompositeFormat ReadMonitorDataFailedFormat = CompositeFormat.Parse(Resources.FancyZones_ReadMonitorDataFailed_Format);
private static readonly CompositeFormat WriteAppliedLayoutsFailedFormat = CompositeFormat.Parse(Resources.FancyZones_WriteAppliedLayoutsFailed_Format);
private static readonly CompositeFormat LayoutAppliedNotifyFailedFormat = CompositeFormat.Parse(Resources.FancyZones_LayoutAppliedNotifyFailed_Format);
private static readonly CompositeFormat TemplateFormat = CompositeFormat.Parse(Resources.FancyZones_Template_Format);
private static readonly CompositeFormat ZonesFormat = CompositeFormat.Parse(Resources.FancyZones_Zones_Format);
private static readonly CompositeFormat CustomGridZonesFormat = CompositeFormat.Parse(Resources.FancyZones_CustomGrid_Zones_Format);
private static readonly CompositeFormat CustomCanvasZonesFormat = CompositeFormat.Parse(Resources.FancyZones_CustomCanvas_Zones_Format);
private static readonly CompositeFormat CustomZonesFormat = CompositeFormat.Parse(Resources.FancyZones_Custom_Zones_Format);
public static bool TryGetMonitors(out IReadOnlyList<FancyZonesMonitorDescriptor> monitors, out string error)
{
monitors = Array.Empty<FancyZonesMonitorDescriptor>();
@@ -43,7 +31,7 @@ internal static class FancyZonesDataService
{
if (!File.Exists(FZPaths.EditorParameters))
{
error = Resources.FancyZones_MonitorDataNotFound;
error = "FancyZones monitor data not found. Open FancyZones Editor once to initialize.";
Logger.LogWarning($"TryGetMonitors: File not found. Path={FZPaths.EditorParameters}");
return false;
}
@@ -55,7 +43,7 @@ internal static class FancyZonesDataService
var editorMonitors = editorParams.Monitors;
if (editorMonitors is null || editorMonitors.Count == 0)
{
error = Resources.FancyZones_NoFancyZonesMonitorsFound;
error = "No FancyZones monitors found.";
Logger.LogWarning($"TryGetMonitors: No monitors in file.");
return false;
}
@@ -68,7 +56,7 @@ internal static class FancyZonesDataService
}
catch (Exception ex)
{
error = string.Format(CultureInfo.CurrentCulture, ReadMonitorDataFailedFormat, ex.Message);
error = $"Failed to read FancyZones monitor data: {ex.Message}";
Logger.LogError($"TryGetMonitors: Exception. Message={ex.Message} Stack={ex.StackTrace}");
return false;
}
@@ -216,7 +204,7 @@ internal static class FancyZonesDataService
}
catch (Exception ex)
{
return (false, string.Format(CultureInfo.CurrentCulture, WriteAppliedLayoutsFailedFormat, ex.Message));
return (false, $"Failed to write applied layouts: {ex.Message}");
}
try
@@ -225,10 +213,10 @@ internal static class FancyZonesDataService
}
catch (Exception ex)
{
return (true, string.Format(CultureInfo.CurrentCulture, LayoutAppliedNotifyFailedFormat, ex.Message));
return (true, $"Layout applied, but FancyZones could not be notified: {ex.Message}");
}
return (true, Resources.FancyZones_LayoutApplied);
return (true, "Layout applied.");
}
private static AppliedLayouts.AppliedLayoutWrapper? FindAppliedLayoutEntry(AppliedLayouts.AppliedLayoutsListWrapper file, EditorParameters.NativeMonitorDataWrapper monitor, string virtualDesktopId)
@@ -305,8 +293,8 @@ internal static class FancyZonesDataService
var zoneCount = type.Equals("blank", StringComparison.OrdinalIgnoreCase)
? 0
: template.ZoneCount > 0 ? template.ZoneCount : 3;
var title = string.Format(CultureInfo.CurrentCulture, TemplateFormat, type);
var subtitle = string.Format(CultureInfo.CurrentCulture, ZonesFormat, zoneCount);
var title = $"Template: {type}";
var subtitle = $"{zoneCount} zones";
yield return new FancyZonesLayoutDescriptor
{
@@ -369,9 +357,9 @@ internal static class FancyZonesDataService
var title = custom.Name.Trim();
var subtitle = customType switch
{
"grid" => string.Format(CultureInfo.CurrentCulture, CustomGridZonesFormat, applied.ZoneCount),
"canvas" => string.Format(CultureInfo.CurrentCulture, CustomCanvasZonesFormat, applied.ZoneCount),
_ => string.Format(CultureInfo.CurrentCulture, CustomZonesFormat, applied.ZoneCount),
"grid" => $"Custom grid \u2022 {applied.ZoneCount} zones",
"canvas" => $"Custom canvas \u2022 {applied.ZoneCount} zones",
_ => $"Custom \u2022 {applied.ZoneCount} zones",
};
yield return new FancyZonesLayoutDescriptor

View File

@@ -61,21 +61,6 @@
<ProjectReference Include="..\..\..\Workspaces\Workspaces.ModuleServices\Workspaces.ModuleServices.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<PropertyGroup>
<!-- Always build/publish AOT so the extension ships as native code -->
<SelfContained>true</SelfContained>

View File

@@ -7,7 +7,6 @@ using Common.UI;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
namespace PowerToysExtension.Modules;
@@ -23,8 +22,8 @@ internal sealed class AdvancedPasteModuleCommandProvider : ModuleCommandProvider
{
yield return new ListItem(new OpenAdvancedPasteCommand())
{
Title = Resources.AdvancedPaste_Open_Title,
Subtitle = Resources.AdvancedPaste_Open_Subtitle,
Title = "Open Advanced Paste",
Subtitle = "Launch the Advanced Paste UI",
Icon = icon,
};
}
@@ -32,7 +31,7 @@ internal sealed class AdvancedPasteModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.AdvancedPaste_Settings_Subtitle,
Subtitle = "Open Advanced Paste settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -21,7 +20,7 @@ internal sealed class AlwaysOnTopModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(SettingsWindow.AlwaysOnTop, title))
{
Title = title,
Subtitle = Resources.AlwaysOnTop_Settings_Subtitle,
Subtitle = "Open Always On Top settings",
Icon = icon,
};
}

View File

@@ -10,7 +10,6 @@ using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Pages;
using PowerToysExtension.Properties;
namespace PowerToysExtension.Modules;
@@ -27,7 +26,7 @@ internal sealed class AwakeModuleCommandProvider : ModuleCommandProvider
items.Add(new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.Awake_Settings_Subtitle,
Subtitle = "Open Awake settings",
Icon = moduleIcon,
});
@@ -50,40 +49,40 @@ internal sealed class AwakeModuleCommandProvider : ModuleCommandProvider
statusItem = new ListItem(new CommandItem(refreshCommand))
{
Title = Resources.Awake_Status_Title,
Title = "Awake: Current status",
Subtitle = AwakeStatusService.GetStatusSubtitle(),
Icon = icon,
};
items.Add(statusItem);
items.Add(new ListItem(new StartAwakeCommand(Resources.Awake_KeepIndefinite_Title, () => AwakeService.Instance.SetIndefiniteAsync(), Resources.Awake_SetIndefinite_Toast, refreshStatus))
items.Add(new ListItem(new StartAwakeCommand("Awake: Keep awake indefinitely", () => AwakeService.Instance.SetIndefiniteAsync(), "Awake set to indefinite", refreshStatus))
{
Title = Resources.Awake_KeepIndefinite_Title,
Subtitle = Resources.Awake_KeepIndefinite_Subtitle,
Title = "Awake: Keep awake indefinitely",
Subtitle = "Run Awake in indefinite mode",
Icon = icon,
});
items.Add(new ListItem(new StartAwakeCommand(Resources.Awake_Keep30Min_Title, () => AwakeService.Instance.SetTimedAsync(30), Resources.Awake_Set30Min_Toast, refreshStatus))
items.Add(new ListItem(new StartAwakeCommand("Awake: Keep awake for 30 minutes", () => AwakeService.Instance.SetTimedAsync(30), "Awake set for 30 minutes", refreshStatus))
{
Title = Resources.Awake_Keep30Min_Title,
Subtitle = Resources.Awake_Keep30Min_Subtitle,
Title = "Awake: Keep awake for 30 minutes",
Subtitle = "Run Awake timed for 30 minutes",
Icon = icon,
});
items.Add(new ListItem(new StartAwakeCommand(Resources.Awake_Keep1Hour_Title, () => AwakeService.Instance.SetTimedAsync(60), Resources.Awake_Set1Hour_Toast, refreshStatus))
items.Add(new ListItem(new StartAwakeCommand("Awake: Keep awake for 1 hour", () => AwakeService.Instance.SetTimedAsync(60), "Awake set for 1 hour", refreshStatus))
{
Title = Resources.Awake_Keep1Hour_Title,
Subtitle = Resources.Awake_Keep1Hour_Subtitle,
Title = "Awake: Keep awake for 1 hour",
Subtitle = "Run Awake timed for 1 hour",
Icon = icon,
});
items.Add(new ListItem(new StartAwakeCommand(Resources.Awake_Keep2Hours_Title, () => AwakeService.Instance.SetTimedAsync(120), Resources.Awake_Set2Hours_Toast, refreshStatus))
items.Add(new ListItem(new StartAwakeCommand("Awake: Keep awake for 2 hours", () => AwakeService.Instance.SetTimedAsync(120), "Awake set for 2 hours", refreshStatus))
{
Title = Resources.Awake_Keep2Hours_Title,
Subtitle = Resources.Awake_Keep2Hours_Subtitle,
Title = "Awake: Keep awake for 2 hours",
Subtitle = "Run Awake timed for 2 hours",
Icon = icon,
});
items.Add(new ListItem(new StopAwakeCommand(refreshStatus))
{
Title = Resources.Awake_TurnOff_Title,
Subtitle = Resources.Awake_TurnOff_Subtitle,
Title = "Awake: Turn off",
Subtitle = "Switch Awake back to Off",
Icon = icon,
});

View File

@@ -8,7 +8,6 @@ using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Pages;
using PowerToysExtension.Properties;
namespace PowerToysExtension.Modules;
@@ -25,7 +24,7 @@ internal sealed class ColorPickerModuleCommandProvider : ModuleCommandProvider
commands.Add(new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.ColorPicker_Settings_Subtitle,
Subtitle = "Open Color Picker settings",
Icon = icon,
});
@@ -37,15 +36,15 @@ internal sealed class ColorPickerModuleCommandProvider : ModuleCommandProvider
// Direct entries in the module list.
commands.Add(new ListItem(new OpenColorPickerCommand())
{
Title = Resources.ColorPicker_Open_Title,
Subtitle = Resources.ColorPicker_Open_Subtitle,
Title = "Open Color Picker",
Subtitle = "Start a color pick session",
Icon = icon,
});
commands.Add(new ListItem(new CommandItem(new ColorPickerSavedColorsPage()))
{
Title = Resources.ColorPicker_SavedColors_Title,
Subtitle = Resources.ColorPicker_SavedColors_Subtitle,
Title = "Saved colors",
Subtitle = "Browse and copy saved colors",
Icon = icon,
});

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -21,7 +20,7 @@ internal sealed class CommandNotFoundModuleCommandProvider : ModuleCommandProvid
yield return new ListItem(new OpenInSettingsCommand(SettingsWindow.CmdNotFound, title))
{
Title = title,
Subtitle = Resources.CommandNotFound_Settings_Subtitle,
Subtitle = "Open Command Not Found settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -23,15 +22,15 @@ internal sealed class CropAndLockModuleCommandProvider : ModuleCommandProvider
{
yield return new ListItem(new CropAndLockReparentCommand())
{
Title = Resources.CropAndLock_Reparent_Title,
Subtitle = Resources.CropAndLock_Reparent_Subtitle,
Title = "Crop and Lock (Reparent)",
Subtitle = "Create a cropped reparented window",
Icon = icon,
};
yield return new ListItem(new CropAndLockThumbnailCommand())
{
Title = Resources.CropAndLock_Thumbnail_Title,
Subtitle = Resources.CropAndLock_Thumbnail_Subtitle,
Title = "Crop and Lock (Thumbnail)",
Subtitle = "Create a cropped thumbnail window",
Icon = icon,
};
}
@@ -39,7 +38,7 @@ internal sealed class CropAndLockModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.CropAndLock_Settings_Subtitle,
Subtitle = "Open Crop and Lock settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -23,15 +22,15 @@ internal sealed class EnvironmentVariablesModuleCommandProvider : ModuleCommandP
{
yield return new ListItem(new OpenEnvironmentVariablesCommand())
{
Title = Resources.EnvironmentVariables_Open_Title,
Subtitle = Resources.EnvironmentVariables_Open_Subtitle,
Title = "Open Environment Variables",
Subtitle = "Launch Environment Variables editor",
Icon = icon,
};
yield return new ListItem(new OpenEnvironmentVariablesAdminCommand())
{
Title = Resources.EnvironmentVariables_OpenAdmin_Title,
Subtitle = Resources.EnvironmentVariables_OpenAdmin_Subtitle,
Title = "Open Environment Variables (Admin)",
Subtitle = "Launch Environment Variables editor as admin",
Icon = icon,
};
}
@@ -39,7 +38,7 @@ internal sealed class EnvironmentVariablesModuleCommandProvider : ModuleCommandP
yield return new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.EnvironmentVariables_Settings_Subtitle,
Subtitle = "Open Environment Variables settings",
Icon = icon,
};
}

View File

@@ -7,7 +7,6 @@ using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Pages;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -24,22 +23,22 @@ internal sealed class FancyZonesModuleCommandProvider : ModuleCommandProvider
{
yield return new ListItem(new CommandItem(new FancyZonesLayoutsPage()))
{
Title = Resources.FancyZones_Layouts_Title,
Subtitle = Resources.FancyZones_Layouts_Subtitle,
Title = "FancyZones: Layouts",
Subtitle = "Apply a layout to all monitors or a specific monitor",
Icon = icon,
};
yield return new ListItem(new CommandItem(new FancyZonesMonitorsPage()))
{
Title = Resources.FancyZones_Monitors_Title,
Subtitle = Resources.FancyZones_Monitors_Subtitle,
Title = "FancyZones: Monitors",
Subtitle = "Identify monitors and apply layouts",
Icon = icon,
};
yield return new ListItem(new OpenFancyZonesEditorCommand())
{
Title = Resources.FancyZones_OpenEditor_Title,
Subtitle = Resources.FancyZones_OpenEditor_Subtitle,
Title = "Open FancyZones Editor",
Subtitle = "Launch layout editor",
Icon = icon,
};
}
@@ -47,7 +46,7 @@ internal sealed class FancyZonesModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.FancyZones_Settings_Subtitle,
Subtitle = "Open FancyZones settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -21,7 +20,7 @@ internal sealed class FileExplorerAddonsModuleCommandProvider : ModuleCommandPro
yield return new ListItem(new OpenInSettingsCommand(SettingsWindow.FileExplorer, title))
{
Title = title,
Subtitle = Resources.FileExplorerAddons_Settings_Subtitle,
Subtitle = "Open File Explorer add-ons settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -21,7 +20,7 @@ internal sealed class FileLocksmithModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(SettingsWindow.FileLocksmith, title))
{
Title = title,
Subtitle = Resources.FileLocksmith_Settings_Subtitle,
Subtitle = "Open File Locksmith settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -23,15 +22,15 @@ internal sealed class HostsModuleCommandProvider : ModuleCommandProvider
{
yield return new ListItem(new OpenHostsEditorCommand())
{
Title = Resources.Hosts_Open_Title,
Subtitle = Resources.Hosts_Open_Subtitle,
Title = "Open Hosts File Editor",
Subtitle = "Launch Hosts File Editor",
Icon = icon,
};
yield return new ListItem(new OpenHostsEditorAdminCommand())
{
Title = Resources.Hosts_OpenAdmin_Title,
Subtitle = Resources.Hosts_OpenAdmin_Subtitle,
Title = "Open Hosts File Editor (Admin)",
Subtitle = "Launch Hosts File Editor as admin",
Icon = icon,
};
}
@@ -39,7 +38,7 @@ internal sealed class HostsModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.Hosts_Settings_Subtitle,
Subtitle = "Open Hosts File Editor settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -21,7 +20,7 @@ internal sealed class ImageResizerModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(SettingsWindow.ImageResizer, title))
{
Title = title,
Subtitle = Resources.ImageResizer_Settings_Subtitle,
Subtitle = "Open Image Resizer settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -21,7 +20,7 @@ internal sealed class KeyboardManagerModuleCommandProvider : ModuleCommandProvid
yield return new ListItem(new OpenInSettingsCommand(SettingsWindow.KBM, title))
{
Title = title,
Subtitle = Resources.KeyboardManager_Settings_Subtitle,
Subtitle = "Open Keyboard Manager settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -25,8 +24,8 @@ internal sealed class LightSwitchModuleCommandProvider : ModuleCommandProvider
{
items.Add(new ListItem(new ToggleLightSwitchCommand())
{
Title = Resources.LightSwitch_Toggle_Title,
Subtitle = Resources.LightSwitch_Toggle_Subtitle,
Title = "Toggle Light Switch",
Subtitle = "Toggle system/apps theme immediately",
Icon = icon,
});
}
@@ -34,7 +33,7 @@ internal sealed class LightSwitchModuleCommandProvider : ModuleCommandProvider
items.Add(new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.LightSwitch_Settings_Subtitle,
Subtitle = "Open Light Switch settings",
Icon = icon,
});

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -23,8 +22,8 @@ internal sealed class MouseUtilsModuleCommandProvider : ModuleCommandProvider
{
yield return new ListItem(new ToggleFindMyMouseCommand())
{
Title = Resources.MouseUtils_FindMyMouse_Title,
Subtitle = Resources.MouseUtils_FindMyMouse_Subtitle,
Title = "Trigger Find My Mouse",
Subtitle = "Focus the mouse pointer",
Icon = icon,
};
}
@@ -33,8 +32,8 @@ internal sealed class MouseUtilsModuleCommandProvider : ModuleCommandProvider
{
yield return new ListItem(new ToggleMouseHighlighterCommand())
{
Title = Resources.MouseUtils_Highlighter_Title,
Subtitle = Resources.MouseUtils_Highlighter_Subtitle,
Title = "Toggle Mouse Highlighter",
Subtitle = "Highlight mouse clicks",
Icon = icon,
};
}
@@ -43,8 +42,8 @@ internal sealed class MouseUtilsModuleCommandProvider : ModuleCommandProvider
{
yield return new ListItem(new ToggleMouseCrosshairsCommand())
{
Title = Resources.MouseUtils_Crosshairs_Title,
Subtitle = Resources.MouseUtils_Crosshairs_Subtitle,
Title = "Toggle Mouse Crosshairs",
Subtitle = "Enable or disable pointer crosshairs",
Icon = icon,
};
}
@@ -53,8 +52,8 @@ internal sealed class MouseUtilsModuleCommandProvider : ModuleCommandProvider
{
yield return new ListItem(new ToggleCursorWrapCommand())
{
Title = Resources.MouseUtils_CursorWrap_Title,
Subtitle = Resources.MouseUtils_CursorWrap_Subtitle,
Title = "Toggle Cursor Wrap",
Subtitle = "Wrap the cursor across monitor edges",
Icon = icon,
};
}
@@ -63,8 +62,8 @@ internal sealed class MouseUtilsModuleCommandProvider : ModuleCommandProvider
{
yield return new ListItem(new ShowMouseJumpPreviewCommand())
{
Title = Resources.MouseUtils_MouseJump_Title,
Subtitle = Resources.MouseUtils_MouseJump_Subtitle,
Title = "Show Mouse Jump Preview",
Subtitle = "Jump the pointer to a target",
Icon = icon,
};
}
@@ -72,7 +71,7 @@ internal sealed class MouseUtilsModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.MouseUtils_Settings_Subtitle,
Subtitle = "Open Mouse Utilities settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -21,7 +20,7 @@ internal sealed class MouseWithoutBordersModuleCommandProvider : ModuleCommandPr
yield return new ListItem(new OpenInSettingsCommand(SettingsWindow.MouseWithoutBorders, title))
{
Title = title,
Subtitle = Resources.MouseWithoutBorders_Settings_Subtitle,
Subtitle = "Open Mouse Without Borders settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -21,7 +20,7 @@ internal sealed class NewPlusModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(SettingsWindow.NewPlus, title))
{
Title = title,
Subtitle = Resources.NewPlus_Settings_Subtitle,
Subtitle = "Open New+ settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -21,7 +20,7 @@ internal sealed class PeekModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(SettingsWindow.Peek, title))
{
Title = title,
Subtitle = Resources.Peek_Settings_Subtitle,
Subtitle = "Open Peek settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -21,7 +20,7 @@ internal sealed class PowerRenameModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(SettingsWindow.PowerRename, title))
{
Title = title,
Subtitle = Resources.PowerRename_Settings_Subtitle,
Subtitle = "Open PowerRename settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -21,7 +20,7 @@ internal sealed class PowerToysRunModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(SettingsWindow.PowerLauncher, title))
{
Title = title,
Subtitle = Resources.PowerToysRun_Settings_Subtitle,
Subtitle = "Open PowerToys Run settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -21,7 +20,7 @@ internal sealed class QuickAccentModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(SettingsWindow.PowerAccent, title))
{
Title = title,
Subtitle = Resources.QuickAccent_Settings_Subtitle,
Subtitle = "Open Quick Accent settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -23,8 +22,8 @@ internal sealed class RegistryPreviewModuleCommandProvider : ModuleCommandProvid
{
yield return new ListItem(new OpenRegistryPreviewCommand())
{
Title = Resources.RegistryPreview_Open_Title,
Subtitle = Resources.RegistryPreview_Open_Subtitle,
Title = "Open Registry Preview",
Subtitle = "Launch Registry Preview",
Icon = icon,
};
}
@@ -32,7 +31,7 @@ internal sealed class RegistryPreviewModuleCommandProvider : ModuleCommandProvid
yield return new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.RegistryPreview_Settings_Subtitle,
Subtitle = "Open Registry Preview settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -23,8 +22,8 @@ internal sealed class ScreenRulerModuleCommandProvider : ModuleCommandProvider
{
yield return new ListItem(new ToggleScreenRulerCommand())
{
Title = Resources.ScreenRuler_Toggle_Title,
Subtitle = Resources.ScreenRuler_Toggle_Subtitle,
Title = "Toggle Screen Ruler",
Subtitle = "Start or close Screen Ruler",
Icon = icon,
};
}
@@ -32,7 +31,7 @@ internal sealed class ScreenRulerModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.ScreenRuler_Settings_Subtitle,
Subtitle = "Open Screen Ruler settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -23,8 +22,8 @@ internal sealed class ShortcutGuideModuleCommandProvider : ModuleCommandProvider
{
yield return new ListItem(new ToggleShortcutGuideCommand())
{
Title = Resources.ShortcutGuide_Toggle_Title,
Subtitle = Resources.ShortcutGuide_Toggle_Subtitle,
Title = "Toggle Shortcut Guide",
Subtitle = "Show or hide Shortcut Guide",
Icon = icon,
};
}
@@ -32,7 +31,7 @@ internal sealed class ShortcutGuideModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.ShortcutGuide_Settings_Subtitle,
Subtitle = "Open Shortcut Guide settings",
Icon = icon,
};
}

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -23,8 +22,8 @@ internal sealed class TextExtractorModuleCommandProvider : ModuleCommandProvider
{
yield return new ListItem(new ToggleTextExtractorCommand())
{
Title = Resources.TextExtractor_Toggle_Title,
Subtitle = Resources.TextExtractor_Toggle_Subtitle,
Title = "Toggle Text Extractor",
Subtitle = "Start or close Text Extractor",
Icon = icon,
};
}
@@ -32,7 +31,7 @@ internal sealed class TextExtractorModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.TextExtractor_Settings_Subtitle,
Subtitle = "Open Text Extractor settings",
Icon = icon,
};
}

View File

@@ -7,7 +7,6 @@ using Common.UI;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using Workspaces.ModuleServices;
using WorkspacesCsharpLibrary.Data;
@@ -26,7 +25,7 @@ internal sealed class WorkspacesModuleCommandProvider : ModuleCommandProvider
items.Add(new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.Workspaces_Settings_Subtitle,
Subtitle = "Open Workspaces settings",
Icon = moduleIcon,
});
@@ -38,8 +37,8 @@ internal sealed class WorkspacesModuleCommandProvider : ModuleCommandProvider
// Settings entry plus common actions.
items.Add(new ListItem(new OpenWorkspaceEditorCommand())
{
Title = Resources.Workspaces_OpenEditor_Title,
Subtitle = Resources.Workspaces_OpenEditor_Subtitle,
Title = "Workspaces: Open editor",
Subtitle = "Create or edit workspaces",
Icon = icon,
});

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
using static Common.UI.SettingsDeepLink;
namespace PowerToysExtension.Modules;
@@ -22,40 +21,40 @@ internal sealed class ZoomItModuleCommandProvider : ModuleCommandProvider
if (ModuleEnablementService.IsModuleEnabled(module))
{
// Action commands via ZoomIt IPC
yield return new ListItem(new ZoomItActionCommand("zoom", Resources.ZoomIt_Zoom_Title))
yield return new ListItem(new ZoomItActionCommand("zoom", "ZoomIt: Zoom"))
{
Title = Resources.ZoomIt_Zoom_Title,
Subtitle = Resources.ZoomIt_Zoom_Subtitle,
Title = "ZoomIt: Zoom",
Subtitle = "Enter zoom mode",
Icon = icon,
};
yield return new ListItem(new ZoomItActionCommand("draw", Resources.ZoomIt_Draw_Title))
yield return new ListItem(new ZoomItActionCommand("draw", "ZoomIt: Draw"))
{
Title = Resources.ZoomIt_Draw_Title,
Subtitle = Resources.ZoomIt_Draw_Subtitle,
Title = "ZoomIt: Draw",
Subtitle = "Enter drawing mode",
Icon = icon,
};
yield return new ListItem(new ZoomItActionCommand("break", Resources.ZoomIt_Break_Title))
yield return new ListItem(new ZoomItActionCommand("break", "ZoomIt: Break"))
{
Title = Resources.ZoomIt_Break_Title,
Subtitle = Resources.ZoomIt_Break_Subtitle,
Title = "ZoomIt: Break",
Subtitle = "Enter break timer",
Icon = icon,
};
yield return new ListItem(new ZoomItActionCommand("liveZoom", Resources.ZoomIt_LiveZoom_Title))
yield return new ListItem(new ZoomItActionCommand("liveZoom", "ZoomIt: Live Zoom"))
{
Title = Resources.ZoomIt_LiveZoom_Title,
Subtitle = Resources.ZoomIt_LiveZoom_Subtitle,
Title = "ZoomIt: Live Zoom",
Subtitle = "Toggle live zoom",
Icon = icon,
};
yield return new ListItem(new ZoomItActionCommand("snip", Resources.ZoomIt_Snip_Title))
yield return new ListItem(new ZoomItActionCommand("snip", "ZoomIt: Snip"))
{
Title = Resources.ZoomIt_Snip_Title,
Subtitle = Resources.ZoomIt_Snip_Subtitle,
Title = "ZoomIt: Snip",
Subtitle = "Enter snip mode",
Icon = icon,
};
yield return new ListItem(new ZoomItActionCommand("record", Resources.ZoomIt_Record_Title))
yield return new ListItem(new ZoomItActionCommand("record", "ZoomIt: Record"))
{
Title = Resources.ZoomIt_Record_Title,
Subtitle = Resources.ZoomIt_Record_Subtitle,
Title = "ZoomIt: Record",
Subtitle = "Start recording",
Icon = icon,
};
}
@@ -63,7 +62,7 @@ internal sealed class ZoomItModuleCommandProvider : ModuleCommandProvider
yield return new ListItem(new OpenInSettingsCommand(module, title))
{
Title = title,
Subtitle = Resources.ZoomIt_Settings_Subtitle,
Subtitle = "Open ZoomIt settings",
Icon = icon,
};
}

View File

@@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Globalization;
using System.Linq;
using System.Text;
using ColorPicker.ModuleServices;
@@ -11,27 +10,24 @@ using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
namespace PowerToysExtension.Pages;
internal sealed partial class ColorPickerSavedColorsPage : DynamicListPage
{
private static readonly CompositeFormat NoMatchingSavedColorsFormat = CompositeFormat.Parse(Resources.ColorPicker_NoMatchingSavedColors_Subtitle);
private readonly CommandItem _emptyContent;
public ColorPickerSavedColorsPage()
{
Icon = PowerToysResourcesHelper.IconFromSettingsIcon("ColorPicker.png");
Title = Resources.ColorPicker_SavedColors_Title;
Title = "Saved colors";
Name = "ColorPickerSavedColors";
Id = "com.microsoft.powertoys.colorpicker.savedColors";
_emptyContent = new CommandItem()
{
Title = Resources.ColorPicker_NoSavedColors_Title,
Subtitle = Resources.ColorPicker_NoSavedColors_Subtitle,
Title = "No saved colors",
Subtitle = "Pick a color first, then try again.",
Icon = PowerToysResourcesHelper.IconFromSettingsIcon("ColorPicker.png"),
};
@@ -74,8 +70,8 @@ internal sealed partial class ColorPickerSavedColorsPage : DynamicListPage
public override void UpdateSearchText(string oldSearch, string newSearch)
{
_emptyContent.Subtitle = string.IsNullOrWhiteSpace(newSearch)
? Resources.ColorPicker_NoSavedColors_Subtitle
: string.Format(CultureInfo.CurrentCulture, NoMatchingSavedColorsFormat, newSearch);
? "Pick a color first, then try again."
: $"No saved colors matching '{newSearch}'";
RaiseItemsChanged(0);
}

View File

@@ -11,7 +11,6 @@ using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
namespace PowerToysExtension.Pages;
@@ -22,13 +21,13 @@ internal sealed partial class FancyZonesLayoutsPage : DynamicListPage
public FancyZonesLayoutsPage()
{
Icon = PowerToysResourcesHelper.IconFromSettingsIcon("FancyZones.png");
Name = Title = Resources.FancyZones_Layouts_Title;
Name = Title = "FancyZones Layouts";
Id = "com.microsoft.cmdpal.powertoys.fancyzones.layouts";
_emptyMessage = new CommandItem()
{
Title = Resources.FancyZones_NoLayoutsFound_Title,
Subtitle = Resources.FancyZones_NoLayoutsFound_Subtitle,
Title = "No layouts found",
Subtitle = "Open FancyZones Editor once to initialize layouts.",
Icon = PowerToysResourcesHelper.IconFromSettingsIcon("FancyZones.png"),
};
EmptyContent = _emptyMessage;

View File

@@ -4,21 +4,16 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
namespace PowerToysExtension.Pages;
internal sealed partial class FancyZonesMonitorLayoutPickerPage : DynamicListPage
{
private static readonly CompositeFormat SetActiveLayoutForFormat = CompositeFormat.Parse(Resources.FancyZones_SetActiveLayoutFor_Format);
private readonly FancyZonesMonitorDescriptor _monitor;
private readonly CommandItem _emptyMessage;
@@ -26,13 +21,13 @@ internal sealed partial class FancyZonesMonitorLayoutPickerPage : DynamicListPag
{
_monitor = monitor;
Icon = PowerToysResourcesHelper.IconFromSettingsIcon("FancyZones.png");
Name = Title = string.Format(CultureInfo.CurrentCulture, SetActiveLayoutForFormat, _monitor.Title);
Name = Title = $"Set active layout for {_monitor.Title}";
Id = $"com.microsoft.cmdpal.powertoys.fancyzones.monitor.{_monitor.Index}.layouts";
_emptyMessage = new CommandItem()
{
Title = Resources.FancyZones_NoLayoutsFound_Title,
Subtitle = Resources.FancyZones_NoLayoutsFound_Subtitle,
Title = "No layouts found",
Subtitle = "Open FancyZones Editor once to initialize layouts.",
Icon = PowerToysResourcesHelper.IconFromSettingsIcon("FancyZones.png"),
};
EmptyContent = _emptyMessage;

View File

@@ -4,31 +4,26 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
namespace PowerToysExtension.Pages;
internal sealed partial class FancyZonesMonitorsPage : DynamicListPage
{
private static readonly CompositeFormat CurrentLayoutFormat = CompositeFormat.Parse(Resources.FancyZones_CurrentLayout_Format);
private readonly CommandItem _emptyMessage;
public FancyZonesMonitorsPage()
{
Icon = PowerToysResourcesHelper.IconFromSettingsIcon("FancyZones.png");
Name = Title = Resources.FancyZones_Monitors_Title;
Name = Title = "FancyZones Monitors";
Id = "com.microsoft.cmdpal.powertoys.fancyzones.monitors";
_emptyMessage = new CommandItem()
{
Title = Resources.FancyZones_NoMonitorsFound_Title,
Subtitle = Resources.FancyZones_NoMonitorsFound_Subtitle,
Title = "No monitors found",
Subtitle = "Open FancyZones Editor once to initialize monitor data.",
Icon = PowerToysResourcesHelper.IconFromSettingsIcon("FancyZones.png"),
};
EmptyContent = _emptyMessage;
@@ -60,8 +55,8 @@ internal sealed partial class FancyZonesMonitorsPage : DynamicListPage
}
var layoutDescription = FancyZonesDataService.TryGetAppliedLayoutForMonitor(monitor.Data, out var applied) && applied is not null
? string.Format(CultureInfo.CurrentCulture, CurrentLayoutFormat, applied.Value.Type)
: Resources.FancyZones_CurrentLayout_Unknown;
? $"Current layout: {applied.Value.Type}"
: "Current layout: unknown";
var item = new FancyZonesMonitorListItem(monitor, layoutDescription, monitorIcon);
items.Add(item);

View File

@@ -6,7 +6,6 @@ using Awake.ModuleServices;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Commands;
using PowerToysExtension.Properties;
namespace PowerToysExtension;
@@ -15,32 +14,32 @@ internal sealed partial class PowerToysExtensionPage : ListPage
public PowerToysExtensionPage()
{
Icon = Helpers.PowerToysResourcesHelper.IconFromSettingsIcon("PowerToys.png");
Title = Resources.PowerToys_DisplayName;
Name = Resources.PowerToysExtension_CommandsName;
Title = "PowerToys";
Name = "PowerToys commands";
}
public override IListItem[] GetItems()
{
return [
new ListItem(new LaunchModuleCommand("PowerToys", executableName: "PowerToys.exe", displayName: Resources.PowerToysExtension_OpenPowerToys_Title))
new ListItem(new LaunchModuleCommand("PowerToys", executableName: "PowerToys.exe", displayName: "Open PowerToys"))
{
Title = Resources.PowerToysExtension_OpenPowerToys_Title,
Subtitle = Resources.PowerToysExtension_OpenPowerToys_Subtitle,
Title = "Open PowerToys",
Subtitle = "Launch the PowerToys shell",
},
new ListItem(new OpenPowerToysSettingsCommand("PowerToys", "General"))
{
Title = Resources.PowerToysExtension_OpenSettings_Title,
Subtitle = Resources.PowerToysExtension_OpenSettings_Subtitle,
Title = "Open PowerToys settings",
Subtitle = "Open the main PowerToys settings window",
},
new ListItem(new OpenPowerToysSettingsCommand("Workspaces", "Workspaces"))
{
Title = Resources.PowerToysExtension_OpenWorkspacesSettings_Title,
Subtitle = Resources.PowerToysExtension_OpenWorkspacesSettings_Subtitle,
Title = "Open Workspaces settings",
Subtitle = "Jump directly to Workspaces settings",
},
new ListItem(new OpenWorkspaceEditorCommand())
{
Title = Resources.PowerToysExtension_OpenWorkspacesEditor_Title,
Subtitle = Resources.PowerToysExtension_OpenWorkspacesEditor_Subtitle,
Title = "Open Workspaces editor",
Subtitle = "Launch the Workspaces editor",
},
];
}

View File

@@ -5,7 +5,6 @@
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
namespace PowerToysExtension.Pages;
@@ -16,13 +15,13 @@ internal sealed partial class PowerToysListPage : ListPage
public PowerToysListPage()
{
Icon = PowerToysResourcesHelper.IconFromSettingsIcon("PowerToys.png");
Name = Title = Resources.PowerToys_DisplayName;
Name = Title = "PowerToys";
Id = "com.microsoft.cmdpal.powertoys";
SettingsChangeNotifier.SettingsChanged += OnSettingsChanged;
_empty = new CommandItem()
{
Icon = PowerToysResourcesHelper.IconFromSettingsIcon("PowerToys.png"),
Title = Resources.PowerToys_NoMatchingModule,
Title = "No matching module found",
Subtitle = SearchText,
};
EmptyContent = _empty;

View File

@@ -7,7 +7,6 @@ using ManagedCommon;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
namespace PowerToysExtension;
@@ -15,7 +14,7 @@ public sealed partial class PowerToysCommandsProvider : CommandProvider
{
public PowerToysCommandsProvider()
{
DisplayName = Resources.PowerToys_DisplayName;
DisplayName = "PowerToys";
Icon = PowerToysResourcesHelper.IconFromSettingsIcon("PowerToys.png");
}
@@ -23,8 +22,8 @@ public sealed partial class PowerToysCommandsProvider : CommandProvider
[
new CommandItem(new Pages.PowerToysListPage())
{
Title = Resources.PowerToys_DisplayName,
Subtitle = Resources.PowerToys_Subtitle,
Title = "PowerToys",
Subtitle = "PowerToys commands and settings",
}
];

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using PowerToysExtension.Helpers;
using PowerToysExtension.Properties;
namespace PowerToysExtension;
@@ -16,13 +15,13 @@ public partial class PowerToysExtensionCommandsProvider : CommandProvider
public PowerToysExtensionCommandsProvider()
{
DisplayName = Resources.PowerToys_DisplayName;
DisplayName = "PowerToys";
Icon = PowerToysResourcesHelper.IconFromSettingsIcon("PowerToys.png");
_commands = [
new CommandItem(new Pages.PowerToysListPage())
{
Title = Resources.PowerToys_DisplayName,
Subtitle = Resources.PowerToys_Subtitle,
Title = "PowerToys",
Subtitle = "PowerToys commands and settings",
},
];
}

View File

@@ -1,630 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<!-- PowerToys CommandsProvider -->
<data name="PowerToys_DisplayName" xml:space="preserve">
<value>PowerToys</value>
</data>
<data name="PowerToys_Subtitle" xml:space="preserve">
<value>PowerToys commands and settings</value>
</data>
<data name="PowerToys_NoMatchingModule" xml:space="preserve">
<value>No matching module found</value>
</data>
<!-- PowerToys Extension Page -->
<data name="PowerToysExtension_CommandsName" xml:space="preserve">
<value>PowerToys commands</value>
</data>
<data name="PowerToysExtension_OpenPowerToys_Title" xml:space="preserve">
<value>Open PowerToys</value>
</data>
<data name="PowerToysExtension_OpenPowerToys_Subtitle" xml:space="preserve">
<value>Launch the PowerToys shell</value>
</data>
<data name="PowerToysExtension_OpenSettings_Title" xml:space="preserve">
<value>Open PowerToys settings</value>
</data>
<data name="PowerToysExtension_OpenSettings_Subtitle" xml:space="preserve">
<value>Open the main PowerToys settings window</value>
</data>
<data name="PowerToysExtension_OpenWorkspacesSettings_Title" xml:space="preserve">
<value>Open Workspaces settings</value>
</data>
<data name="PowerToysExtension_OpenWorkspacesSettings_Subtitle" xml:space="preserve">
<value>Jump directly to Workspaces settings</value>
</data>
<data name="PowerToysExtension_OpenWorkspacesEditor_Title" xml:space="preserve">
<value>Open Workspaces editor</value>
</data>
<data name="PowerToysExtension_OpenWorkspacesEditor_Subtitle" xml:space="preserve">
<value>Launch the Workspaces editor</value>
</data>
<!-- Advanced Paste Module -->
<data name="AdvancedPaste_Open_Title" xml:space="preserve">
<value>Open Advanced Paste</value>
</data>
<data name="AdvancedPaste_Open_Subtitle" xml:space="preserve">
<value>Launch the Advanced Paste UI</value>
</data>
<data name="AdvancedPaste_Settings_Subtitle" xml:space="preserve">
<value>Open Advanced Paste settings</value>
</data>
<!-- Always On Top Module -->
<data name="AlwaysOnTop_Settings_Subtitle" xml:space="preserve">
<value>Open Always On Top settings</value>
</data>
<!-- Awake Module -->
<data name="Awake_Settings_Subtitle" xml:space="preserve">
<value>Open Awake settings</value>
</data>
<data name="Awake_Status_Title" xml:space="preserve">
<value>Awake: Current status</value>
</data>
<data name="Awake_KeepIndefinite_Title" xml:space="preserve">
<value>Awake: Keep awake indefinitely</value>
</data>
<data name="Awake_KeepIndefinite_Subtitle" xml:space="preserve">
<value>Run Awake in indefinite mode</value>
</data>
<data name="Awake_Keep30Min_Title" xml:space="preserve">
<value>Awake: Keep awake for 30 minutes</value>
</data>
<data name="Awake_Keep30Min_Subtitle" xml:space="preserve">
<value>Run Awake timed for 30 minutes</value>
</data>
<data name="Awake_Keep1Hour_Title" xml:space="preserve">
<value>Awake: Keep awake for 1 hour</value>
</data>
<data name="Awake_Keep1Hour_Subtitle" xml:space="preserve">
<value>Run Awake timed for 1 hour</value>
</data>
<data name="Awake_Keep2Hours_Title" xml:space="preserve">
<value>Awake: Keep awake for 2 hours</value>
</data>
<data name="Awake_Keep2Hours_Subtitle" xml:space="preserve">
<value>Run Awake timed for 2 hours</value>
</data>
<data name="Awake_TurnOff_Title" xml:space="preserve">
<value>Awake: Turn off</value>
</data>
<data name="Awake_TurnOff_Subtitle" xml:space="preserve">
<value>Switch Awake back to Off</value>
</data>
<data name="Awake_SetIndefinite_Toast" xml:space="preserve">
<value>Awake set to indefinite</value>
</data>
<data name="Awake_Set30Min_Toast" xml:space="preserve">
<value>Awake set for 30 minutes</value>
</data>
<data name="Awake_Set1Hour_Toast" xml:space="preserve">
<value>Awake set for 1 hour</value>
</data>
<data name="Awake_Set2Hours_Toast" xml:space="preserve">
<value>Awake set for 2 hours</value>
</data>
<!-- Color Picker Module -->
<data name="ColorPicker_Settings_Subtitle" xml:space="preserve">
<value>Open Color Picker settings</value>
</data>
<data name="ColorPicker_Open_Title" xml:space="preserve">
<value>Open Color Picker</value>
</data>
<data name="ColorPicker_Open_Subtitle" xml:space="preserve">
<value>Start a color pick session</value>
</data>
<data name="ColorPicker_SavedColors_Title" xml:space="preserve">
<value>Saved colors</value>
</data>
<data name="ColorPicker_SavedColors_Subtitle" xml:space="preserve">
<value>Browse and copy saved colors</value>
</data>
<data name="ColorPicker_NoSavedColors_Title" xml:space="preserve">
<value>No saved colors</value>
</data>
<data name="ColorPicker_NoSavedColors_Subtitle" xml:space="preserve">
<value>Pick a color first, then try again.</value>
</data>
<data name="ColorPicker_NoMatchingSavedColors_Subtitle" xml:space="preserve">
<value>No saved colors matching '{0}'</value>
</data>
<!-- Command Not Found Module -->
<data name="CommandNotFound_Settings_Subtitle" xml:space="preserve">
<value>Open Command Not Found settings</value>
</data>
<!-- Crop And Lock Module -->
<data name="CropAndLock_Reparent_Title" xml:space="preserve">
<value>Crop and Lock (Reparent)</value>
</data>
<data name="CropAndLock_Reparent_Subtitle" xml:space="preserve">
<value>Create a cropped reparented window</value>
</data>
<data name="CropAndLock_Thumbnail_Title" xml:space="preserve">
<value>Crop and Lock (Thumbnail)</value>
</data>
<data name="CropAndLock_Thumbnail_Subtitle" xml:space="preserve">
<value>Create a cropped thumbnail window</value>
</data>
<data name="CropAndLock_Settings_Subtitle" xml:space="preserve">
<value>Open Crop and Lock settings</value>
</data>
<!-- Environment Variables Module -->
<data name="EnvironmentVariables_Open_Title" xml:space="preserve">
<value>Open Environment Variables</value>
</data>
<data name="EnvironmentVariables_Open_Subtitle" xml:space="preserve">
<value>Launch Environment Variables editor</value>
</data>
<data name="EnvironmentVariables_OpenAdmin_Title" xml:space="preserve">
<value>Open Environment Variables (Admin)</value>
</data>
<data name="EnvironmentVariables_OpenAdmin_Subtitle" xml:space="preserve">
<value>Launch Environment Variables editor as admin</value>
</data>
<data name="EnvironmentVariables_Settings_Subtitle" xml:space="preserve">
<value>Open Environment Variables settings</value>
</data>
<!-- FancyZones Module -->
<data name="FancyZones_Layouts_Title" xml:space="preserve">
<value>FancyZones: Layouts</value>
</data>
<data name="FancyZones_Layouts_Subtitle" xml:space="preserve">
<value>Apply a layout to all monitors or a specific monitor</value>
</data>
<data name="FancyZones_Monitors_Title" xml:space="preserve">
<value>FancyZones: Monitors</value>
</data>
<data name="FancyZones_Monitors_Subtitle" xml:space="preserve">
<value>Identify monitors and apply layouts</value>
</data>
<data name="FancyZones_OpenEditor_Title" xml:space="preserve">
<value>Open FancyZones Editor</value>
</data>
<data name="FancyZones_OpenEditor_Subtitle" xml:space="preserve">
<value>Launch layout editor</value>
</data>
<data name="FancyZones_Settings_Subtitle" xml:space="preserve">
<value>Open FancyZones settings</value>
</data>
<data name="FancyZones_LayoutsPage_Title" xml:space="preserve">
<value>FancyZones Layouts</value>
</data>
<data name="FancyZones_NoLayoutsFound_Title" xml:space="preserve">
<value>No layouts found</value>
</data>
<data name="FancyZones_NoLayoutsFound_Subtitle" xml:space="preserve">
<value>Open FancyZones Editor once to initialize layouts.</value>
</data>
<data name="FancyZones_ApplyTo_Format" xml:space="preserve">
<value>Apply to {0}</value>
</data>
<data name="FancyZones_MonitorsPage_Title" xml:space="preserve">
<value>FancyZones Monitors</value>
</data>
<data name="FancyZones_NoMonitorsFound_Title" xml:space="preserve">
<value>No monitors found</value>
</data>
<data name="FancyZones_NoMonitorsFound_Subtitle" xml:space="preserve">
<value>Open FancyZones Editor once to initialize monitor data.</value>
</data>
<data name="FancyZones_SetActiveLayout" xml:space="preserve">
<value>Set active layout</value>
</data>
<data name="FancyZones_PickLayoutForMonitor" xml:space="preserve">
<value>Pick a layout for this monitor</value>
</data>
<data name="FancyZones_SetActiveLayoutFor_Format" xml:space="preserve">
<value>Set active layout for {0}</value>
</data>
<data name="FancyZones_CurrentLayout_Format" xml:space="preserve">
<value>Current layout: {0}</value>
</data>
<data name="FancyZones_CurrentLayout_Unknown" xml:space="preserve">
<value>Current layout: unknown</value>
</data>
<data name="FancyZones_Template_Format" xml:space="preserve">
<value>Template: {0}</value>
</data>
<data name="FancyZones_Zones_Format" xml:space="preserve">
<value>{0} zones</value>
</data>
<data name="FancyZones_CustomGrid_Zones_Format" xml:space="preserve">
<value>Custom grid • {0} zones</value>
</data>
<data name="FancyZones_CustomCanvas_Zones_Format" xml:space="preserve">
<value>Custom canvas • {0} zones</value>
</data>
<data name="FancyZones_Custom_Zones_Format" xml:space="preserve">
<value>Custom • {0} zones</value>
</data>
<data name="FancyZones_LayoutApplied" xml:space="preserve">
<value>Layout applied.</value>
</data>
<data name="FancyZones_LayoutAppliedNotifyFailed_Format" xml:space="preserve">
<value>Layout applied, but FancyZones could not be notified: {0}</value>
</data>
<data name="FancyZones_WriteAppliedLayoutsFailed_Format" xml:space="preserve">
<value>Failed to write applied layouts: {0}</value>
</data>
<data name="FancyZones_MonitorDataNotFound" xml:space="preserve">
<value>FancyZones monitor data not found. Open FancyZones Editor once to initialize.</value>
</data>
<data name="FancyZones_NoFancyZonesMonitorsFound" xml:space="preserve">
<value>No FancyZones monitors found.</value>
</data>
<data name="FancyZones_ReadMonitorDataFailed_Format" xml:space="preserve">
<value>Failed to read FancyZones monitor data: {0}</value>
</data>
<!-- File Explorer Addons Module -->
<data name="FileExplorerAddons_Settings_Subtitle" xml:space="preserve">
<value>Open File Explorer add-ons settings</value>
</data>
<!-- File Locksmith Module -->
<data name="FileLocksmith_Settings_Subtitle" xml:space="preserve">
<value>Open File Locksmith settings</value>
</data>
<!-- Hosts Module -->
<data name="Hosts_Open_Title" xml:space="preserve">
<value>Open Hosts File Editor</value>
</data>
<data name="Hosts_Open_Subtitle" xml:space="preserve">
<value>Launch Hosts File Editor</value>
</data>
<data name="Hosts_OpenAdmin_Title" xml:space="preserve">
<value>Open Hosts File Editor (Admin)</value>
</data>
<data name="Hosts_OpenAdmin_Subtitle" xml:space="preserve">
<value>Launch Hosts File Editor as admin</value>
</data>
<data name="Hosts_Settings_Subtitle" xml:space="preserve">
<value>Open Hosts File Editor settings</value>
</data>
<!-- Image Resizer Module -->
<data name="ImageResizer_Settings_Subtitle" xml:space="preserve">
<value>Open Image Resizer settings</value>
</data>
<!-- Keyboard Manager Module -->
<data name="KeyboardManager_Settings_Subtitle" xml:space="preserve">
<value>Open Keyboard Manager settings</value>
</data>
<!-- Light Switch Module -->
<data name="LightSwitch_Toggle_Title" xml:space="preserve">
<value>Light Switch: Toggle theme</value>
</data>
<data name="LightSwitch_Toggle_Subtitle" xml:space="preserve">
<value>Toggle system/apps theme immediately</value>
</data>
<data name="LightSwitch_Settings_Subtitle" xml:space="preserve">
<value>Open Light Switch settings</value>
</data>
<!-- Mouse Utils Module -->
<data name="MouseUtils_FindMyMouse_Title" xml:space="preserve">
<value>Trigger Find My Mouse</value>
</data>
<data name="MouseUtils_FindMyMouse_Subtitle" xml:space="preserve">
<value>Focus the mouse pointer</value>
</data>
<data name="MouseUtils_Highlighter_Title" xml:space="preserve">
<value>Toggle Mouse Highlighter</value>
</data>
<data name="MouseUtils_Highlighter_Subtitle" xml:space="preserve">
<value>Highlight mouse clicks</value>
</data>
<data name="MouseUtils_Crosshairs_Title" xml:space="preserve">
<value>Toggle Mouse Crosshairs</value>
</data>
<data name="MouseUtils_Crosshairs_Subtitle" xml:space="preserve">
<value>Enable or disable pointer crosshairs</value>
</data>
<data name="MouseUtils_CursorWrap_Title" xml:space="preserve">
<value>Toggle Cursor Wrap</value>
</data>
<data name="MouseUtils_CursorWrap_Subtitle" xml:space="preserve">
<value>Wrap the cursor across monitor edges</value>
</data>
<data name="MouseUtils_MouseJump_Title" xml:space="preserve">
<value>Show Mouse Jump Preview</value>
</data>
<data name="MouseUtils_MouseJump_Subtitle" xml:space="preserve">
<value>Jump the pointer to a target</value>
</data>
<data name="MouseUtils_Settings_Subtitle" xml:space="preserve">
<value>Open Mouse Utilities settings</value>
</data>
<!-- Mouse Without Borders Module -->
<data name="MouseWithoutBorders_Settings_Subtitle" xml:space="preserve">
<value>Open Mouse Without Borders settings</value>
</data>
<!-- New+ Module -->
<data name="NewPlus_Settings_Subtitle" xml:space="preserve">
<value>Open New+ settings</value>
</data>
<!-- Peek Module -->
<data name="Peek_Settings_Subtitle" xml:space="preserve">
<value>Open Peek settings</value>
</data>
<!-- PowerRename Module -->
<data name="PowerRename_Settings_Subtitle" xml:space="preserve">
<value>Open PowerRename settings</value>
</data>
<!-- PowerToys Run Module -->
<data name="PowerToysRun_Settings_Subtitle" xml:space="preserve">
<value>Open PowerToys Run settings</value>
</data>
<!-- Quick Accent Module -->
<data name="QuickAccent_Settings_Subtitle" xml:space="preserve">
<value>Open Quick Accent settings</value>
</data>
<!-- Registry Preview Module -->
<data name="RegistryPreview_Open_Title" xml:space="preserve">
<value>Open Registry Preview</value>
</data>
<data name="RegistryPreview_Open_Subtitle" xml:space="preserve">
<value>Launch Registry Preview</value>
</data>
<data name="RegistryPreview_Settings_Subtitle" xml:space="preserve">
<value>Open Registry Preview settings</value>
</data>
<!-- Screen Ruler Module -->
<data name="ScreenRuler_Toggle_Title" xml:space="preserve">
<value>Toggle Screen Ruler</value>
</data>
<data name="ScreenRuler_Toggle_Subtitle" xml:space="preserve">
<value>Start or close Screen Ruler</value>
</data>
<data name="ScreenRuler_Settings_Subtitle" xml:space="preserve">
<value>Open Screen Ruler settings</value>
</data>
<!-- Shortcut Guide Module -->
<data name="ShortcutGuide_Toggle_Title" xml:space="preserve">
<value>Toggle Shortcut Guide</value>
</data>
<data name="ShortcutGuide_Toggle_Subtitle" xml:space="preserve">
<value>Show or hide Shortcut Guide</value>
</data>
<data name="ShortcutGuide_Settings_Subtitle" xml:space="preserve">
<value>Open Shortcut Guide settings</value>
</data>
<!-- Text Extractor Module -->
<data name="TextExtractor_Toggle_Title" xml:space="preserve">
<value>Toggle Text Extractor</value>
</data>
<data name="TextExtractor_Toggle_Subtitle" xml:space="preserve">
<value>Start or close Text Extractor</value>
</data>
<data name="TextExtractor_Settings_Subtitle" xml:space="preserve">
<value>Open Text Extractor settings</value>
</data>
<!-- Workspaces Module -->
<data name="Workspaces_Settings_Subtitle" xml:space="preserve">
<value>Open Workspaces settings</value>
</data>
<data name="Workspaces_OpenEditor_Title" xml:space="preserve">
<value>Workspaces: Open editor</value>
</data>
<data name="Workspaces_OpenEditor_Subtitle" xml:space="preserve">
<value>Create or edit workspaces</value>
</data>
<data name="Workspaces_NoApplications" xml:space="preserve">
<value>No applications</value>
</data>
<data name="Workspaces_Applications_Format" xml:space="preserve">
<value>{0} applications</value>
</data>
<data name="Workspaces_LastLaunched_Format" xml:space="preserve">
<value>Last launched {0}</value>
</data>
<data name="Workspaces_NeverLaunched" xml:space="preserve">
<value>Never launched</value>
</data>
<data name="Workspaces_NoApplicationsInWorkspace" xml:space="preserve">
<value>No applications in this workspace</value>
</data>
<data name="Workspaces_OneApplication" xml:space="preserve">
<value>1 application</value>
</data>
<data name="Workspaces_ApplicationsCount_Format" xml:space="preserve">
<value>{0} applications</value>
</data>
<data name="Workspaces_Workspace" xml:space="preserve">
<value>Workspace</value>
</data>
<data name="Workspaces_App" xml:space="preserve">
<value>App</value>
</data>
<data name="Workspaces_JustNow" xml:space="preserve">
<value>just now</value>
</data>
<data name="Workspaces_MinAgo_Format" xml:space="preserve">
<value>{0} min ago</value>
</data>
<data name="Workspaces_HrAgo_Format" xml:space="preserve">
<value>{0} hr ago</value>
</data>
<data name="Workspaces_DaysAgo_Format" xml:space="preserve">
<value>{0} days ago</value>
</data>
<!-- ZoomIt Module -->
<data name="ZoomIt_Zoom_Title" xml:space="preserve">
<value>ZoomIt: Zoom</value>
</data>
<data name="ZoomIt_Zoom_Subtitle" xml:space="preserve">
<value>Enter zoom mode</value>
</data>
<data name="ZoomIt_Draw_Title" xml:space="preserve">
<value>ZoomIt: Draw</value>
</data>
<data name="ZoomIt_Draw_Subtitle" xml:space="preserve">
<value>Enter drawing mode</value>
</data>
<data name="ZoomIt_Break_Title" xml:space="preserve">
<value>ZoomIt: Break</value>
</data>
<data name="ZoomIt_Break_Subtitle" xml:space="preserve">
<value>Enter break timer</value>
</data>
<data name="ZoomIt_LiveZoom_Title" xml:space="preserve">
<value>ZoomIt: Live Zoom</value>
</data>
<data name="ZoomIt_LiveZoom_Subtitle" xml:space="preserve">
<value>Toggle live zoom</value>
</data>
<data name="ZoomIt_Snip_Title" xml:space="preserve">
<value>ZoomIt: Snip</value>
</data>
<data name="ZoomIt_Snip_Subtitle" xml:space="preserve">
<value>Enter snip mode</value>
</data>
<data name="ZoomIt_Record_Title" xml:space="preserve">
<value>ZoomIt: Record</value>
</data>
<data name="ZoomIt_Record_Subtitle" xml:space="preserve">
<value>Start recording</value>
</data>
<data name="ZoomIt_Settings_Subtitle" xml:space="preserve">
<value>Open ZoomIt settings</value>
</data>
<!-- FancyZones Monitor Details -->
<data name="FancyZones_Monitor" xml:space="preserve">
<value>Monitor</value>
</data>
<data name="FancyZones_Instance" xml:space="preserve">
<value>Instance</value>
</data>
<data name="FancyZones_Serial" xml:space="preserve">
<value>Serial</value>
</data>
<data name="FancyZones_Number" xml:space="preserve">
<value>Number</value>
</data>
<data name="FancyZones_VirtualDesktop" xml:space="preserve">
<value>Virtual desktop</value>
</data>
<data name="FancyZones_WorkArea" xml:space="preserve">
<value>Work area</value>
</data>
<data name="FancyZones_Resolution" xml:space="preserve">
<value>Resolution</value>
</data>
<data name="FancyZones_DPI" xml:space="preserve">
<value>DPI</value>
</data>
<data name="Common_NotAvailable" xml:space="preserve">
<value>N/A</value>
</data>
</root>

View File

@@ -74,18 +74,6 @@ namespace Peek.FilePreviewer.Controls
}
}
public static readonly DependencyProperty IsMarkdownProperty = DependencyProperty.Register(
nameof(IsMarkdown),
typeof(bool),
typeof(BrowserControl),
new PropertyMetadata(false));
public bool IsMarkdown
{
get { return (bool)GetValue(IsMarkdownProperty); }
set { SetValue(IsMarkdownProperty, value); }
}
public static readonly DependencyProperty CustomContextMenuProperty = DependencyProperty.Register(
nameof(CustomContextMenu),
typeof(bool),
@@ -192,13 +180,6 @@ namespace Peek.FilePreviewer.Controls
PreviewBrowser.CoreWebView2.Settings.IsScriptEnabled = IsDevFilePreview;
PreviewBrowser.CoreWebView2.Settings.IsWebMessageEnabled = false;
if (IsMarkdown)
{
PreviewBrowser.CoreWebView2.Settings.IsScriptEnabled = false;
PreviewBrowser.CoreWebView2.AddWebResourceRequestedFilter("*", CoreWebView2WebResourceContext.All);
PreviewBrowser.CoreWebView2.WebResourceRequested += CoreWebView2_WebResourceRequested;
}
if (IsDevFilePreview)
{
PreviewBrowser.CoreWebView2.SetVirtualHostNameToFolderMapping(Microsoft.PowerToys.FilePreviewCommon.MonacoHelper.VirtualHostName, Microsoft.PowerToys.FilePreviewCommon.MonacoHelper.MonacoDirectory, CoreWebView2HostResourceAccessKind.Allow);
@@ -220,15 +201,6 @@ namespace Peek.FilePreviewer.Controls
Navigate();
}
private void CoreWebView2_WebResourceRequested(CoreWebView2 sender, CoreWebView2WebResourceRequestedEventArgs args)
{
// Show local file we've saved with the markdown contents. Block all else.
if (Source != null && new Uri(args.Request.Uri) != Source)
{
args.Response = sender.Environment.CreateWebResourceResponse(null, 403, "Forbidden", null);
}
}
private List<Control> GetContextMenuItems(CoreWebView2 sender, CoreWebView2ContextMenuRequestedEventArgs args)
{
var menuItems = args.MenuItems;

View File

@@ -88,7 +88,6 @@
DOMContentLoaded="BrowserPreview_DOMContentLoaded"
FlowDirection="LeftToRight"
IsDevFilePreview="{x:Bind BrowserPreviewer.IsDevFilePreview, Mode=OneWay}"
IsMarkdown="{x:Bind BrowserPreviewer.IsMarkdown, Mode=OneWay}"
NavigationCompleted="PreviewBrowser_NavigationCompleted"
Source="{x:Bind BrowserPreviewer.Preview, Mode=OneWay}"
Visibility="{x:Bind IsPreviewVisible(BrowserPreviewer, Previewer.State), Mode=OneWay, FallbackValue=Collapsed}" />

View File

@@ -12,8 +12,6 @@ namespace Peek.FilePreviewer.Previewers.Interfaces
public bool IsDevFilePreview { get; }
public bool IsMarkdown { get; }
public bool CustomContextMenu { get; }
}
}

View File

@@ -54,6 +54,8 @@ namespace Peek.FilePreviewer.Previewers
private bool IsPng() => Item.Extension == ".png";
private bool IsSvg() => Item.Extension == ".svg";
private bool IsQoi() => Item.Extension == ".qoi";
private DispatcherQueue Dispatcher { get; }
@@ -61,7 +63,7 @@ namespace Peek.FilePreviewer.Previewers
private static readonly HashSet<string> _supportedFileTypes =
BitmapDecoder.GetDecoderInformationEnumerator()
.SelectMany(di => di.FileExtensions)
.Union([".qoi"])
.Union([".svg", ".qoi"])
.ToHashSet(StringComparer.OrdinalIgnoreCase);
public static bool IsItemSupported(IFileSystemItem item)
@@ -73,7 +75,15 @@ namespace Peek.FilePreviewer.Previewers
{
cancellationToken.ThrowIfCancellationRequested();
if (IsQoi())
if (IsSvg())
{
var size = await Task.Run(Item.GetSvgSize);
if (size != null)
{
ImageSize = size.Value;
}
}
else if (IsQoi())
{
var size = await Task.Run(Item.GetQoiSize);
if (size != null)
@@ -166,16 +176,31 @@ namespace Peek.FilePreviewer.Previewers
{
cancellationToken.ThrowIfCancellationRequested();
if (IsQoi())
using FileStream stream = ReadHelper.OpenReadOnly(Item.Path);
if (IsSvg())
{
var source = new SvgImageSource();
source.RasterizePixelHeight = ImageSize?.Height ?? 0;
source.RasterizePixelWidth = ImageSize?.Width ?? 0;
var loadStatus = await source.SetSourceAsync(stream.AsRandomAccessStream());
if (loadStatus != SvgImageSourceLoadStatus.Success)
{
Logger.LogError("Error loading SVG: " + loadStatus.ToString());
throw new ImageLoadingException(nameof(source));
}
Preview = source;
}
else if (IsQoi())
{
using FileStream stream = ReadHelper.OpenReadOnly(Item.Path);
using var bitmap = QoiImage.FromStream(stream);
Preview = await BitmapHelper.BitmapToImageSource(bitmap, true, cancellationToken);
}
else
{
using FileStream stream = ReadHelper.OpenReadOnly(Item.Path);
Preview = new BitmapImage();
await ((BitmapImage)Preview).SetSourceAsync(stream.AsRandomAccessStream());
}

View File

@@ -33,10 +33,6 @@ namespace Peek.FilePreviewer.Previewers
// Markdown
".md",
// SVG - using WebView2 for better compatibility with complex SVGs
// (e.g., from Adobe Illustrator, Inkscape)
".svg",
};
[ObservableProperty]
@@ -48,9 +44,6 @@ namespace Peek.FilePreviewer.Previewers
[ObservableProperty]
private bool isDevFilePreview;
[ObservableProperty]
private bool isMarkdown;
[ObservableProperty]
private bool customContextMenu;
@@ -118,14 +111,12 @@ namespace Peek.FilePreviewer.Previewers
{
bool isHtml = File.Extension == ".html" || File.Extension == ".htm";
bool isMarkdown = File.Extension == ".md";
bool isSvg = File.Extension == ".svg";
bool supportedByMonaco = MonacoHelper.SupportedMonacoFileTypes.Contains(File.Extension);
bool useMonaco = supportedByMonaco && !isHtml && !isMarkdown && !isSvg;
bool useMonaco = supportedByMonaco && !isHtml && !isMarkdown;
IsDevFilePreview = supportedByMonaco;
CustomContextMenu = useMonaco;
IsMarkdown = isMarkdown;
if (useMonaco)
{
@@ -134,17 +125,9 @@ namespace Peek.FilePreviewer.Previewers
}
else if (isMarkdown)
{
IsDevFilePreview = false;
var raw = await ReadHelper.Read(File.Path.ToString());
Preview = new Uri(MarkdownHelper.PreviewTempFile(raw, File.Path, TempFolderPath.Path));
}
else if (isSvg)
{
// SVG files are rendered directly by WebView2 for better compatibility
// with complex SVGs from Adobe Illustrator, Inkscape, etc.
IsDevFilePreview = false;
Preview = new Uri(File.Path);
}
else
{
// Simple html file to preview. Shouldn't do things like enabling scripts or using a virtual mapped directory.

View File

@@ -344,13 +344,19 @@ IFACEMETHODIMP CPowerRenameRegEx::PutFlags(_In_ DWORD flags)
IFACEMETHODIMP CPowerRenameRegEx::PutFileTime(_In_ SYSTEMTIME fileTime)
{
FILETIME ft1;
FILETIME ft2;
union timeunion
{
FILETIME fileTime;
ULARGE_INTEGER ul;
};
SystemTimeToFileTime(&m_fileTime, &ft1);
SystemTimeToFileTime(&fileTime, &ft2);
timeunion ft1;
timeunion ft2;
if (ft2.dwLowDateTime != ft1.dwLowDateTime || ft2.dwHighDateTime != ft1.dwHighDateTime)
SystemTimeToFileTime(&m_fileTime, &ft1.fileTime);
SystemTimeToFileTime(&fileTime, &ft2.fileTime);
if (ft2.ul.QuadPart != ft1.ul.QuadPart)
{
m_fileTime = fileTime;
m_useFileTime = true;