place the selection panel beside what it describes
This commit is contained in:
25
src/lib/eventsystem/event/SelectionAnchorChangedEvent.h
Normal file
25
src/lib/eventsystem/event/SelectionAnchorChangedEvent.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <QRect>
|
||||
|
||||
#include "Event.h"
|
||||
|
||||
// Where on the screen the selection that is about to be made sits: the bounds of the one
|
||||
// object selected, or of all of them when the selection starts as a multi-selection
|
||||
// (REQ-UI-SELECTION-PANEL). The rectangle is in the game world view's own widget
|
||||
// coordinates.
|
||||
//
|
||||
// Published only when a selection *starts* -- a plain click or drag, or an additive one
|
||||
// onto an empty selection -- and always immediately before the selection itself. Adding
|
||||
// to a selection publishes nothing, which is what leaves the selection panel where it
|
||||
// is while the selection grows; and because the rectangle is screen space frozen at that
|
||||
// moment, scrolling the view or a selected ship flying off does not move the panel
|
||||
// either.
|
||||
class SelectionAnchorChangedEvent : public Event
|
||||
{
|
||||
public:
|
||||
explicit SelectionAnchorChangedEvent(QRect rectPx)
|
||||
: rectPx(rectPx) {}
|
||||
|
||||
const QRect rectPx;
|
||||
};
|
||||
Reference in New Issue
Block a user