mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-08 06:53:41 +00:00
Move find/replace logic out of shader viewer so it can be reused
This commit is contained in:
9 files changed
+736
-514
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user