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

Method storeManualGeometry

app/src/UI/WindowManager.cpp:1200–1219  ·  view source on GitHub ↗

* @brief Stores the preferred manual geometry and anchor margins for a window. */

Source from the content-addressed store, hash-verified

1198 * @brief Stores the preferred manual geometry and anchor margins for a window.
1199 */
1200void UI::WindowManager::storeManualGeometry(const int id,
1201 QQuickItem* item,
1202 const int canvasWidth,
1203 const int canvasHeight)
1204{
1205 if (!item)
1206 return;
1207
1208 const QRect geom = extractGeometry(item);
1209 m_manualGeometries.insert(id, geom);
1210
1211 const int canvasW = canvasWidth > 0 ? canvasWidth : static_cast<int>(width());
1212 const int canvasH = canvasHeight > 0 ? canvasHeight : static_cast<int>(height());
1213 if (canvasW <= 0 || canvasH <= 0)
1214 return;
1215
1216 m_manualCanvasWidth = canvasW;
1217 m_manualCanvasHeight = canvasH;
1218 m_manualMargins.insert(id, manualMarginsForGeometry(geom, canvasW, canvasH));
1219}
1220
1221/**
1222 * @brief Repositions manual-layout windows to preserve edge anchoring on resize.

Callers

nothing calls this directly

Calls 1

manualMarginsForGeometryFunction · 0.85

Tested by

no test coverage detected