Move find/replace logic out of shader viewer so it can be reused

This commit is contained in:
baldurk committed 2026-08-13 17:46:48 +01:00
1 parent 91cf34e4bd
commit b60f42d8b1
9 files changed
+736 -514

No files matched your search

+10
View File
@@ -56,6 +56,7 @@
#include "Code/Resources.h"
#include "Widgets/Extended/RDListWidget.h"
#include "Widgets/Extended/RDTreeWidget.h"
#include "scintilla/include/qt/ScintillaEdit.h"
// normally this is in the renderdoc core library, but it's needed for the 'unknown enum' path,
// so we implement it here using QString. It's inefficient, but this is a very uncommon path -
@@ -3679,6 +3680,15 @@ void UpdateVisibleColumns(rdcstr windowTitle, int columnCount, QHeaderView *head
}
}
void EnsureLineScrolled(ScintillaEdit *editor, int line)
{
int firstLine = editor->firstVisibleLine();
int linesVisible = editor->linesOnScreen();
if(editor->isVisible() && (line < firstLine || line > (firstLine + linesVisible - 1)))
editor->setFirstVisibleLine(qMax(0, line - linesVisible / 2));
}
const rdcarray<SDObject *> &StructuredDataItemModel::objects() const
{
return m_Objects;