Add aspect ratio checkbox to ZoomIt UI (#47695)

<!-- 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
Exposes the 16:9 aspect ratio toggle for the ZoomIt screen region
recording (default: `Ctrl`+`Shift`+`5`) in the settings UI.

<img width="1047" height="817" alt="image"
src="https://github.com/user-attachments/assets/4117a6a1-9f57-44c5-9a21-1b1b65bc2992"
/>

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [ ] Closes: #xxx
<!-- - [ ] 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
Checked that the toggle works and that it's compatible with the
standalone ZoomIt, too.
This commit is contained in:
Alex Mihaiuc
2026-05-06 19:22:26 +02:00
committed by GitHub
parent f0c9a17fd1
commit 2aedb932e5
4 changed files with 22 additions and 0 deletions

View File

@@ -117,6 +117,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public IntProperty WebcamShape { get; set; }
public BoolProperty RecordAspectRatio { get; set; }
public BoolProperty BreakLockWorkstation { get; set; }
}
}

View File

@@ -272,6 +272,9 @@
TickPlacement="Outside"
Value="{x:Bind ViewModel.RecordScaling, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard Name="ZoomItRecordAspectRatio" ContentAlignment="Left">
<CheckBox x:Uid="ZoomIt_Record_AspectRatio" IsChecked="{x:Bind ViewModel.RecordAspectRatio, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard Name="ZoomItRecordFormat" x:Uid="ZoomIt_Record_Format">
<ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{x:Bind ViewModel.RecordFormatIndex, Mode=TwoWay}">
<ComboBoxItem>GIF</ComboBoxItem>

View File

@@ -4872,6 +4872,9 @@ The break timer font matches the text font.</value>
<data name="ZoomIt_Record_WebcamShape_Circle.Content" xml:space="preserve">
<value>Circle</value>
</data>
<data name="ZoomIt_Record_AspectRatio.Content" xml:space="preserve">
<value>Lock region selection to 16:9 aspect ratio</value>
</data>
<data name="ZoomIt_Break_LockWorkstation.Content" xml:space="preserve">
<value>Lock workstation during break</value>
</data>

View File

@@ -1113,6 +1113,20 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
}
}
public bool RecordAspectRatio
{
get => _zoomItSettings.Properties.RecordAspectRatio.Value;
set
{
if (_zoomItSettings.Properties.RecordAspectRatio.Value != value)
{
_zoomItSettings.Properties.RecordAspectRatio.Value = value;
OnPropertyChanged(nameof(RecordAspectRatio));
NotifySettingsChanged();
}
}
}
private void NotifySettingsChanged()
{
global::PowerToys.ZoomItSettingsInterop.ZoomItSettings.SaveSettingsJson(