mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-01 15:49:51 +08:00
UI: Allow right-clicking to select preview items
Allows selection of items by right-clicking on the preview as well rather than just left-clicks.
This commit is contained in:
@@ -341,10 +341,14 @@ void OBSBasicPreview::mousePressEvent(QMouseEvent *event)
|
||||
float x = float(event->x()) - main->previewX / pixelRatio;
|
||||
float y = float(event->y()) - main->previewY / pixelRatio;
|
||||
|
||||
if (event->button() != Qt::LeftButton)
|
||||
OBSQTDisplay::mousePressEvent(event);
|
||||
|
||||
if (event->button() != Qt::LeftButton &&
|
||||
event->button() != Qt::RightButton)
|
||||
return;
|
||||
|
||||
mouseDown = true;
|
||||
if (event->button() == Qt::LeftButton)
|
||||
mouseDown = true;
|
||||
|
||||
vec2_set(&startPos, x, y);
|
||||
GetStretchHandleData(startPos);
|
||||
@@ -355,6 +359,9 @@ void OBSBasicPreview::mousePressEvent(QMouseEvent *event)
|
||||
|
||||
mouseOverItems = SelectedAtPos(startPos);
|
||||
vec2_zero(&lastMoveOffset);
|
||||
|
||||
if (event->button() == Qt::RightButton)
|
||||
ProcessClick(startPos);
|
||||
}
|
||||
|
||||
static bool select_one(obs_scene_t *scene, obs_sceneitem_t *item, void *param)
|
||||
|
||||
Reference in New Issue
Block a user