UI: Use OBS dock menu instead of Qt dock context menu
This commit is contained in:
parent
7f373edbea
commit
8a0cfc5665
2 changed files with 17 additions and 0 deletions
|
|
@ -206,6 +206,10 @@ OBSBasic::OBSBasic(QWidget *parent)
|
|||
|
||||
setAcceptDrops(true);
|
||||
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this,
|
||||
SLOT(on_customContextMenuRequested(const QPoint &)));
|
||||
|
||||
api = InitializeAPIInterface(this);
|
||||
|
||||
ui->setupUi(this);
|
||||
|
|
@ -7773,3 +7777,14 @@ void OBSBasic::ResetStatsHotkey()
|
|||
|
||||
foreach(OBSBasicStats * s, list) s->Reset();
|
||||
}
|
||||
|
||||
void OBSBasic::on_customContextMenuRequested(const QPoint &pos)
|
||||
{
|
||||
QWidget *widget = childAt(pos);
|
||||
const char *className = nullptr;
|
||||
if (widget != nullptr)
|
||||
className = widget->metaObject()->className();
|
||||
|
||||
if (!className || strstr(className, "Dock") != nullptr)
|
||||
ui->viewMenuDocks->exec(mapToGlobal(pos));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue