mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Allow registering window, panel and context menu items with callbacks
This commit is contained in:
@@ -189,6 +189,15 @@ EventBrowser::EventBrowser(ICaptureContext &ctx, QWidget *parent)
|
||||
QObject::connect(ui->events->header(), &QHeaderView::customContextMenuRequested, this,
|
||||
&EventBrowser::events_contextMenu);
|
||||
|
||||
{
|
||||
QMenu *extensionsMenu = new QMenu(this);
|
||||
|
||||
QObject::connect(extensionsMenu, &QMenu::aboutToShow, [this, extensionsMenu]() {
|
||||
extensionsMenu->clear();
|
||||
m_Ctx.Extensions().MenuDisplaying(PanelMenu::EventBrowser, ui->extensions, {});
|
||||
});
|
||||
}
|
||||
|
||||
OnCaptureClosed();
|
||||
|
||||
m_redPalette = palette();
|
||||
@@ -1009,6 +1018,11 @@ void EventBrowser::events_contextMenu(const QPoint &pos)
|
||||
[this, rgp]() { rgp->SelectRGPEvent(m_Ctx.CurEvent()); });
|
||||
}
|
||||
|
||||
contextMenu.addSeparator();
|
||||
|
||||
m_Ctx.Extensions().MenuDisplaying(ContextMenu::EventBrowser_Event, &contextMenu,
|
||||
{{"eventId", m_Ctx.CurEvent()}});
|
||||
|
||||
RDDialog::show(&contextMenu, ui->events->viewport()->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user