diff options
| author | djvs <2954343+djvs@users.noreply.github.com> | 2024-03-12 22:43:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-13 02:43:22 +0000 |
| commit | c58fcfbce2c2e9f12cad7771555ce38b515a3389 (patch) | |
| tree | c7764623a6ad6bb1bdcaed5043288913311e4366 /src/layout/IHyprLayout.cpp | |
| parent | 7ea555da7fff0a2457e24e06bbd34986c0755025 (diff) | |
input: add general:resize_corner for manual resizing (#5090)
* Resize corner config thing
* clang-format
---------
Co-authored-by: djvs <djvs@users.noreply.github.com>
Diffstat (limited to 'src/layout/IHyprLayout.cpp')
| -rw-r--r-- | src/layout/IHyprLayout.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 433434de..d2ec1ab1 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -217,7 +217,27 @@ void IHyprLayout::onBeginDragWindow() { m_vLastDragXY = m_vBeginDragXY; // get the grab corner - if (m_vBeginDragXY.x < m_vBeginDragPositionXY.x + m_vBeginDragSizeXY.x / 2.0) { + static auto RESIZECORNER = CConfigValue<Hyprlang::INT>("general:resize_corner"); + if (*RESIZECORNER != 0 && *RESIZECORNER <= 4) { + switch (*RESIZECORNER) { + case 1: + m_eGrabbedCorner = CORNER_TOPLEFT; + g_pInputManager->setCursorImageUntilUnset("nw-resize"); + break; + case 2: + m_eGrabbedCorner = CORNER_TOPRIGHT; + g_pInputManager->setCursorImageUntilUnset("ne-resize"); + break; + case 3: + m_eGrabbedCorner = CORNER_BOTTOMRIGHT; + g_pInputManager->setCursorImageUntilUnset("se-resize"); + break; + case 4: + m_eGrabbedCorner = CORNER_BOTTOMLEFT; + g_pInputManager->setCursorImageUntilUnset("sw-resize"); + break; + } + } else if (m_vBeginDragXY.x < m_vBeginDragPositionXY.x + m_vBeginDragSizeXY.x / 2.0) { if (m_vBeginDragXY.y < m_vBeginDragPositionXY.y + m_vBeginDragSizeXY.y / 2.0) { m_eGrabbedCorner = CORNER_TOPLEFT; g_pInputManager->setCursorImageUntilUnset("nw-resize"); |
