- enhancement: Adjust function tip pos to prevent it from run outside the right window edge.
This commit is contained in:
parent
2b9ece18ad
commit
f88898ae1e
1
NEWS.md
1
NEWS.md
|
@ -95,6 +95,7 @@ Red Panda C++ Version 2.27
|
|||
- fix: Remove duplicated macro defines make it's lost in the parse result.
|
||||
- fix: An undefined macro is still missing the the parse result after #undef is removed.
|
||||
- fix: If a class method is overloaded, only one of them is inherited by it's children.
|
||||
- enhancement: Adjust function tip pos to prevent it from run outside the right window edge.
|
||||
|
||||
Red Panda C++ Version 2.26
|
||||
- enhancement: Code suggestion for embedded std::vectors.
|
||||
|
|
|
@ -4400,13 +4400,16 @@ void Editor::updateFunctionTip(bool showTip)
|
|||
// Position it at the top of the next line
|
||||
QPoint p = displayCoordToPixels(displayXY());
|
||||
p+=QPoint(0,textHeight()+2);
|
||||
pMainWindow->functionTip()->move(mapToGlobal(p));
|
||||
|
||||
pMainWindow->functionTip()->setFunctioFullName(s);
|
||||
pMainWindow->functionTip()->guessFunction(paramsCount-1);
|
||||
pMainWindow->functionTip()->setParamIndex(
|
||||
currentParamPos
|
||||
);
|
||||
int w = pMainWindow->functionTip()->width();
|
||||
if (w+p.x() > clientWidth())
|
||||
p.setX(clientWidth()-w-2);
|
||||
pMainWindow->functionTip()->move(mapToGlobal(p));
|
||||
cancelHint();
|
||||
if (showTip)
|
||||
pMainWindow->functionTip()->show();
|
||||
|
|
|
@ -494,8 +494,12 @@ protected:
|
|||
virtual void onProcessCommand(EditCommand command, QChar car, void * pData);
|
||||
virtual void onCommandProcessed(EditCommand command, QChar car, void * pData);
|
||||
virtual void executeCommand(EditCommand command, QChar ch, void * pData);
|
||||
|
||||
protected:
|
||||
int clientWidth() const;
|
||||
int clientHeight() const;
|
||||
int clientTop() const;
|
||||
int clientLeft() const;
|
||||
QRect clientRect() const;
|
||||
void doSelectLine();
|
||||
void incPaintLock();
|
||||
void decPaintLock();
|
||||
|
@ -510,12 +514,6 @@ private:
|
|||
void computeCaret();
|
||||
void computeScroll(bool isDragging);
|
||||
|
||||
|
||||
int clientWidth() const;
|
||||
int clientHeight() const;
|
||||
int clientTop() const;
|
||||
int clientLeft() const;
|
||||
QRect clientRect() const;
|
||||
void synFontChanged();
|
||||
|
||||
void doSetSelText(const QString& value);
|
||||
|
|
Loading…
Reference in New Issue