UI: Display dock-relevant context menu on titlebar

This commit is contained in:
Matt Gajownik 2022-02-22 00:40:17 +11:00 committed by Jim
parent 8c732d31a7
commit 372b54ca7a

View file

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