mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-21 18:49:56 +01:00
Compare commits
6 Commits
async-cpp-
...
v0.95.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd2a3915ef | ||
|
|
4345b95527 | ||
|
|
c0f7ec0265 | ||
|
|
c2d1214974 | ||
|
|
f732185885 | ||
|
|
ad207da3f3 |
1
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
1
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -58,6 +58,7 @@ body:
|
|||||||
- Image Resizer
|
- Image Resizer
|
||||||
- Installer
|
- Installer
|
||||||
- Keyboard Manager
|
- Keyboard Manager
|
||||||
|
- Light Switch
|
||||||
- Mouse Utilities
|
- Mouse Utilities
|
||||||
- Mouse Without Borders
|
- Mouse Without Borders
|
||||||
- New+
|
- New+
|
||||||
|
|||||||
1
.github/ISSUE_TEMPLATE/translation_issue.yml
vendored
1
.github/ISSUE_TEMPLATE/translation_issue.yml
vendored
@@ -38,6 +38,7 @@ body:
|
|||||||
- Image Resizer
|
- Image Resizer
|
||||||
- Installer
|
- Installer
|
||||||
- Keyboard Manager
|
- Keyboard Manager
|
||||||
|
- Light Switch
|
||||||
- Mouse Utilities
|
- Mouse Utilities
|
||||||
- Mouse Without Borders
|
- Mouse Without Borders
|
||||||
- New+
|
- New+
|
||||||
|
|||||||
@@ -63,14 +63,14 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
|||||||
@@ -244,7 +244,36 @@ public partial class MainListPage : DynamicListPage,
|
|||||||
var commands = _tlcManager.TopLevelCommands;
|
var commands = _tlcManager.TopLevelCommands;
|
||||||
lock (commands)
|
lock (commands)
|
||||||
{
|
{
|
||||||
UpdateFallbacks(SearchText, commands.ToImmutableArray(), token);
|
if (token.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// prefilter fallbacks
|
||||||
|
var specialFallbacks = new List<TopLevelViewModel>(_specialFallbacks.Length);
|
||||||
|
var commonFallbacks = new List<TopLevelViewModel>();
|
||||||
|
|
||||||
|
foreach (var s in commands)
|
||||||
|
{
|
||||||
|
if (!s.IsFallback)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_specialFallbacks.Contains(s.CommandProviderId))
|
||||||
|
{
|
||||||
|
specialFallbacks.Add(s);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
commonFallbacks.Add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// start update of fallbacks; update special fallbacks separately,
|
||||||
|
// so they can finish faster
|
||||||
|
UpdateFallbacks(SearchText, specialFallbacks, token);
|
||||||
|
UpdateFallbacks(SearchText, commonFallbacks, token);
|
||||||
|
|
||||||
if (token.IsCancellationRequested)
|
if (token.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
@@ -316,15 +345,12 @@ public partial class MainListPage : DynamicListPage,
|
|||||||
// with a list of all our commands & apps.
|
// with a list of all our commands & apps.
|
||||||
if (!newFilteredItems.Any() && !newApps.Any())
|
if (!newFilteredItems.Any() && !newApps.Any())
|
||||||
{
|
{
|
||||||
// We're going to start over with our fallbacks
|
|
||||||
newFallbacks = Enumerable.Empty<IListItem>();
|
|
||||||
|
|
||||||
newFilteredItems = commands.Where(s => !s.IsFallback);
|
newFilteredItems = commands.Where(s => !s.IsFallback);
|
||||||
|
|
||||||
// Fallbacks are always included in the list, even if they
|
// Fallbacks are always included in the list, even if they
|
||||||
// don't match the search text. But we don't want to
|
// don't match the search text. But we don't want to
|
||||||
// consider them when filtering the list.
|
// consider them when filtering the list.
|
||||||
newFallbacks = commands.Where(s => s.IsFallback && !_specialFallbacks.Contains(s.CommandProviderId));
|
newFallbacks = commonFallbacks;
|
||||||
|
|
||||||
if (token.IsCancellationRequested)
|
if (token.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
xmlns:toolkit="using:CommunityToolkit.WinUI.Controls"
|
xmlns:toolkit="using:CommunityToolkit.WinUI.Controls"
|
||||||
xmlns:ui="using:CommunityToolkit.WinUI"
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
xmlns:viewModels="using:Microsoft.CmdPal.UI.ViewModels"
|
xmlns:viewModels="using:Microsoft.CmdPal.UI.ViewModels"
|
||||||
Background="Transparent"
|
|
||||||
PreviewKeyDown="UserControl_PreviewKeyDown"
|
PreviewKeyDown="UserControl_PreviewKeyDown"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
@@ -22,7 +21,7 @@
|
|||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<cmdpalUI:KeyChordToStringConverter x:Key="KeyChordToStringConverter" />
|
<cmdpalUI:KeyChordToStringConverter x:Key="KeyChordToStringConverter" />
|
||||||
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||||||
|
<Thickness x:Key="DefaultContextMenuItemPadding">12,8,12,8</Thickness>
|
||||||
<cmdpalUI:ContextItemTemplateSelector
|
<cmdpalUI:ContextItemTemplateSelector
|
||||||
x:Key="ContextItemTemplateSelector"
|
x:Key="ContextItemTemplateSelector"
|
||||||
Critical="{StaticResource CriticalContextMenuViewModelTemplate}"
|
Critical="{StaticResource CriticalContextMenuViewModelTemplate}"
|
||||||
@@ -31,7 +30,7 @@
|
|||||||
|
|
||||||
<!-- Template for context items in the context item menu -->
|
<!-- Template for context items in the context item menu -->
|
||||||
<DataTemplate x:Key="DefaultContextMenuViewModelTemplate" x:DataType="coreViewModels:CommandContextItemViewModel">
|
<DataTemplate x:Key="DefaultContextMenuViewModelTemplate" x:DataType="coreViewModels:CommandContextItemViewModel">
|
||||||
<Grid AutomationProperties.Name="{x:Bind Title, Mode=OneWay}">
|
<Grid Padding="{StaticResource DefaultContextMenuItemPadding}" AutomationProperties.Name="{x:Bind Title, Mode=OneWay}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="32" />
|
<ColumnDefinition Width="32" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
@@ -71,7 +70,7 @@
|
|||||||
|
|
||||||
<!-- Template for context items flagged as critical -->
|
<!-- Template for context items flagged as critical -->
|
||||||
<DataTemplate x:Key="CriticalContextMenuViewModelTemplate" x:DataType="coreViewModels:CommandContextItemViewModel">
|
<DataTemplate x:Key="CriticalContextMenuViewModelTemplate" x:DataType="coreViewModels:CommandContextItemViewModel">
|
||||||
<Grid AutomationProperties.Name="{x:Bind Title, Mode=OneWay}">
|
<Grid Padding="{StaticResource DefaultContextMenuItemPadding}" AutomationProperties.Name="{x:Bind Title, Mode=OneWay}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="32" />
|
<ColumnDefinition Width="32" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
@@ -114,7 +113,7 @@
|
|||||||
<DataTemplate x:Key="SeparatorContextMenuViewModelTemplate" x:DataType="coreViewModels:SeparatorViewModel">
|
<DataTemplate x:Key="SeparatorContextMenuViewModelTemplate" x:DataType="coreViewModels:SeparatorViewModel">
|
||||||
<Rectangle
|
<Rectangle
|
||||||
Height="1"
|
Height="1"
|
||||||
Margin="-16,-12,-12,-12"
|
Margin="0,2,0,2"
|
||||||
Fill="{ThemeResource MenuFlyoutSeparatorBackground}" />
|
Fill="{ThemeResource MenuFlyoutSeparatorBackground}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -125,35 +124,39 @@
|
|||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
<ListView
|
||||||
<StackPanel x:Name="CommandsPanel">
|
x:Name="CommandsDropdown"
|
||||||
<ListView
|
MinWidth="248"
|
||||||
x:Name="CommandsDropdown"
|
Margin="0,4,0,2"
|
||||||
MinWidth="248"
|
IsItemClickEnabled="True"
|
||||||
IsItemClickEnabled="True"
|
ItemClick="CommandsDropdown_ItemClick"
|
||||||
ItemClick="CommandsDropdown_ItemClick"
|
ItemTemplateSelector="{StaticResource ContextItemTemplateSelector}"
|
||||||
ItemTemplateSelector="{StaticResource ContextItemTemplateSelector}"
|
ItemsSource="{x:Bind ViewModel.FilteredItems, Mode=OneWay}"
|
||||||
ItemsSource="{x:Bind ViewModel.FilteredItems, Mode=OneWay}"
|
PreviewKeyDown="CommandsDropdown_PreviewKeyDown"
|
||||||
PreviewKeyDown="CommandsDropdown_PreviewKeyDown"
|
SelectionMode="Single">
|
||||||
SelectionMode="Single">
|
<ListView.ItemContainerStyle>
|
||||||
<ListView.ItemContainerStyle>
|
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
|
||||||
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
|
<Setter Property="MinHeight" Value="0" />
|
||||||
<Setter Property="MinHeight" Value="0" />
|
<Setter Property="Padding" Value="0" />
|
||||||
<Setter Property="Padding" Value="12,8" />
|
</Style>
|
||||||
</Style>
|
</ListView.ItemContainerStyle>
|
||||||
</ListView.ItemContainerStyle>
|
<ListView.ItemContainerTransitions>
|
||||||
<ListView.ItemContainerTransitions>
|
<TransitionCollection />
|
||||||
<TransitionCollection />
|
</ListView.ItemContainerTransitions>
|
||||||
</ListView.ItemContainerTransitions>
|
</ListView>
|
||||||
</ListView>
|
<Border BorderBrush="{ThemeResource MenuFlyoutSeparatorBackground}" BorderThickness="0,0,0,1" />
|
||||||
</StackPanel>
|
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="ContextFilterBox"
|
x:Name="ContextFilterBox"
|
||||||
x:Uid="ContextFilterBox"
|
x:Uid="ContextFilterBox"
|
||||||
Margin="4"
|
Margin="0"
|
||||||
|
Padding="10,7,6,8"
|
||||||
|
Background="{ThemeResource AcrylicBackgroundFillColorBaseBrush}"
|
||||||
|
BorderThickness="0,0,0,2"
|
||||||
|
CornerRadius="8, 8, 0, 0"
|
||||||
IsTextScaleFactorEnabled="True"
|
IsTextScaleFactorEnabled="True"
|
||||||
KeyDown="ContextFilterBox_KeyDown"
|
KeyDown="ContextFilterBox_KeyDown"
|
||||||
PreviewKeyDown="ContextFilterBox_PreviewKeyDown"
|
PreviewKeyDown="ContextFilterBox_PreviewKeyDown"
|
||||||
|
Style="{StaticResource SearchTextBoxStyle}"
|
||||||
TextChanged="ContextFilterBox_TextChanged" />
|
TextChanged="ContextFilterBox_TextChanged" />
|
||||||
<VisualStateManager.VisualStateGroups>
|
<VisualStateManager.VisualStateGroups>
|
||||||
<VisualStateGroup x:Name="ContextMenuOrder">
|
<VisualStateGroup x:Name="ContextMenuOrder">
|
||||||
@@ -162,9 +165,11 @@
|
|||||||
<ui:IsEqualStateTrigger Value="{x:Bind ViewModel.FilterOnTop, Mode=OneWay}" To="True" />
|
<ui:IsEqualStateTrigger Value="{x:Bind ViewModel.FilterOnTop, Mode=OneWay}" To="True" />
|
||||||
</VisualState.StateTriggers>
|
</VisualState.StateTriggers>
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="CommandsPanel.(Grid.Row)" Value="1" />
|
<Setter Target="CommandsDropdown.(Grid.Row)" Value="1" />
|
||||||
<Setter Target="ContextFilterBox.(Grid.Row)" Value="0" />
|
<Setter Target="ContextFilterBox.(Grid.Row)" Value="0" />
|
||||||
<Setter Target="CommandsDropdown.Margin" Value="0, 0, 0, 4" />
|
<Setter Target="CommandsDropdown.Margin" Value="0, 3, 0, 4" />
|
||||||
|
<Setter Target="ContextFilterBox.CornerRadius" Value="8, 8, 0, 0" />
|
||||||
|
<Setter Target="ContextFilterBox.Margin" Value="0,0,0,-1" />
|
||||||
</VisualState.Setters>
|
</VisualState.Setters>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
<VisualState x:Name="FilterOnBottom">
|
<VisualState x:Name="FilterOnBottom">
|
||||||
@@ -172,9 +177,11 @@
|
|||||||
<ui:IsEqualStateTrigger Value="{x:Bind ViewModel.FilterOnTop, Mode=OneWay}" To="False" />
|
<ui:IsEqualStateTrigger Value="{x:Bind ViewModel.FilterOnTop, Mode=OneWay}" To="False" />
|
||||||
</VisualState.StateTriggers>
|
</VisualState.StateTriggers>
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="CommandsPanel.(Grid.Row)" Value="0" />
|
<Setter Target="CommandsDropdown.(Grid.Row)" Value="0" />
|
||||||
<Setter Target="ContextFilterBox.(Grid.Row)" Value="1" />
|
<Setter Target="ContextFilterBox.(Grid.Row)" Value="1" />
|
||||||
<Setter Target="CommandsDropdown.Margin" Value="0, 4, 0, 0" />
|
<Setter Target="CommandsDropdown.Margin" Value="0, 4, 0, 4" />
|
||||||
|
<Setter Target="ContextFilterBox.CornerRadius" Value="0, 0, 8, 8" />
|
||||||
|
<Setter Target="ContextFilterBox.Margin" Value="0,0,0,-2" />
|
||||||
</VisualState.Setters>
|
</VisualState.Setters>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
</VisualStateGroup>
|
</VisualStateGroup>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.props')" />
|
<Import Project="..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.props')" />
|
||||||
|
<Import Project="..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.MSIX.1.7.20250829.1\build\Microsoft.Windows.SDK.BuildTools.MSIX.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.MSIX.1.7.20250829.1\build\Microsoft.Windows.SDK.BuildTools.MSIX.props')" />
|
||||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" />
|
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<CppWinRTOptimized>true</CppWinRTOptimized>
|
<CppWinRTOptimized>true</CppWinRTOptimized>
|
||||||
@@ -214,7 +215,8 @@
|
|||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
|
<Import Project="..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
|
||||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.targets')" />
|
<Import Project="..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.targets')" />
|
||||||
|
<Import Project="..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.MSIX.1.7.20250829.1\build\Microsoft.Windows.SDK.BuildTools.MSIX.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.MSIX.1.7.20250829.1\build\Microsoft.Windows.SDK.BuildTools.MSIX.targets')" />
|
||||||
<Import Project="..\..\..\..\packages\Microsoft.Web.WebView2.1.0.2903.40\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Web.WebView2.1.0.2903.40\build\native\Microsoft.Web.WebView2.targets')" />
|
<Import Project="..\..\..\..\packages\Microsoft.Web.WebView2.1.0.2903.40\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Web.WebView2.1.0.2903.40\build\native\Microsoft.Web.WebView2.targets')" />
|
||||||
<Import Project="..\..\..\..\packages\Microsoft.WindowsAppSDK.1.8.250907003\build\native\Microsoft.WindowsAppSDK.targets" Condition="Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.8.250907003\build\native\Microsoft.WindowsAppSDK.targets')" />
|
<Import Project="..\..\..\..\packages\Microsoft.WindowsAppSDK.1.8.250907003\build\native\Microsoft.WindowsAppSDK.targets" Condition="Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.8.250907003\build\native\Microsoft.WindowsAppSDK.targets')" />
|
||||||
<Import Project="..\..\..\..\packages\Microsoft.WindowsAppSDK.Base.1.8.250831001\build\native\Microsoft.WindowsAppSDK.Base.targets" Condition="Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.Base.1.8.250831001\build\native\Microsoft.WindowsAppSDK.Base.targets')" />
|
<Import Project="..\..\..\..\packages\Microsoft.WindowsAppSDK.Base.1.8.250831001\build\native\Microsoft.WindowsAppSDK.Base.targets" Condition="Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.Base.1.8.250831001\build\native\Microsoft.WindowsAppSDK.Base.targets')" />
|
||||||
@@ -235,6 +237,8 @@
|
|||||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
|
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
|
||||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.props'))" />
|
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.props'))" />
|
||||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.targets'))" />
|
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.26100.4188\build\Microsoft.Windows.SDK.BuildTools.targets'))" />
|
||||||
|
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.MSIX.1.7.20250829.1\build\Microsoft.Windows.SDK.BuildTools.MSIX.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.MSIX.1.7.20250829.1\build\Microsoft.Windows.SDK.BuildTools.MSIX.props'))" />
|
||||||
|
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.MSIX.1.7.20250829.1\build\Microsoft.Windows.SDK.BuildTools.MSIX.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.MSIX.1.7.20250829.1\build\Microsoft.Windows.SDK.BuildTools.MSIX.targets'))" />
|
||||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Web.WebView2.1.0.2903.40\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Web.WebView2.1.0.2903.40\build\native\Microsoft.Web.WebView2.targets'))" />
|
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Web.WebView2.1.0.2903.40\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Web.WebView2.1.0.2903.40\build\native\Microsoft.Web.WebView2.targets'))" />
|
||||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.8.250907003\build\native\Microsoft.WindowsAppSDK.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.WindowsAppSDK.1.8.250907003\build\native\Microsoft.WindowsAppSDK.props'))" />
|
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.8.250907003\build\native\Microsoft.WindowsAppSDK.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.WindowsAppSDK.1.8.250907003\build\native\Microsoft.WindowsAppSDK.props'))" />
|
||||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.8.250907003\build\native\Microsoft.WindowsAppSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.WindowsAppSDK.1.8.250907003\build\native\Microsoft.WindowsAppSDK.targets'))" />
|
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.8.250907003\build\native\Microsoft.WindowsAppSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.WindowsAppSDK.1.8.250907003\build\native\Microsoft.WindowsAppSDK.targets'))" />
|
||||||
|
|||||||
@@ -3,14 +3,17 @@
|
|||||||
// See the LICENSE file in the project root for more information.
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
using ManagedCommon;
|
||||||
using Microsoft.PowerToys.Settings.UI.Library;
|
using Microsoft.PowerToys.Settings.UI.Library;
|
||||||
|
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
|
||||||
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
|
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
|
||||||
|
|
||||||
namespace Settings.UI.Library
|
namespace Settings.UI.Library
|
||||||
{
|
{
|
||||||
public class LightSwitchSettings : BasePTModuleSettings, ISettingsConfig, ICloneable
|
public class LightSwitchSettings : BasePTModuleSettings, ISettingsConfig, ICloneable, IHotkeyConfig
|
||||||
{
|
{
|
||||||
public const string ModuleName = "LightSwitch";
|
public const string ModuleName = "LightSwitch";
|
||||||
|
|
||||||
@@ -24,6 +27,21 @@ namespace Settings.UI.Library
|
|||||||
[JsonPropertyName("properties")]
|
[JsonPropertyName("properties")]
|
||||||
public LightSwitchProperties Properties { get; set; }
|
public LightSwitchProperties Properties { get; set; }
|
||||||
|
|
||||||
|
public HotkeyAccessor[] GetAllHotkeyAccessors()
|
||||||
|
{
|
||||||
|
var hotkeyAccessors = new List<HotkeyAccessor>
|
||||||
|
{
|
||||||
|
new HotkeyAccessor(
|
||||||
|
() => Properties.ToggleThemeHotkey.Value,
|
||||||
|
value => Properties.ToggleThemeHotkey.Value = value ?? LightSwitchProperties.DefaultToggleThemeHotkey,
|
||||||
|
"LightSwitch_ThemeToggle_Shortcut"),
|
||||||
|
};
|
||||||
|
|
||||||
|
return hotkeyAccessors.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModuleType GetModuleType() => ModuleType.LightSwitch;
|
||||||
|
|
||||||
public object Clone()
|
public object Clone()
|
||||||
{
|
{
|
||||||
return new LightSwitchSettings()
|
return new LightSwitchSettings()
|
||||||
@@ -41,6 +59,7 @@ namespace Settings.UI.Library
|
|||||||
SunsetOffset = new IntProperty((int)Properties.SunsetOffset.Value),
|
SunsetOffset = new IntProperty((int)Properties.SunsetOffset.Value),
|
||||||
Latitude = new StringProperty(Properties.Latitude.Value),
|
Latitude = new StringProperty(Properties.Latitude.Value),
|
||||||
Longitude = new StringProperty(Properties.Longitude.Value),
|
Longitude = new StringProperty(Properties.Longitude.Value),
|
||||||
|
ToggleThemeHotkey = new KeyboardKeysProperty(Properties.ToggleThemeHotkey.Value),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
|||||||
|
|
||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
this.Loaded += LightSwitchPage_Loaded;
|
this.Loaded += LightSwitchPage_Loaded;
|
||||||
|
this.Loaded += (s, e) => ViewModel.OnPageLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LightSwitchPage_Loaded(object sender, RoutedEventArgs e)
|
private void LightSwitchPage_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
@@ -177,6 +177,9 @@
|
|||||||
AutomationProperties.AutomationId="SystemToolsNavItem"
|
AutomationProperties.AutomationId="SystemToolsNavItem"
|
||||||
Icon="{ui:BitmapIcon Source=/Assets/Settings/Icons/SystemTools.png}"
|
Icon="{ui:BitmapIcon Source=/Assets/Settings/Icons/SystemTools.png}"
|
||||||
SelectsOnInvoked="False">
|
SelectsOnInvoked="False">
|
||||||
|
<NavigationViewItem.InfoBadge>
|
||||||
|
<InfoBadge Style="{StaticResource NewInfoBadge}" />
|
||||||
|
</NavigationViewItem.InfoBadge>
|
||||||
<NavigationViewItem.MenuItems>
|
<NavigationViewItem.MenuItems>
|
||||||
<NavigationViewItem
|
<NavigationViewItem
|
||||||
x:Name="AdvancedPasteNavigationItem"
|
x:Name="AdvancedPasteNavigationItem"
|
||||||
@@ -207,7 +210,11 @@
|
|||||||
x:Uid="Shell_LightSwitch"
|
x:Uid="Shell_LightSwitch"
|
||||||
helpers:NavHelper.NavigateTo="views:LightSwitchPage"
|
helpers:NavHelper.NavigateTo="views:LightSwitchPage"
|
||||||
AutomationProperties.AutomationId="LightSwitchNavItem"
|
AutomationProperties.AutomationId="LightSwitchNavItem"
|
||||||
Icon="{ui:BitmapIcon Source=/Assets/Settings/Icons/LightSwitch.png}" />
|
Icon="{ui:BitmapIcon Source=/Assets/Settings/Icons/LightSwitch.png}">
|
||||||
|
<NavigationViewItem.InfoBadge>
|
||||||
|
<InfoBadge Style="{StaticResource NewInfoBadge}" />
|
||||||
|
</NavigationViewItem.InfoBadge>
|
||||||
|
</NavigationViewItem>
|
||||||
<NavigationViewItem
|
<NavigationViewItem
|
||||||
x:Name="PowerLauncherNavigationItem"
|
x:Name="PowerLauncherNavigationItem"
|
||||||
x:Uid="Shell_PowerLauncher"
|
x:Uid="Shell_PowerLauncher"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
// See the LICENSE file in the project root for more information.
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -20,8 +21,10 @@ using Settings.UI.Library.Helpers;
|
|||||||
|
|
||||||
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||||
{
|
{
|
||||||
public partial class LightSwitchViewModel : Observable
|
public partial class LightSwitchViewModel : PageViewModelBase
|
||||||
{
|
{
|
||||||
|
protected override string ModuleName => LightSwitchSettings.ModuleName;
|
||||||
|
|
||||||
private Func<string, int> SendConfigMSG { get; }
|
private Func<string, int> SendConfigMSG { get; }
|
||||||
|
|
||||||
public ObservableCollection<SearchLocation> SearchLocations { get; } = new();
|
public ObservableCollection<SearchLocation> SearchLocations { get; } = new();
|
||||||
@@ -35,14 +38,24 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|||||||
ForceDarkCommand = new RelayCommand(ForceDarkNow);
|
ForceDarkCommand = new RelayCommand(ForceDarkNow);
|
||||||
|
|
||||||
AvailableScheduleModes = new ObservableCollection<string>
|
AvailableScheduleModes = new ObservableCollection<string>
|
||||||
{
|
{
|
||||||
"FixedHours",
|
"FixedHours",
|
||||||
"SunsetToSunrise",
|
"SunsetToSunrise",
|
||||||
};
|
};
|
||||||
|
|
||||||
_toggleThemeHotkey = _moduleSettings.Properties.ToggleThemeHotkey.Value;
|
_toggleThemeHotkey = _moduleSettings.Properties.ToggleThemeHotkey.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override Dictionary<string, HotkeySettings[]> GetAllHotkeySettings()
|
||||||
|
{
|
||||||
|
var hotkeysDict = new Dictionary<string, HotkeySettings[]>
|
||||||
|
{
|
||||||
|
[ModuleName] = [ToggleThemeActivationShortcut],
|
||||||
|
};
|
||||||
|
|
||||||
|
return hotkeysDict;
|
||||||
|
}
|
||||||
|
|
||||||
private void ForceLightNow()
|
private void ForceLightNow()
|
||||||
{
|
{
|
||||||
Logger.LogInfo("Sending custom action: forceLight");
|
Logger.LogInfo("Sending custom action: forceLight");
|
||||||
@@ -395,22 +408,21 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|||||||
|
|
||||||
public HotkeySettings ToggleThemeActivationShortcut
|
public HotkeySettings ToggleThemeActivationShortcut
|
||||||
{
|
{
|
||||||
get => _toggleThemeHotkey;
|
get => ModuleSettings.Properties.ToggleThemeHotkey.Value;
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value != _toggleThemeHotkey)
|
if (value != ModuleSettings.Properties.ToggleThemeHotkey.Value)
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
_toggleThemeHotkey = LightSwitchProperties.DefaultToggleThemeHotkey;
|
ModuleSettings.Properties.ToggleThemeHotkey.Value = LightSwitchProperties.DefaultToggleThemeHotkey;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_toggleThemeHotkey = value;
|
ModuleSettings.Properties.ToggleThemeHotkey.Value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
_moduleSettings.Properties.ToggleThemeHotkey.Value = _toggleThemeHotkey;
|
|
||||||
NotifyPropertyChanged();
|
NotifyPropertyChanged();
|
||||||
|
|
||||||
SendConfigMSG(
|
SendConfigMSG(
|
||||||
@@ -418,7 +430,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|||||||
CultureInfo.InvariantCulture,
|
CultureInfo.InvariantCulture,
|
||||||
"{{ \"powertoys\": {{ \"{0}\": {1} }} }}",
|
"{{ \"powertoys\": {{ \"{0}\": {1} }} }}",
|
||||||
LightSwitchSettings.ModuleName,
|
LightSwitchSettings.ModuleName,
|
||||||
JsonSerializer.Serialize(_moduleSettings, (System.Text.Json.Serialization.Metadata.JsonTypeInfo<LightSwitchSettings>)SourceGenerationContextContext.Default.LightSwitchSettings)));
|
JsonSerializer.Serialize(_moduleSettings, SourceGenerationContextContext.Default.LightSwitchSettings)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user