From 586886b3f54964cfa1abf9c96fc22141b762660b Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 6 Aug 2026 16:48:32 +0100 Subject: [PATCH] Add custom change to scintilla to query bounds of autocomplete box --- .../3rdparty/scintilla/include/Scintilla.h | 5 +++++ .../scintilla/include/qt/ScintillaEdit.h | 4 ++++ .../scintilla/qt/ScintillaEdit/ScintillaEdit.cpp | 16 ++++++++++++++++ .../scintilla/qt/ScintillaEdit/ScintillaEdit.h | 4 ++++ .../3rdparty/scintilla/src/ScintillaBase.cxx | 12 ++++++++++++ 5 files changed, 41 insertions(+) diff --git a/qrenderdoc/3rdparty/scintilla/include/Scintilla.h b/qrenderdoc/3rdparty/scintilla/include/Scintilla.h index 6a36d24f4..00f9e084a 100644 --- a/qrenderdoc/3rdparty/scintilla/include/Scintilla.h +++ b/qrenderdoc/3rdparty/scintilla/include/Scintilla.h @@ -1097,6 +1097,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCN_MARGINRIGHTCLICK 2031 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ +#define SCI_AUTOCGETRECTLEFT 9001 +#define SCI_AUTOCGETRECTRIGHT 9002 +#define SCI_AUTOCGETRECTTOP 9003 +#define SCI_AUTOCGETRECTBOTTOM 9004 + /* These structures are defined to be exactly the same shape as the Win32 * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs. * So older code that treats Scintilla as a RichEdit will work. */ diff --git a/qrenderdoc/3rdparty/scintilla/include/qt/ScintillaEdit.h b/qrenderdoc/3rdparty/scintilla/include/qt/ScintillaEdit.h index 56d2cfe46..49a0c6291 100644 --- a/qrenderdoc/3rdparty/scintilla/include/qt/ScintillaEdit.h +++ b/qrenderdoc/3rdparty/scintilla/include/qt/ScintillaEdit.h @@ -240,6 +240,10 @@ public: sptr_t autoCMaxWidth() const; void autoCSetMaxHeight(sptr_t rowCount); sptr_t autoCMaxHeight() const; + sptr_t autoCRectLeft() const; + sptr_t autoCRectRight() const; + sptr_t autoCRectTop() const; + sptr_t autoCRectBottom() const; void setIndent(sptr_t indentSize); sptr_t indent() const; void setUseTabs(bool useTabs); diff --git a/qrenderdoc/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.cpp b/qrenderdoc/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.cpp index c325be048..e27d2e114 100644 --- a/qrenderdoc/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.cpp +++ b/qrenderdoc/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.cpp @@ -689,6 +689,22 @@ bool ScintillaEdit::autoCActive() { return send(SCI_AUTOCACTIVE, 0, 0); } +sptr_t ScintillaEdit::autoCRectLeft() const { + return send(SCI_AUTOCGETRECTLEFT, 0, 0); +} + +sptr_t ScintillaEdit::autoCRectRight() const { + return send(SCI_AUTOCGETRECTRIGHT, 0, 0); +} + +sptr_t ScintillaEdit::autoCRectTop() const { + return send(SCI_AUTOCGETRECTTOP, 0, 0); +} + +sptr_t ScintillaEdit::autoCRectBottom() const { + return send(SCI_AUTOCGETRECTBOTTOM, 0, 0); +} + sptr_t ScintillaEdit::autoCPosStart() { return send(SCI_AUTOCPOSSTART, 0, 0); } diff --git a/qrenderdoc/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.h b/qrenderdoc/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.h index 56d2cfe46..49a0c6291 100644 --- a/qrenderdoc/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.h +++ b/qrenderdoc/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.h @@ -240,6 +240,10 @@ public: sptr_t autoCMaxWidth() const; void autoCSetMaxHeight(sptr_t rowCount); sptr_t autoCMaxHeight() const; + sptr_t autoCRectLeft() const; + sptr_t autoCRectRight() const; + sptr_t autoCRectTop() const; + sptr_t autoCRectBottom() const; void setIndent(sptr_t indentSize); sptr_t indent() const; void setUseTabs(bool useTabs); diff --git a/qrenderdoc/3rdparty/scintilla/src/ScintillaBase.cxx b/qrenderdoc/3rdparty/scintilla/src/ScintillaBase.cxx index 100456411..5cb8b9b0d 100644 --- a/qrenderdoc/3rdparty/scintilla/src/ScintillaBase.cxx +++ b/qrenderdoc/3rdparty/scintilla/src/ScintillaBase.cxx @@ -902,6 +902,18 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara case SCI_AUTOCGETMAXHEIGHT: return ac.lb->GetVisibleRows(); + case SCI_AUTOCGETRECTLEFT: + return ac.lb->GetPosition().left; + + case SCI_AUTOCGETRECTRIGHT: + return ac.lb->GetPosition().right; + + case SCI_AUTOCGETRECTTOP: + return ac.lb->GetPosition().top; + + case SCI_AUTOCGETRECTBOTTOM: + return ac.lb->GetPosition().bottom; + case SCI_AUTOCSETMAXWIDTH: maxListWidth = static_cast(wParam); break;