UI: Add shortcuts to reorder bookmarks #3756
+71
−3
Closed
Annotations
2 errors
|
Check formatting
Process completed with exit code 1.
|
|
Check formatting
clang-format issues were found. See CONTRIBUTING.md for more information.
diff --git a/qrenderdoc/Code/CaptureContext.cpp b/qrenderdoc/Code/CaptureContext.cpp
index 602f997..c5d2453 100644
--- a/qrenderdoc/Code/CaptureContext.cpp
+++ b/qrenderdoc/Code/CaptureContext.cpp
@@ -1828,7 +1828,6 @@ void CaptureContext::ShiftBookmark(uint32_t EID, int dir)
RefreshUIStatus({}, true, true);
}
-
void CaptureContext::DelayedCallback(uint32_t milliseconds, std::function<void()> callback)
{
QTimer::singleShot(milliseconds, callback);
diff --git a/qrenderdoc/Windows/EventBrowser.cpp b/qrenderdoc/Windows/EventBrowser.cpp
index 135edb3..b5d1d78 100644
--- a/qrenderdoc/Windows/EventBrowser.cpp
+++ b/qrenderdoc/Windows/EventBrowser.cpp
@@ -5344,10 +5344,10 @@ void EventBrowser::repopulateBookmarks()
highlightBookmarks();
- //m_BookmarkStripLayout->removeItem(m_BookmarkSpacer);
- //m_BookmarkStripLayout->addWidget(but);
- //m_BookmarkStripLayout->addItem(m_BookmarkSpacer);
- m_BookmarkButtons[EID] = but;
+ // m_BookmarkStripLayout->removeItem(m_BookmarkSpacer);
+ // m_BookmarkStripLayout->addWidget(but);
+ // m_BookmarkStripLayout->addItem(m_BookmarkSpacer);
+ m_BookmarkButtons[EID] = but;
}
}
@@ -5361,12 +5361,14 @@ void EventBrowser::repopulateBookmarks()
}
}
m_BookmarkStripLayout->removeItem(m_BookmarkSpacer);
- for (const EventBookmark &mark : bookmarks) {
- if (m_BookmarkButtons.contains(mark.eventId)) {
- QRClickToolButton *but = m_BookmarkButtons[mark.eventId];
- m_BookmarkStripLayout->removeWidget(but);
- m_BookmarkStripLayout->addWidget(but);
- }
+ for(const EventBookmark &mark : bookmarks)
+ {
+ if(m_BookmarkButtons.contains(mark.eventId))
+ {
+ QRClickToolButton *but = m_BookmarkButtons[mark.eventId];
+ m_BookmarkStripLayout->removeWidget(but);
+ m_BookmarkStripLayout->addWidget(but);
+ }
}
m_BookmarkStripLayout->addItem(m_BookmarkSpacer);
@@ -5403,7 +5405,7 @@ void EventBrowser::bookmarkContextMenu(QRClickToolButton *button, uint32_t EID)
QAction renameBookmark(tr("&Rename"), this);
QAction deleteBookmark(tr("&Delete"), this);
- QAction moveLeft(tr("Move &Left"), this);
+ QAction moveLeft(tr("Move &Left"), this);
QAction moveRight(tr("Move &Right"), this);
renameBookmark.setIcon(Icons::page_white_edit());
@@ -5411,8 +5413,8 @@ void EventBrowser::bookmarkContextMenu(QRClickToolButton *button, uint32_t EID)
contextMenu.addAction(&renameBookmark);
contextMenu.addAction(&deleteBookmark);
- contextMenu.addSeparator();
- contextMenu.addAction(&moveLeft);
+ contextMenu.addSeparator();
+ contextMenu.addAction(&moveLeft);
contextMenu.addAction(&moveRight);
QObject::connect(&deleteBookmark, &QAction::triggered, [this, EID]() {
@@ -5444,15 +5446,15 @@ void EventBrowser::bookmarkContextMenu(QRClickToolButton *button, uint32_t EID)
}
}
});
-
- QObject::connect(&moveLeft, &QAction::triggered, [this, EID]() {
- m_Ctx.ShiftBookmark(EID, -1);
- repopulateBookmarks();
- });
-
- QObject::connect(&moveRight, &QAction::triggered, [this, EID]() {
- m_Ctx.ShiftBookmark(EID, 1);
- repopulateBookmarks();
+
+ QObject::connect(&moveLeft, &QAction::triggered, [this, EID]() {
+ m_Ctx.ShiftBookmark(EID, -1);
+ repopulateBookmarks();
+ });
+
+ QObject::connect(&moveRight, &QAction::triggered, [this, EID]() {
+ m_Ctx.ShiftBookmark(EID, 1);
+ repopulateBookmarks();
});
RDDialog::show(&contextMenu, QCursor::pos());
diff --git a/qrenderdoc/Windows/PythonShell.cpp b/qrenderdoc/Windows/PythonShell.cpp
index ebe07a9..1ad1f00 100644
--- a/qrenderdoc/Windows/PythonShell.cpp
+++ b/qrenderdoc/Windows/PythonShell.cpp
@@ -648,8 +648,8 @@ struct CaptureContextInvoker : ObjectForwarder<ICaptureContext>
InvokeVoidFunction(&ICaptureContext::RemoveBookmark, EID);
}
virtual void ShiftBookmark(uint32_t EID, int dir) override
- {
- InvokeVoidFunction(&ICaptureContext::ShiftBookmark, EID, dir);
+ {
+ Invoke
|
Loading