diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index e25f3a342faf..a71501781e15 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -736,6 +736,7 @@ finalizer findstr FIXEDFILEINFO FLASHZONES +FLASHZONESONQUICKSWITCH Fle fluentui flyout @@ -1732,6 +1733,7 @@ QUERYENDSESSION queryfocus QUERYOPEN QUEUESYNC +QUICKLAYOUTSWITCH qwertyuiopasdfghjklzxcvbnm qword qwrtyuiopsghjklzxvnm diff --git a/src/modules/fancyzones/lib/Resources.resx b/src/modules/fancyzones/lib/Resources.resx index 641609a08e17..f0dff6271a1d 100644 --- a/src/modules/fancyzones/lib/Resources.resx +++ b/src/modules/fancyzones/lib/Resources.resx @@ -247,4 +247,10 @@ Failed to save the FancyZones settings. Please retry again later, if the problem persists report the bug to "Report bug to" will have a URL after. FancyZone is a product name, keep as is. + + Enable quick layout switch + + + Flash zones when switching layout + \ No newline at end of file diff --git a/src/modules/fancyzones/lib/Settings.cpp b/src/modules/fancyzones/lib/Settings.cpp index 137d81357904..111a50c3170f 100644 --- a/src/modules/fancyzones/lib/Settings.cpp +++ b/src/modules/fancyzones/lib/Settings.cpp @@ -21,6 +21,8 @@ namespace NonLocalizable const wchar_t AppLastZoneMoveWindowsID[] = L"fancyzones_appLastZone_moveWindows"; const wchar_t OpenWindowOnActiveMonitorID[] = L"fancyzones_openWindowOnActiveMonitor"; const wchar_t RestoreSizeID[] = L"fancyzones_restoreSize"; + const wchar_t QuickLayoutSwitch[] = L"fancyzones_quickLayoutSwitch"; + const wchar_t FlashZonesOnQuickSwitch[] = L"fancyzones_flashZonesOnQuickSwitch"; const wchar_t UseCursorPosEditorStartupScreenID[] = L"use_cursorpos_editor_startupscreen"; const wchar_t ShowOnAllMonitorsID[] = L"fancyzones_show_on_all_monitors"; const wchar_t SpanZonesAcrossMonitorsID[] = L"fancyzones_span_zones_across_monitors"; @@ -80,7 +82,7 @@ struct FancyZonesSettings : winrt::implements settingsReposito _appLastZoneMoveWindows = Settings.Properties.FancyzonesAppLastZoneMoveWindows.Value; _openWindowOnActiveMonitor = Settings.Properties.FancyzonesOpenWindowOnActiveMonitor.Value; _restoreSize = Settings.Properties.FancyzonesRestoreSize.Value; + _quickLayoutSwitch = Settings.Properties.FancyzonesQuickLayoutSwitch.Value; + _flashZonesOnQuickLayoutSwitch = Settings.Properties.FancyzonesFlashZonesOnQuickSwitch.Value; _useCursorPosEditorStartupScreen = Settings.Properties.UseCursorposEditorStartupscreen.Value; _showOnAllMonitors = Settings.Properties.FancyzonesShowOnAllMonitors.Value; _spanZonesAcrossMonitors = Settings.Properties.FancyzonesSpanZonesAcrossMonitors.Value; @@ -107,6 +109,8 @@ public FancyZonesViewModel(ISettingsRepository settingsReposito private bool _openWindowOnActiveMonitor; private bool _spanZonesAcrossMonitors; private bool _restoreSize; + private bool _quickLayoutSwitch; + private bool _flashZonesOnQuickLayoutSwitch; private bool _useCursorPosEditorStartupScreen; private bool _showOnAllMonitors; private bool _makeDraggedWindowTransparent; @@ -138,6 +142,7 @@ public bool IsEnabled SendConfigMSG(snd.ToString()); OnPropertyChanged(nameof(IsEnabled)); OnPropertyChanged(nameof(SnapHotkeysCategoryEnabled)); + OnPropertyChanged(nameof(QuickSwitchEnabled)); } } } @@ -150,6 +155,14 @@ public bool SnapHotkeysCategoryEnabled } } + public bool QuickSwitchEnabled + { + get + { + return _isEnabled && _quickLayoutSwitch; + } + } + public bool ShiftDrag { get @@ -374,6 +387,43 @@ public bool RestoreSize } } + public bool QuickLayoutSwitch + { + get + { + return _quickLayoutSwitch; + } + + set + { + if (value != _quickLayoutSwitch) + { + _quickLayoutSwitch = value; + Settings.Properties.FancyzonesQuickLayoutSwitch.Value = value; + NotifyPropertyChanged(); + OnPropertyChanged(nameof(QuickSwitchEnabled)); + } + } + } + + public bool FlashZonesOnQuickSwitch + { + get + { + return _flashZonesOnQuickLayoutSwitch; + } + + set + { + if (value != _flashZonesOnQuickLayoutSwitch) + { + _flashZonesOnQuickLayoutSwitch = value; + Settings.Properties.FancyzonesFlashZonesOnQuickSwitch.Value = value; + NotifyPropertyChanged(); + } + } + } + public bool UseCursorPosEditorStartupScreen { get diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw index 250ed6240026..ebe6241e788c 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw @@ -1167,4 +1167,13 @@ Win + Shift + O to toggle your video Primary monitor - + + Flash zones when switching layout + + + Enable quick layout switch + + + Quick layout switch + + \ No newline at end of file diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/FancyZonesPage.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/FancyZonesPage.xaml index f20aa59cde27..a72cec950835 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/FancyZonesPage.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/FancyZonesPage.xaml @@ -189,6 +189,20 @@ IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/> + + + + + +