allow to move the selection panel via mouse drag
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user