allow to move the selection panel via mouse drag

This commit is contained in:
2026-08-09 22:09:41 +02:00
parent 37a7a7499a
commit 37378e3c1b
8 changed files with 274 additions and 38 deletions

View File

@@ -2,6 +2,7 @@
#include <vector>
#include <QPoint>
#include <QRect>
#include <QSize>
@@ -41,3 +42,13 @@ PanelSide chooseSide(const QRect& band, const QRect& anchorRect, int widthPx,
QRect placeBesideAnchor(const QRect& band, const QRect& anchorRect, PanelSide side,
QSize wantedSize, const std::vector<QRect>& occupiedRects,
int marginPx);
// Where a panel of wantedSize stands once the player has dragged it to desiredTopLeftPx:
// at that point, by the same rules that place it beside a selection -- pushed inside band,
// lifted above whatever occupies its column, and capped in height where that leaves too
// little room (REQ-UI-SELECTION-PANEL-DRAG). The desired point is an input only: it is
// never corrected and handed back, which is what lets the caller keep it exactly as
// dropped and return to it once the room is there again.
QRect placeAtDesiredTopLeft(const QRect& band, const QPoint& desiredTopLeftPx,
QSize wantedSize, const std::vector<QRect>& occupiedRects,
int marginPx);