ソースを参照

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.
jp9000 10 年 前
コミット
0e4969535b
1 ファイル変更9 行追加2 行削除
  1. 9 2
      obs/window-basic-preview.cpp

+ 9 - 2
obs/window-basic-preview.cpp

@@ -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)