mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
UI: Display dock-relevant context menu on titlebar
This commit is contained in:
parent
8c732d31a7
commit
372b54ca7a
|
@ -9930,11 +9930,25 @@ void OBSBasic::on_customContextMenuRequested(const QPoint &pos)
|
|||
{
|
||||
QWidget *widget = childAt(pos);
|
||||
const char *className = nullptr;
|
||||
if (widget != nullptr)
|
||||
QString objName;
|
||||
if (widget != nullptr) {
|
||||
className = widget->metaObject()->className();
|
||||
objName = widget->objectName();
|
||||
}
|
||||
|
||||
if (!className || strstr(className, "Dock") != nullptr)
|
||||
ui->menuDocks->exec(mapToGlobal(pos));
|
||||
QPoint globalPos = mapToGlobal(pos);
|
||||
if (className && strstr(className, "Dock") != nullptr &&
|
||||
!objName.isEmpty()) {
|
||||
if (objName.compare("scenesDock") == 0) {
|
||||
ui->scenes->customContextMenuRequested(globalPos);
|
||||
} else if (objName.compare("sourcesDock") == 0) {
|
||||
ui->sources->customContextMenuRequested(globalPos);
|
||||
} else if (objName.compare("mixerDock") == 0) {
|
||||
StackedMixerAreaContextMenuRequested();
|
||||
}
|
||||
} else if (!className) {
|
||||
ui->menuDocks->exec(globalPos);
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasic::UpdateProjectorHideCursor()
|
||||
|
|
Loading…
Reference in a new issue