put the controls panel in the corner and let it step around the build bar
This commit is contained in:
@@ -38,11 +38,13 @@ public:
|
||||
// selection.
|
||||
ControlsPanel(const GameWorldView* view, QWidget* parent = nullptr);
|
||||
|
||||
// Confines the panel to the given band of the game world view: it left-aligns
|
||||
// within it and sits on its bottom edge. The band is the world view less the strip
|
||||
// the build button bar occupies, so the two never overlap and the bar never has to
|
||||
// move (REQ-UI-CONTROLS-PANEL, REQ-UI-BUILD-BAR).
|
||||
void anchorTo(const QRect& bandRect);
|
||||
// Places the panel in the bottom-left corner of the game world view. It shares the
|
||||
// bottom edge with the build button bar rather than clearing its strip, the bar
|
||||
// being centered and sized to its buttons and so usually leaving the left free; it
|
||||
// rises above the bar only when the two would otherwise overlap. `buildBarRect` is
|
||||
// the bar's current geometry in the same coordinates, or a null rect when there is
|
||||
// none to avoid (REQ-UI-CONTROLS-PANEL, REQ-UI-BUILD-BAR).
|
||||
void anchorTo(const QRect& worldRect, const QRect& buildBarRect);
|
||||
|
||||
protected:
|
||||
// Clicking the heading collapses and expands the panel (REQ-UI-CONTROLS-PANEL).
|
||||
@@ -77,7 +79,8 @@ private:
|
||||
// command (REQ-UI-CONTROLS-PANEL).
|
||||
bool m_collapsed = false;
|
||||
|
||||
// The band the panel confines itself to, in the coordinates of its parent; null
|
||||
// until the owner has anchored it for the first time.
|
||||
QRect m_bandRect;
|
||||
// The world view the panel sits in, and the build button bar it steps around, both
|
||||
// in the coordinates of its parent. Null until the owner has anchored it.
|
||||
QRect m_worldRect;
|
||||
QRect m_buildBarRect;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user