fix typo: snap layouts --> snap layout

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2022-07-07 17:00:15 +08:00
parent 011b4a85f5
commit 9a93475f2b
5 changed files with 10 additions and 10 deletions

View File

@ -40,7 +40,7 @@ FramelessWindow {
// our window won't be draggable.
FramelessHelper.titleBarItem = titleBar;
// Make our own items visible to the hit test and on Windows, enable
// the snap layouts feature (available since Windows 11).
// the snap layout feature (available since Windows 11).
FramelessHelper.setSystemButton(titleBar.minimizeButton, FramelessHelperConstants.Minimize);
FramelessHelper.setSystemButton(titleBar.maximizeButton, FramelessHelperConstants.Maximize);
FramelessHelper.setSystemButton(titleBar.closeButton, FramelessHelperConstants.Close);

View File

@ -42,7 +42,7 @@ FramelessWindow {
// our window won't be draggable.
FramelessHelper.titleBarItem = titleBar;
// Make our own items visible to the hit test and on Windows, enable
// the snap layouts feature (available since Windows 11).
// the snap layout feature (available since Windows 11).
FramelessHelper.setSystemButton(titleBar.minimizeButton, FramelessHelperConstants.Minimize);
FramelessHelper.setSystemButton(titleBar.maximizeButton, FramelessHelperConstants.Maximize);
FramelessHelper.setSystemButton(titleBar.closeButton, FramelessHelperConstants.Close);

View File

@ -225,7 +225,7 @@ enum class Option
UseCrossPlatformQtImplementation = 0,
ForceHideWindowFrameBorder = 1,
ForceShowWindowFrameBorder = 2,
DisableWindowsSnapLayouts = 3,
DisableWindowsSnapLayout = 3,
WindowUseRoundCorners = 4,
CenterWindowBeforeShow = 5,
EnableBlurBehindWindow = 6

View File

@ -45,8 +45,8 @@ static const struct
FRAMELESSHELPER_BYTEARRAY_LITERAL("Options/ForceHideWindowFrameBorder")},
{FRAMELESSHELPER_BYTEARRAY_LITERAL("FRAMELESSHELPER_FORCE_SHOW_WINDOW_FRAME_BORDER"),
FRAMELESSHELPER_BYTEARRAY_LITERAL("Options/ForceShowWindowFrameBorder")},
{FRAMELESSHELPER_BYTEARRAY_LITERAL("FRAMELESSHELPER_DISABLE_WINDOWS_SNAP_LAYOUTS"),
FRAMELESSHELPER_BYTEARRAY_LITERAL("Options/DisableWindowsSnapLayouts")},
{FRAMELESSHELPER_BYTEARRAY_LITERAL("FRAMELESSHELPER_DISABLE_WINDOWS_SNAP_LAYOUT"),
FRAMELESSHELPER_BYTEARRAY_LITERAL("Options/DisableWindowsSnapLayout")},
{FRAMELESSHELPER_BYTEARRAY_LITERAL("FRAMELESSHELPER_WINDOW_USE_ROUND_CORNERS"),
FRAMELESSHELPER_BYTEARRAY_LITERAL("Options/WindowUseRoundCorners")},
{FRAMELESSHELPER_BYTEARRAY_LITERAL("FRAMELESSHELPER_CENTER_WINDOW_BEFORE_SHOW"),

View File

@ -110,8 +110,8 @@ FRAMELESSHELPER_STRING_CONSTANT(FindWindowW)
const bool isMouseEvent = (((uMsg >= WM_MOUSEFIRST) && (uMsg <= WM_MOUSELAST)) ||
((uMsg >= WM_NCMOUSEMOVE) && (uMsg <= WM_NCXBUTTONDBLCLK)));
#if 0 // Need extra safe guard, otherwise will crash, but since it's not used, just comment them out.
// We only use this fallback title bar window to activate the snap layouts feature, if the parent
// window is not resizable, the snap layouts feature should also be disabled at the same time,
// We only use this fallback title bar window to activate the snap layout feature, if the parent
// window is not resizable, the snap layout feature should also be disabled at the same time,
// hence forward everything to the parent window, we don't need to handle anything here.
if (data.params.isWindowFixedSize()) {
// Let the mouse event pass through our fallback title bar window to the root window
@ -166,7 +166,7 @@ FRAMELESSHELPER_STRING_CONSTANT(FindWindowW)
switch (uMsg) {
case WM_NCHITTEST: {
// Try to determine what part of the window is being hovered here. This
// is absolutely critical to making sure the snap layouts works!
// is absolutely critical to making sure the snap layout works!
const POINT nativeGlobalPos = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
POINT nativeLocalPos = nativeGlobalPos;
if (ScreenToClient(hWnd, &nativeLocalPos) == FALSE) {
@ -375,7 +375,7 @@ FRAMELESSHELPER_STRING_CONSTANT(FindWindowW)
const auto fallbackTitleBarWindowHandle = reinterpret_cast<HWND>(fallbackTitleBarWindowId);
const UINT flags = (SWP_NOACTIVATE | (hide ? SWP_HIDEWINDOW : SWP_SHOWWINDOW));
// As you can see from the code, we only use the fallback title bar window to activate the
// snap layouts feature introduced in Windows 11. So you may wonder, why not just
// snap layout feature introduced in Windows 11. So you may wonder, why not just
// limit it to the area of the three system buttons, instead of covering the
// whole title bar area? Well, I've tried that solution already and unfortunately
// it doesn't work. And according to my experiment, it won't work either even if we
@ -493,7 +493,7 @@ void FramelessHelperWin::addWindow(const SystemParameters &params)
Utils::forceSquareCornersForWindow(windowId, !config->isSet(Option::WindowUseRoundCorners));
// The fallback title bar window is only used to activate the Snap Layout feature
// introduced in Windows 11, so it's not necessary to create it on systems below Win11.
if (!config->isSet(Option::DisableWindowsSnapLayouts)) {
if (!config->isSet(Option::DisableWindowsSnapLayout)) {
if (!createFallbackTitleBarWindow(windowId, data.params.isWindowFixedSize())) {
qWarning() << "Failed to create the fallback title bar window.";
}