mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-23 23:16:31 +00:00
Backport Qt implementation of calltips in Scintilla
* Taken from https://sourceforge.net/p/scintilla/code/ci/a82b87a88556f0bc23b7ff6 f4bdfd5241ef44a62/ upstream
This commit is contained in:
@@ -616,11 +616,36 @@ void ScintillaQt::StartDrag()
|
||||
SetDragPosition(SelectionPosition(invalidPosition));
|
||||
}
|
||||
|
||||
class CallTipImpl : public QWidget {
|
||||
public:
|
||||
CallTipImpl(CallTip *pct_)
|
||||
: QWidget(nullptr, Qt::ToolTip),
|
||||
pct(pct_)
|
||||
{
|
||||
setWindowFlag(Qt::WindowTransparentForInput);
|
||||
}
|
||||
|
||||
void paintEvent(QPaintEvent *) override
|
||||
{
|
||||
if (pct->inCallTipMode) {
|
||||
Surface *surfaceWindow = Surface::Allocate(0);
|
||||
surfaceWindow->Init(this);
|
||||
surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == pct->codePage);
|
||||
surfaceWindow->SetDBCSMode(pct->codePage);
|
||||
pct->PaintCT(surfaceWindow);
|
||||
delete surfaceWindow;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
CallTip *pct;
|
||||
};
|
||||
|
||||
void ScintillaQt::CreateCallTipWindow(PRectangle rc)
|
||||
{
|
||||
|
||||
if (!ct.wCallTip.Created()) {
|
||||
QWidget *pCallTip = new QWidget(0, Qt::ToolTip);
|
||||
QWidget *pCallTip = new CallTipImpl(&ct);
|
||||
ct.wCallTip = pCallTip;
|
||||
pCallTip->move(rc.left, rc.top);
|
||||
pCallTip->resize(rc.Width(), rc.Height());
|
||||
|
||||
Reference in New Issue
Block a user