mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
[Settings][FancyZones] Rounded corners settings only on Windows 11 (#18151)
* rounded corners settings only on windows 11 * disable setting on win10
This commit is contained in:
committed by
GitHub
parent
1552e75df2
commit
dda0aa237c
@@ -7,7 +7,6 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.CustomAction;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Library.Utilities
|
||||
@@ -135,5 +134,10 @@ namespace Microsoft.PowerToys.Settings.UI.Library.Utilities
|
||||
}
|
||||
|
||||
public const uint VirtualKeyWindows = interop.Constants.VK_WIN_BOTH;
|
||||
|
||||
public static bool Windows11()
|
||||
{
|
||||
return Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= 22000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Utilities;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.ViewModels.Commands;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
@@ -26,6 +27,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
|
||||
private string settingsConfigFileFolder = string.Empty;
|
||||
|
||||
private bool _windows11;
|
||||
|
||||
private enum MoveWindowBehaviour
|
||||
{
|
||||
MoveWindowBasedOnZoneIndex = 0,
|
||||
@@ -112,6 +115,13 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
_zoneNumberColor = !string.IsNullOrEmpty(numberColor) ? numberColor : ConfigDefaults.DefaultFancyzonesNumberColor;
|
||||
|
||||
_isEnabled = GeneralSettingsConfig.Enabled.FancyZones;
|
||||
_windows11 = Helper.Windows11();
|
||||
|
||||
// Disable setting on windows 10
|
||||
if (!_windows11 && DisableRoundCornersOnWindowSnap)
|
||||
{
|
||||
DisableRoundCornersOnWindowSnap = false;
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isEnabled;
|
||||
@@ -846,6 +856,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public bool Windows11 => _windows11;
|
||||
|
||||
private void LaunchEditor()
|
||||
{
|
||||
// send message to launch the zones editor;
|
||||
|
||||
Reference in New Issue
Block a user