* @brief Stores the preferred manual geometry and anchor margins for a window. */
| 1198 | * @brief Stores the preferred manual geometry and anchor margins for a window. |
| 1199 | */ |
| 1200 | void 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. |
nothing calls this directly
no test coverage detected