Merge pull request #2403 from WizardCM/dock-context
UI: Use OBS dock menu instead of Qt dock context menumaster
commit
fd244a6896
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -834,6 +834,8 @@ private slots:
|
|||
void on_actionVerticalCenter_triggered();
|
||||
void on_actionHorizontalCenter_triggered();
|
||||
|
||||
void on_customContextMenuRequested(const QPoint &pos);
|
||||
|
||||
void on_scenes_currentItemChanged(QListWidgetItem *current,
|
||||
QListWidgetItem *prev);
|
||||
void on_scenes_customContextMenuRequested(const QPoint &pos);
|
||||
|
|
Loading…
Reference in New Issue