Files
PowerToys/src/common/Common.UI.Controls/Controls/ShortcutWithTextLabelControl/ShortcutWithTextLabelControl.xaml

68 lines
3.8 KiB
Plaintext
Raw Normal View History

[ZoomIt] Show users full hotkey list in settings (#43073) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request This PR enhances the ZoomIt settings UI by refactoring some of the XAML code and putting instructions as part of the settingsexpanders. Additionally, the alternate hotkey combinations are now shown too and will be updated based on the configured hotkey. so that **Users will now be able to see all the hotkeys**. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #42236 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed ### ZoomIt Extended (Derived) Hotkeys Feature | Base Key Property | Default Base Key | Derived Key Property | XOR Logic | Default Derived Key | Description -- | -- | -- | -- | -- | -- | -- LiveZoom | LiveZoomToggleKey | Ctrl+4 | LiveZoomToggleKeyDraw | XOR Shift | Ctrl+Shift+4 | Enter drawing mode in LiveZoom Record | RecordToggleKey | Ctrl+5 | RecordToggleKeyCrop | XOR Shift | Ctrl+Shift+5 | Record selected region (crop) Record | RecordToggleKey | Ctrl+5 | RecordToggleKeyWindow | XOR Alt | Ctrl+Alt+5 | Record specific window Snip | SnipToggleKey | Ctrl+6 | SnipToggleKeySave | XOR Shift | Ctrl+Shift+6 | Snip and save to file DemoType | DemoTypeToggleKey | Ctrl+7 | DemoTypeToggleKeyReset | XOR Shift | Ctrl+Shift+7 | Rewind to previous segment <img width="832" height="3679" alt="Frame 2018778631" src="https://github.com/user-attachments/assets/bebddcd8-d705-4582-ae8a-c847cb1c3e88" /> --------- Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com> Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: Kai Tao <vanzue@users.noreply.github.com>
2026-01-28 10:37:22 +08:00
<?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Creating a Common.UI.Controls lib (#45542) ## Summary of the Pull Request @jiripolasek FYI This PR creates a new `Common.UI.Controls` library that contains shared WinUI controls. We have been copying code manually between CmdPal and Settings, and now with the new KBM we will run into the same issue. This lib has shared controls projects can add to their proj so we have a single source of truth. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #45388 <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --------- Co-authored-by: Jiří Polášek <me@jiripolasek.com>
2026-02-12 16:45:44 +01:00
xmlns:local="using:Microsoft.PowerToys.Common.UI.Controls"
[ZoomIt] Show users full hotkey list in settings (#43073) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request This PR enhances the ZoomIt settings UI by refactoring some of the XAML code and putting instructions as part of the settingsexpanders. Additionally, the alternate hotkey combinations are now shown too and will be updated based on the configured hotkey. so that **Users will now be able to see all the hotkeys**. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #42236 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed ### ZoomIt Extended (Derived) Hotkeys Feature | Base Key Property | Default Base Key | Derived Key Property | XOR Logic | Default Derived Key | Description -- | -- | -- | -- | -- | -- | -- LiveZoom | LiveZoomToggleKey | Ctrl+4 | LiveZoomToggleKeyDraw | XOR Shift | Ctrl+Shift+4 | Enter drawing mode in LiveZoom Record | RecordToggleKey | Ctrl+5 | RecordToggleKeyCrop | XOR Shift | Ctrl+Shift+5 | Record selected region (crop) Record | RecordToggleKey | Ctrl+5 | RecordToggleKeyWindow | XOR Alt | Ctrl+Alt+5 | Record specific window Snip | SnipToggleKey | Ctrl+6 | SnipToggleKeySave | XOR Shift | Ctrl+Shift+6 | Snip and save to file DemoType | DemoTypeToggleKey | Ctrl+7 | DemoTypeToggleKeyReset | XOR Shift | Ctrl+Shift+7 | Rewind to previous segment <img width="832" height="3679" alt="Frame 2018778631" src="https://github.com/user-attachments/assets/bebddcd8-d705-4582-ae8a-c847cb1c3e88" /> --------- Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com> Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: Kai Tao <vanzue@users.noreply.github.com>
2026-01-28 10:37:22 +08:00
xmlns:tk="using:CommunityToolkit.WinUI"
xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls">
[ZoomIt] Show users full hotkey list in settings (#43073) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request This PR enhances the ZoomIt settings UI by refactoring some of the XAML code and putting instructions as part of the settingsexpanders. Additionally, the alternate hotkey combinations are now shown too and will be updated based on the configured hotkey. so that **Users will now be able to see all the hotkeys**. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #42236 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed ### ZoomIt Extended (Derived) Hotkeys Feature | Base Key Property | Default Base Key | Derived Key Property | XOR Logic | Default Derived Key | Description -- | -- | -- | -- | -- | -- | -- LiveZoom | LiveZoomToggleKey | Ctrl+4 | LiveZoomToggleKeyDraw | XOR Shift | Ctrl+Shift+4 | Enter drawing mode in LiveZoom Record | RecordToggleKey | Ctrl+5 | RecordToggleKeyCrop | XOR Shift | Ctrl+Shift+5 | Record selected region (crop) Record | RecordToggleKey | Ctrl+5 | RecordToggleKeyWindow | XOR Alt | Ctrl+Alt+5 | Record specific window Snip | SnipToggleKey | Ctrl+6 | SnipToggleKeySave | XOR Shift | Ctrl+Shift+6 | Snip and save to file DemoType | DemoTypeToggleKey | Ctrl+7 | DemoTypeToggleKeyReset | XOR Shift | Ctrl+Shift+7 | Rewind to previous segment <img width="832" height="3679" alt="Frame 2018778631" src="https://github.com/user-attachments/assets/bebddcd8-d705-4582-ae8a-c847cb1c3e88" /> --------- Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com> Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: Kai Tao <vanzue@users.noreply.github.com>
2026-01-28 10:37:22 +08:00
<Style BasedOn="{StaticResource DefaultShortcutWithTextLabelControlStyle}" TargetType="local:ShortcutWithTextLabelControl" />
<Style x:Key="DefaultShortcutWithTextLabelControlStyle" TargetType="local:ShortcutWithTextLabelControl">
<Setter Property="KeyVisualStyle" Value="{StaticResource DefaultKeyVisualStyle}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:ShortcutWithTextLabelControl">
<Grid ColumnSpacing="8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ItemsControl
x:Name="ShortcutsControl"
VerticalAlignment="Bottom"
AutomationProperties.AccessibilityView="Raw"
IsTabStop="False"
ItemsSource="{TemplateBinding Keys}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Spacing="4" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<local:KeyVisual
tk:FrameworkElementExtensions.AncestorType="local:ShortcutWithTextLabelControl"
AutomationProperties.AccessibilityView="Raw"
Content="{Binding}"
IsTabStop="False"
Style="{Binding (tk:FrameworkElementExtensions.Ancestor).KeyVisualStyle, RelativeSource={RelativeSource Self}}" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<tkcontrols:MarkdownTextBlock
x:Name="LabelControl"
Grid.Column="1"
VerticalAlignment="Center"
Config="{TemplateBinding MarkdownConfig}"
Text="{TemplateBinding Text}" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="LabelPlacementStates">
<VisualState x:Name="LabelAfter" />
<VisualState x:Name="LabelBefore">
<VisualState.Setters>
<Setter Target="LabelControl.(Grid.Column)" Value="0" />
<Setter Target="ShortcutsControl.(Grid.Column)" Value="1" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>