2021-06-23 15:48:54 +03:00
|
|
|
// Copyright (c) Microsoft Corporation
|
2020-04-07 10:19:14 -07:00
|
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
|
|
|
// See the LICENSE file in the project root for more information.
|
2020-03-31 14:32:22 +02:00
|
|
|
|
2020-08-18 14:46:32 -07:00
|
|
|
using System;
|
2020-04-16 11:45:27 -07:00
|
|
|
using System.Runtime.CompilerServices;
|
2023-11-16 17:37:21 +01:00
|
|
|
using Common.UI;
|
2022-10-26 14:02:31 +01:00
|
|
|
using global::PowerToys.GPOWrapper;
|
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Library;
|
2020-10-22 09:45:48 -07:00
|
|
|
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
|
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
|
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Library.ViewModels.Commands;
|
2020-08-18 14:46:32 -07:00
|
|
|
|
2022-10-26 14:02:31 +01:00
|
|
|
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
2020-03-31 14:32:22 +02:00
|
|
|
{
|
|
|
|
|
public class FancyZonesViewModel : Observable
|
|
|
|
|
{
|
2021-06-23 15:48:54 +03:00
|
|
|
private ISettingsUtils SettingsUtils { get; set; }
|
|
|
|
|
|
2020-09-23 13:20:32 -07:00
|
|
|
private GeneralSettings GeneralSettingsConfig { get; set; }
|
2020-09-21 10:14:44 -07:00
|
|
|
|
2020-09-23 13:20:32 -07:00
|
|
|
private const string ModuleName = FancyZonesSettings.ModuleName;
|
2020-04-16 11:45:27 -07:00
|
|
|
|
|
|
|
|
public ButtonClickCommand LaunchEditorEventHandler { get; set; }
|
|
|
|
|
|
|
|
|
|
private FancyZonesSettings Settings { get; set; }
|
|
|
|
|
|
2020-08-18 14:46:32 -07:00
|
|
|
private Func<string, int> SendConfigMSG { get; }
|
|
|
|
|
|
|
|
|
|
private string settingsConfigFileFolder = string.Empty;
|
|
|
|
|
|
2022-05-19 18:07:18 +02:00
|
|
|
private bool _windows11;
|
|
|
|
|
|
2021-02-03 14:12:53 +03:00
|
|
|
private enum MoveWindowBehaviour
|
|
|
|
|
{
|
|
|
|
|
MoveWindowBasedOnZoneIndex = 0,
|
|
|
|
|
MoveWindowBasedOnPosition,
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-25 16:23:05 +01:00
|
|
|
private enum OverlappingZonesAlgorithm
|
|
|
|
|
{
|
|
|
|
|
Smallest = 0,
|
|
|
|
|
Largest = 1,
|
|
|
|
|
Positional = 2,
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-23 15:48:54 +03:00
|
|
|
public FancyZonesViewModel(SettingsUtils settingsUtils, ISettingsRepository<GeneralSettings> settingsRepository, ISettingsRepository<FancyZonesSettings> moduleSettingsRepository, Func<string, int> ipcMSGCallBackFunc, string configFileSubfolder = "")
|
2020-03-31 14:32:22 +02:00
|
|
|
{
|
2021-06-23 15:48:54 +03:00
|
|
|
if (settingsUtils == null)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentNullException(nameof(settingsUtils));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SettingsUtils = settingsUtils;
|
|
|
|
|
|
2020-09-23 13:20:32 -07:00
|
|
|
// To obtain the general settings configurations of PowerToys Settings.
|
2020-10-19 13:32:05 -07:00
|
|
|
if (settingsRepository == null)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentNullException(nameof(settingsRepository));
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-23 13:20:32 -07:00
|
|
|
GeneralSettingsConfig = settingsRepository.SettingsConfig;
|
2020-08-18 14:46:32 -07:00
|
|
|
settingsConfigFileFolder = configFileSubfolder;
|
|
|
|
|
|
2020-09-23 13:20:32 -07:00
|
|
|
// To obtain the settings configurations of Fancy zones.
|
2020-10-19 13:32:05 -07:00
|
|
|
if (moduleSettingsRepository == null)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentNullException(nameof(moduleSettingsRepository));
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-23 13:20:32 -07:00
|
|
|
Settings = moduleSettingsRepository.SettingsConfig;
|
2020-08-18 14:46:32 -07:00
|
|
|
|
2020-08-19 15:59:10 -07:00
|
|
|
LaunchEditorEventHandler = new ButtonClickCommand(LaunchEditor);
|
|
|
|
|
|
|
|
|
|
_shiftDrag = Settings.Properties.FancyzonesShiftDrag.Value;
|
|
|
|
|
_mouseSwitch = Settings.Properties.FancyzonesMouseSwitch.Value;
|
2023-07-25 16:48:59 +02:00
|
|
|
_mouseMiddleButtonSpanningMultipleZones = Settings.Properties.FancyzonesMouseMiddleClickSpanningMultipleZones.Value;
|
2020-08-19 15:59:10 -07:00
|
|
|
_overrideSnapHotkeys = Settings.Properties.FancyzonesOverrideSnapHotkeys.Value;
|
|
|
|
|
_moveWindowsAcrossMonitors = Settings.Properties.FancyzonesMoveWindowsAcrossMonitors.Value;
|
2021-02-03 14:12:53 +03:00
|
|
|
_moveWindowBehaviour = Settings.Properties.FancyzonesMoveWindowsBasedOnPosition.Value ? MoveWindowBehaviour.MoveWindowBasedOnPosition : MoveWindowBehaviour.MoveWindowBasedOnZoneIndex;
|
2021-02-25 16:23:05 +01:00
|
|
|
_overlappingZonesAlgorithm = (OverlappingZonesAlgorithm)Settings.Properties.FancyzonesOverlappingZonesAlgorithm.Value;
|
2023-10-17 16:28:32 +02:00
|
|
|
_displayOrWorkAreaChangeMoveWindows = Settings.Properties.FancyzonesDisplayOrWorkAreaChangeMoveWindows.Value;
|
2020-08-19 15:59:10 -07:00
|
|
|
_zoneSetChangeMoveWindows = Settings.Properties.FancyzonesZoneSetChangeMoveWindows.Value;
|
|
|
|
|
_appLastZoneMoveWindows = Settings.Properties.FancyzonesAppLastZoneMoveWindows.Value;
|
|
|
|
|
_openWindowOnActiveMonitor = Settings.Properties.FancyzonesOpenWindowOnActiveMonitor.Value;
|
|
|
|
|
_restoreSize = Settings.Properties.FancyzonesRestoreSize.Value;
|
2021-03-25 15:44:55 +03:00
|
|
|
_quickLayoutSwitch = Settings.Properties.FancyzonesQuickLayoutSwitch.Value;
|
|
|
|
|
_flashZonesOnQuickLayoutSwitch = Settings.Properties.FancyzonesFlashZonesOnQuickSwitch.Value;
|
2020-08-19 15:59:10 -07:00
|
|
|
_useCursorPosEditorStartupScreen = Settings.Properties.UseCursorposEditorStartupscreen.Value;
|
|
|
|
|
_showOnAllMonitors = Settings.Properties.FancyzonesShowOnAllMonitors.Value;
|
2020-09-04 10:11:05 +02:00
|
|
|
_spanZonesAcrossMonitors = Settings.Properties.FancyzonesSpanZonesAcrossMonitors.Value;
|
2020-08-19 15:59:10 -07:00
|
|
|
_makeDraggedWindowTransparent = Settings.Properties.FancyzonesMakeDraggedWindowTransparent.Value;
|
2022-02-23 17:25:28 +03:00
|
|
|
_allowPopupWindowSnap = Settings.Properties.FancyzonesAllowPopupWindowSnap.Value;
|
|
|
|
|
_allowChildWindowSnap = Settings.Properties.FancyzonesAllowChildWindowSnap.Value;
|
2022-04-01 18:28:19 +02:00
|
|
|
_disableRoundCornersOnSnap = Settings.Properties.FancyzonesDisableRoundCornersOnSnap.Value;
|
2020-08-19 15:59:10 -07:00
|
|
|
_highlightOpacity = Settings.Properties.FancyzonesHighlightOpacity.Value;
|
|
|
|
|
_excludedApps = Settings.Properties.FancyzonesExcludedApps.Value;
|
2021-11-04 15:30:06 +01:00
|
|
|
_systemTheme = Settings.Properties.FancyzonesSystemTheme.Value;
|
2021-12-20 17:50:51 +01:00
|
|
|
_showZoneNumber = Settings.Properties.FancyzonesShowZoneNumber.Value;
|
2020-08-19 15:59:10 -07:00
|
|
|
EditorHotkey = Settings.Properties.FancyzonesEditorHotkey.Value;
|
2021-11-03 17:11:42 +02:00
|
|
|
_windowSwitching = Settings.Properties.FancyzonesWindowSwitching.Value;
|
|
|
|
|
NextTabHotkey = Settings.Properties.FancyzonesNextTabHotkey.Value;
|
|
|
|
|
PrevTabHotkey = Settings.Properties.FancyzonesPrevTabHotkey.Value;
|
2020-08-18 14:46:32 -07:00
|
|
|
|
2023-10-24 11:37:22 +02:00
|
|
|
// set the callback functions value to handle outgoing IPC message.
|
2020-08-18 14:46:32 -07:00
|
|
|
SendConfigMSG = ipcMSGCallBackFunc;
|
|
|
|
|
|
2020-05-07 20:24:19 +02:00
|
|
|
string inactiveColor = Settings.Properties.FancyzonesInActiveColor.Value;
|
2021-12-20 17:50:51 +01:00
|
|
|
_zoneInActiveColor = !string.IsNullOrEmpty(inactiveColor) ? inactiveColor : ConfigDefaults.DefaultFancyZonesInActiveColor;
|
2020-05-07 20:24:19 +02:00
|
|
|
|
|
|
|
|
string borderColor = Settings.Properties.FancyzonesBorderColor.Value;
|
2021-12-20 17:50:51 +01:00
|
|
|
_zoneBorderColor = !string.IsNullOrEmpty(borderColor) ? borderColor : ConfigDefaults.DefaultFancyzonesBorderColor;
|
2020-05-07 20:24:19 +02:00
|
|
|
|
|
|
|
|
string highlightColor = Settings.Properties.FancyzonesZoneHighlightColor.Value;
|
2021-12-20 17:50:51 +01:00
|
|
|
_zoneHighlightColor = !string.IsNullOrEmpty(highlightColor) ? highlightColor : ConfigDefaults.DefaultFancyZonesZoneHighlightColor;
|
|
|
|
|
|
|
|
|
|
string numberColor = Settings.Properties.FancyzonesNumberColor.Value;
|
|
|
|
|
_zoneNumberColor = !string.IsNullOrEmpty(numberColor) ? numberColor : ConfigDefaults.DefaultFancyzonesNumberColor;
|
2020-04-17 15:25:08 -07:00
|
|
|
|
2023-01-31 00:00:11 +01:00
|
|
|
InitializeEnabledValue();
|
|
|
|
|
|
2023-11-16 17:37:21 +01:00
|
|
|
_windows11 = OSVersionHelper.IsWindows11();
|
2023-01-31 00:00:11 +01:00
|
|
|
|
|
|
|
|
// Disable setting on windows 10
|
|
|
|
|
if (!_windows11 && DisableRoundCornersOnWindowSnap)
|
|
|
|
|
{
|
|
|
|
|
DisableRoundCornersOnWindowSnap = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void InitializeEnabledValue()
|
|
|
|
|
{
|
2022-10-26 14:02:31 +01:00
|
|
|
_enabledGpoRuleConfiguration = GPOWrapper.GetConfiguredFancyZonesEnabledValue();
|
|
|
|
|
if (_enabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _enabledGpoRuleConfiguration == GpoRuleConfigured.Enabled)
|
|
|
|
|
{
|
|
|
|
|
// Get the enabled state from GPO.
|
|
|
|
|
_enabledStateIsGPOConfigured = true;
|
|
|
|
|
_isEnabled = _enabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_isEnabled = GeneralSettingsConfig.Enabled.FancyZones;
|
|
|
|
|
}
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
|
2022-10-26 14:02:31 +01:00
|
|
|
private GpoRuleConfigured _enabledGpoRuleConfiguration;
|
|
|
|
|
private bool _enabledStateIsGPOConfigured;
|
2020-04-16 11:45:27 -07:00
|
|
|
private bool _isEnabled;
|
|
|
|
|
private bool _shiftDrag;
|
2020-05-07 23:29:02 +03:00
|
|
|
private bool _mouseSwitch;
|
2023-07-25 16:48:59 +02:00
|
|
|
private bool _mouseMiddleButtonSpanningMultipleZones;
|
2020-04-16 11:45:27 -07:00
|
|
|
private bool _overrideSnapHotkeys;
|
2020-05-07 23:29:02 +03:00
|
|
|
private bool _moveWindowsAcrossMonitors;
|
2021-02-03 14:12:53 +03:00
|
|
|
private MoveWindowBehaviour _moveWindowBehaviour;
|
2021-02-25 16:23:05 +01:00
|
|
|
private OverlappingZonesAlgorithm _overlappingZonesAlgorithm;
|
2023-10-17 16:28:32 +02:00
|
|
|
private bool _displayOrWorkAreaChangeMoveWindows;
|
2020-04-16 11:45:27 -07:00
|
|
|
private bool _zoneSetChangeMoveWindows;
|
|
|
|
|
private bool _appLastZoneMoveWindows;
|
2020-07-08 10:37:42 +02:00
|
|
|
private bool _openWindowOnActiveMonitor;
|
2020-08-07 10:06:25 +02:00
|
|
|
private bool _spanZonesAcrossMonitors;
|
2020-07-01 15:36:05 +02:00
|
|
|
private bool _restoreSize;
|
2021-03-25 15:44:55 +03:00
|
|
|
private bool _quickLayoutSwitch;
|
|
|
|
|
private bool _flashZonesOnQuickLayoutSwitch;
|
2020-04-16 11:45:27 -07:00
|
|
|
private bool _useCursorPosEditorStartupScreen;
|
|
|
|
|
private bool _showOnAllMonitors;
|
2020-05-07 23:29:02 +03:00
|
|
|
private bool _makeDraggedWindowTransparent;
|
2021-11-04 15:30:06 +01:00
|
|
|
private bool _systemTheme;
|
2021-12-20 17:50:51 +01:00
|
|
|
private bool _showZoneNumber;
|
2022-02-23 17:25:28 +03:00
|
|
|
private bool _allowPopupWindowSnap;
|
|
|
|
|
private bool _allowChildWindowSnap;
|
2022-04-01 18:28:19 +02:00
|
|
|
private bool _disableRoundCornersOnSnap;
|
2020-05-07 20:24:19 +02:00
|
|
|
|
2020-04-16 11:45:27 -07:00
|
|
|
private int _highlightOpacity;
|
|
|
|
|
private string _excludedApps;
|
|
|
|
|
private HotkeySettings _editorHotkey;
|
2021-11-03 17:11:42 +02:00
|
|
|
private bool _windowSwitching;
|
|
|
|
|
private HotkeySettings _nextTabHotkey;
|
|
|
|
|
private HotkeySettings _prevTabHotkey;
|
2020-08-18 14:46:32 -07:00
|
|
|
private string _zoneInActiveColor;
|
|
|
|
|
private string _zoneBorderColor;
|
|
|
|
|
private string _zoneHighlightColor;
|
2021-12-20 17:50:51 +01:00
|
|
|
private string _zoneNumberColor;
|
2020-04-16 11:45:27 -07:00
|
|
|
|
|
|
|
|
public bool IsEnabled
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _isEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2022-10-26 14:02:31 +01:00
|
|
|
if (_enabledStateIsGPOConfigured)
|
|
|
|
|
{
|
|
|
|
|
// If it's GPO configured, shouldn't be able to change this state.
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-16 11:45:27 -07:00
|
|
|
if (value != _isEnabled)
|
|
|
|
|
{
|
|
|
|
|
_isEnabled = value;
|
2020-09-23 13:20:32 -07:00
|
|
|
|
|
|
|
|
// Set the status of FancyZones in the general settings configuration
|
|
|
|
|
GeneralSettingsConfig.Enabled.FancyZones = value;
|
|
|
|
|
OutGoingGeneralSettings snd = new OutGoingGeneralSettings(GeneralSettingsConfig);
|
2020-04-16 11:45:27 -07:00
|
|
|
|
2020-08-18 14:46:32 -07:00
|
|
|
SendConfigMSG(snd.ToString());
|
2020-10-09 17:58:52 -07:00
|
|
|
OnPropertyChanged(nameof(IsEnabled));
|
|
|
|
|
OnPropertyChanged(nameof(SnapHotkeysCategoryEnabled));
|
2021-03-25 15:44:55 +03:00
|
|
|
OnPropertyChanged(nameof(QuickSwitchEnabled));
|
2021-11-03 17:11:42 +02:00
|
|
|
OnPropertyChanged(nameof(WindowSwitchingCategoryEnabled));
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-26 14:02:31 +01:00
|
|
|
public bool IsEnabledGpoConfigured
|
|
|
|
|
{
|
|
|
|
|
get => _enabledStateIsGPOConfigured;
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-21 12:53:03 +02:00
|
|
|
public bool SnapHotkeysCategoryEnabled
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _isEnabled && _overrideSnapHotkeys;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-25 15:44:55 +03:00
|
|
|
public bool QuickSwitchEnabled
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _isEnabled && _quickLayoutSwitch;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-03 17:11:42 +02:00
|
|
|
public bool WindowSwitchingCategoryEnabled
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _isEnabled && _windowSwitching;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-16 11:45:27 -07:00
|
|
|
public bool ShiftDrag
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _shiftDrag;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _shiftDrag)
|
|
|
|
|
{
|
|
|
|
|
_shiftDrag = value;
|
|
|
|
|
Settings.Properties.FancyzonesShiftDrag.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-07 23:29:02 +03:00
|
|
|
public bool MouseSwitch
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _mouseSwitch;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _mouseSwitch)
|
|
|
|
|
{
|
|
|
|
|
_mouseSwitch = value;
|
|
|
|
|
Settings.Properties.FancyzonesMouseSwitch.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-05-07 23:29:02 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-25 16:48:59 +02:00
|
|
|
public bool MouseMiddleClickSpanningMultipleZones
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _mouseMiddleButtonSpanningMultipleZones;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _mouseMiddleButtonSpanningMultipleZones)
|
|
|
|
|
{
|
|
|
|
|
_mouseMiddleButtonSpanningMultipleZones = value;
|
|
|
|
|
Settings.Properties.FancyzonesMouseMiddleClickSpanningMultipleZones.Value = value;
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-18 14:46:32 -07:00
|
|
|
public string GetSettingsSubPath()
|
|
|
|
|
{
|
|
|
|
|
return settingsConfigFileFolder + "\\" + ModuleName;
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-16 11:45:27 -07:00
|
|
|
public bool OverrideSnapHotkeys
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _overrideSnapHotkeys;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _overrideSnapHotkeys)
|
|
|
|
|
{
|
|
|
|
|
_overrideSnapHotkeys = value;
|
|
|
|
|
Settings.Properties.FancyzonesOverrideSnapHotkeys.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-10-09 17:58:52 -07:00
|
|
|
OnPropertyChanged(nameof(SnapHotkeysCategoryEnabled));
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-07 23:29:02 +03:00
|
|
|
public bool MoveWindowsAcrossMonitors
|
2020-04-16 11:45:27 -07:00
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2020-05-07 23:29:02 +03:00
|
|
|
return _moveWindowsAcrossMonitors;
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2020-05-07 23:29:02 +03:00
|
|
|
if (value != _moveWindowsAcrossMonitors)
|
2020-04-16 11:45:27 -07:00
|
|
|
{
|
2020-05-07 23:29:02 +03:00
|
|
|
_moveWindowsAcrossMonitors = value;
|
|
|
|
|
Settings.Properties.FancyzonesMoveWindowsAcrossMonitors.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-21 12:53:03 +02:00
|
|
|
public bool MoveWindowsBasedOnPosition
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2021-02-03 14:12:53 +03:00
|
|
|
return _moveWindowBehaviour == MoveWindowBehaviour.MoveWindowBasedOnPosition;
|
2020-08-21 12:53:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2021-02-03 14:12:53 +03:00
|
|
|
var settingsValue = Settings.Properties.FancyzonesMoveWindowsBasedOnPosition.Value;
|
|
|
|
|
if (value != settingsValue)
|
2020-08-21 12:53:03 +02:00
|
|
|
{
|
2021-02-03 14:12:53 +03:00
|
|
|
_moveWindowBehaviour = value ? MoveWindowBehaviour.MoveWindowBasedOnPosition : MoveWindowBehaviour.MoveWindowBasedOnZoneIndex;
|
2020-08-21 12:53:03 +02:00
|
|
|
Settings.Properties.FancyzonesMoveWindowsBasedOnPosition.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-08-21 12:53:03 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-03 14:12:53 +03:00
|
|
|
public bool MoveWindowsBasedOnZoneIndex
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _moveWindowBehaviour == MoveWindowBehaviour.MoveWindowBasedOnZoneIndex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
var settingsValue = Settings.Properties.FancyzonesMoveWindowsBasedOnPosition.Value;
|
|
|
|
|
if (value == settingsValue)
|
|
|
|
|
{
|
|
|
|
|
_moveWindowBehaviour = value ? MoveWindowBehaviour.MoveWindowBasedOnZoneIndex : MoveWindowBehaviour.MoveWindowBasedOnPosition;
|
|
|
|
|
Settings.Properties.FancyzonesMoveWindowsBasedOnPosition.Value = !value;
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-25 16:23:05 +01:00
|
|
|
public int OverlappingZonesAlgorithmIndex
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (int)_overlappingZonesAlgorithm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != (int)_overlappingZonesAlgorithm)
|
|
|
|
|
{
|
|
|
|
|
_overlappingZonesAlgorithm = (OverlappingZonesAlgorithm)value;
|
|
|
|
|
Settings.Properties.FancyzonesOverlappingZonesAlgorithm.Value = value;
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-17 16:28:32 +02:00
|
|
|
public bool DisplayOrWorkAreaChangeMoveWindows
|
2020-04-16 11:45:27 -07:00
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2023-10-17 16:28:32 +02:00
|
|
|
return _displayOrWorkAreaChangeMoveWindows;
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2023-10-17 16:28:32 +02:00
|
|
|
if (value != _displayOrWorkAreaChangeMoveWindows)
|
2020-04-16 11:45:27 -07:00
|
|
|
{
|
2023-10-17 16:28:32 +02:00
|
|
|
_displayOrWorkAreaChangeMoveWindows = value;
|
|
|
|
|
Settings.Properties.FancyzonesDisplayOrWorkAreaChangeMoveWindows.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool ZoneSetChangeMoveWindows
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _zoneSetChangeMoveWindows;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _zoneSetChangeMoveWindows)
|
|
|
|
|
{
|
|
|
|
|
_zoneSetChangeMoveWindows = value;
|
|
|
|
|
Settings.Properties.FancyzonesZoneSetChangeMoveWindows.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool AppLastZoneMoveWindows
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _appLastZoneMoveWindows;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _appLastZoneMoveWindows)
|
|
|
|
|
{
|
|
|
|
|
_appLastZoneMoveWindows = value;
|
|
|
|
|
Settings.Properties.FancyzonesAppLastZoneMoveWindows.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-08 10:37:42 +02:00
|
|
|
public bool OpenWindowOnActiveMonitor
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _openWindowOnActiveMonitor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _openWindowOnActiveMonitor)
|
|
|
|
|
{
|
|
|
|
|
_openWindowOnActiveMonitor = value;
|
|
|
|
|
Settings.Properties.FancyzonesOpenWindowOnActiveMonitor.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-07-08 10:37:42 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-01 15:36:05 +02:00
|
|
|
public bool RestoreSize
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _restoreSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _restoreSize)
|
|
|
|
|
{
|
|
|
|
|
_restoreSize = value;
|
|
|
|
|
Settings.Properties.FancyzonesRestoreSize.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-07-01 15:36:05 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-25 15:44:55 +03:00
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-16 11:45:27 -07:00
|
|
|
public bool UseCursorPosEditorStartupScreen
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _useCursorPosEditorStartupScreen;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _useCursorPosEditorStartupScreen)
|
|
|
|
|
{
|
|
|
|
|
_useCursorPosEditorStartupScreen = value;
|
|
|
|
|
Settings.Properties.UseCursorposEditorStartupscreen.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool ShowOnAllMonitors
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _showOnAllMonitors;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _showOnAllMonitors)
|
|
|
|
|
{
|
|
|
|
|
_showOnAllMonitors = value;
|
|
|
|
|
Settings.Properties.FancyzonesShowOnAllMonitors.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-07 10:06:25 +02:00
|
|
|
public bool SpanZonesAcrossMonitors
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _spanZonesAcrossMonitors;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _spanZonesAcrossMonitors)
|
|
|
|
|
{
|
|
|
|
|
_spanZonesAcrossMonitors = value;
|
|
|
|
|
Settings.Properties.FancyzonesSpanZonesAcrossMonitors.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-08-07 10:06:25 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-07 23:29:02 +03:00
|
|
|
public bool MakeDraggedWindowsTransparent
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _makeDraggedWindowTransparent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _makeDraggedWindowTransparent)
|
|
|
|
|
{
|
|
|
|
|
_makeDraggedWindowTransparent = value;
|
|
|
|
|
Settings.Properties.FancyzonesMakeDraggedWindowTransparent.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-05-07 23:29:02 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-04 15:30:06 +01:00
|
|
|
public bool SystemTheme
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _systemTheme;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _systemTheme)
|
|
|
|
|
{
|
|
|
|
|
_systemTheme = value;
|
|
|
|
|
Settings.Properties.FancyzonesSystemTheme.Value = value;
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-20 17:50:51 +01:00
|
|
|
public bool ShowZoneNumber
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _showZoneNumber;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _showZoneNumber)
|
|
|
|
|
{
|
|
|
|
|
_showZoneNumber = value;
|
|
|
|
|
Settings.Properties.FancyzonesShowZoneNumber.Value = value;
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-23 17:25:28 +03:00
|
|
|
public bool AllowChildWindowSnap
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _allowChildWindowSnap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _allowChildWindowSnap)
|
|
|
|
|
{
|
|
|
|
|
_allowChildWindowSnap = value;
|
|
|
|
|
Settings.Properties.FancyzonesAllowChildWindowSnap.Value = value;
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-01 18:28:19 +02:00
|
|
|
public bool DisableRoundCornersOnWindowSnap
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _disableRoundCornersOnSnap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (_disableRoundCornersOnSnap != value)
|
|
|
|
|
{
|
|
|
|
|
_disableRoundCornersOnSnap = value;
|
|
|
|
|
Settings.Properties.FancyzonesDisableRoundCornersOnSnap.Value = value;
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-19 13:32:05 -07:00
|
|
|
// For the following setters we use OrdinalIgnoreCase string comparison since
|
|
|
|
|
// we expect value to be a hex code.
|
2020-08-18 14:46:32 -07:00
|
|
|
public string ZoneHighlightColor
|
2020-04-16 11:45:27 -07:00
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _zoneHighlightColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2022-08-09 06:35:46 +02:00
|
|
|
value = SettingsUtilities.ToRGBHex(value);
|
2020-10-19 13:32:05 -07:00
|
|
|
if (!value.Equals(_zoneHighlightColor, StringComparison.OrdinalIgnoreCase))
|
2020-04-16 11:45:27 -07:00
|
|
|
{
|
|
|
|
|
_zoneHighlightColor = value;
|
2020-08-18 14:46:32 -07:00
|
|
|
Settings.Properties.FancyzonesZoneHighlightColor.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-18 14:46:32 -07:00
|
|
|
public string ZoneBorderColor
|
2020-04-17 15:25:08 -07:00
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _zoneBorderColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2022-08-09 06:35:46 +02:00
|
|
|
value = SettingsUtilities.ToRGBHex(value);
|
2020-08-18 14:46:32 -07:00
|
|
|
if (!value.Equals(_zoneBorderColor, StringComparison.OrdinalIgnoreCase))
|
2020-04-17 15:25:08 -07:00
|
|
|
{
|
|
|
|
|
_zoneBorderColor = value;
|
2020-08-18 14:46:32 -07:00
|
|
|
Settings.Properties.FancyzonesBorderColor.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-04-17 15:25:08 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-18 14:46:32 -07:00
|
|
|
public string ZoneInActiveColor
|
2020-04-17 15:25:08 -07:00
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _zoneInActiveColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2022-08-09 06:35:46 +02:00
|
|
|
value = SettingsUtilities.ToRGBHex(value);
|
2020-10-19 13:32:05 -07:00
|
|
|
if (!value.Equals(_zoneInActiveColor, StringComparison.OrdinalIgnoreCase))
|
2020-04-17 15:25:08 -07:00
|
|
|
{
|
|
|
|
|
_zoneInActiveColor = value;
|
2020-08-18 14:46:32 -07:00
|
|
|
Settings.Properties.FancyzonesInActiveColor.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2021-12-20 17:50:51 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string ZoneNumberColor
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _zoneNumberColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2022-08-09 06:35:46 +02:00
|
|
|
value = SettingsUtilities.ToRGBHex(value);
|
2021-12-20 17:50:51 +01:00
|
|
|
if (!value.Equals(_zoneNumberColor, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
_zoneNumberColor = value;
|
|
|
|
|
Settings.Properties.FancyzonesNumberColor.Value = value;
|
|
|
|
|
NotifyPropertyChanged();
|
2020-04-17 15:25:08 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-16 11:45:27 -07:00
|
|
|
public int HighlightOpacity
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _highlightOpacity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _highlightOpacity)
|
|
|
|
|
{
|
|
|
|
|
_highlightOpacity = value;
|
|
|
|
|
Settings.Properties.FancyzonesHighlightOpacity.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public HotkeySettings EditorHotkey
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _editorHotkey;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _editorHotkey)
|
|
|
|
|
{
|
2020-10-19 13:32:05 -07:00
|
|
|
if (value == null || value.IsEmpty())
|
2020-06-04 14:52:04 -07:00
|
|
|
{
|
2021-11-03 17:11:42 +02:00
|
|
|
_editorHotkey = FZConfigProperties.DefaultEditorHotkeyValue;
|
2020-06-04 14:52:04 -07:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_editorHotkey = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Settings.Properties.FancyzonesEditorHotkey.Value = _editorHotkey;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-03 17:11:42 +02:00
|
|
|
public bool WindowSwitching
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _windowSwitching;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _windowSwitching)
|
|
|
|
|
{
|
|
|
|
|
_windowSwitching = value;
|
|
|
|
|
|
|
|
|
|
Settings.Properties.FancyzonesWindowSwitching.Value = _windowSwitching;
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
OnPropertyChanged(nameof(WindowSwitchingCategoryEnabled));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public HotkeySettings NextTabHotkey
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _nextTabHotkey;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _nextTabHotkey)
|
|
|
|
|
{
|
|
|
|
|
if (value == null || value.IsEmpty())
|
|
|
|
|
{
|
|
|
|
|
_nextTabHotkey = FZConfigProperties.DefaultNextTabHotkeyValue;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_nextTabHotkey = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Settings.Properties.FancyzonesNextTabHotkey.Value = _nextTabHotkey;
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public HotkeySettings PrevTabHotkey
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _prevTabHotkey;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _prevTabHotkey)
|
|
|
|
|
{
|
|
|
|
|
if (value == null || value.IsEmpty())
|
|
|
|
|
{
|
|
|
|
|
_prevTabHotkey = FZConfigProperties.DefaultPrevTabHotkeyValue;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_prevTabHotkey = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Settings.Properties.FancyzonesPrevTabHotkey.Value = _prevTabHotkey;
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-16 11:45:27 -07:00
|
|
|
public string ExcludedApps
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _excludedApps;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _excludedApps)
|
|
|
|
|
{
|
|
|
|
|
_excludedApps = value;
|
|
|
|
|
Settings.Properties.FancyzonesExcludedApps.Value = value;
|
2020-10-19 13:32:05 -07:00
|
|
|
NotifyPropertyChanged();
|
2020-04-16 11:45:27 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-19 18:07:18 +02:00
|
|
|
public bool Windows11 => _windows11;
|
|
|
|
|
|
2020-04-16 11:45:27 -07:00
|
|
|
private void LaunchEditor()
|
|
|
|
|
{
|
|
|
|
|
// send message to launch the zones editor;
|
2020-08-18 14:46:32 -07:00
|
|
|
SendConfigMSG("{\"action\":{\"FancyZones\":{\"action_name\":\"ToggledFZEditor\", \"value\":\"\"}}}");
|
2020-04-17 15:25:08 -07:00
|
|
|
}
|
|
|
|
|
|
2020-10-19 13:32:05 -07:00
|
|
|
public void NotifyPropertyChanged([CallerMemberName] string propertyName = null)
|
2020-04-16 11:45:27 -07:00
|
|
|
{
|
|
|
|
|
OnPropertyChanged(propertyName);
|
2021-06-23 15:48:54 +03:00
|
|
|
SettingsUtils.SaveSettings(Settings.ToJsonString(), GetSettingsSubPath());
|
2020-03-31 14:32:22 +02:00
|
|
|
}
|
2023-01-31 00:00:11 +01:00
|
|
|
|
|
|
|
|
public void RefreshEnabledState()
|
|
|
|
|
{
|
|
|
|
|
InitializeEnabledValue();
|
|
|
|
|
OnPropertyChanged(nameof(IsEnabled));
|
|
|
|
|
OnPropertyChanged(nameof(SnapHotkeysCategoryEnabled));
|
|
|
|
|
OnPropertyChanged(nameof(QuickSwitchEnabled));
|
|
|
|
|
OnPropertyChanged(nameof(WindowSwitchingCategoryEnabled));
|
|
|
|
|
}
|
2020-03-31 14:32:22 +02:00
|
|
|
}
|
2020-04-10 15:22:07 -07:00
|
|
|
}
|