MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / handleResizeMove

Method handleResizeMove

app/src/UI/WindowManager.cpp:1855–1875  ·  view source on GitHub ↗

* @brief Applies a resize delta to the focused window, clamped to canvas bounds. */

Source from the content-addressed store, hash-verified

1853 * @brief Applies a resize delta to the focused window, clamped to canvas bounds.
1854 */
1855void UI::WindowManager::handleResizeMove(QMouseEvent* event, const QPoint& delta)
1856{
1857 QRect geometry = computeResizedGeometry(delta);
1858
1859 const QRect unclamped = geometry;
1860 geometry.setX(qMax(0, geometry.x()));
1861 geometry.setY(qMax(0, geometry.y()));
1862 if (geometry.right() > int(width()) - 1)
1863 geometry.setWidth(int(width()) - geometry.x());
1864
1865 if (geometry.bottom() > int(height()) - 1)
1866 geometry.setHeight(int(height()) - geometry.y());
1867
1868 if (geometry == unclamped) {
1869 m_resizeWindow->setX(geometry.x());
1870 m_resizeWindow->setY(geometry.y());
1871 m_resizeWindow->setWidth(geometry.width());
1872 m_resizeWindow->setHeight(geometry.height());
1873 event->accept();
1874 }
1875}
1876
1877/**
1878 * @brief Manual-mode press logic: hit-tests the topmost window at pos, raises it,

Callers

nothing calls this directly

Calls 4

xMethod · 0.80
widthMethod · 0.80
heightMethod · 0.80
acceptMethod · 0.80

Tested by

no test coverage detected