- enhancement: better behavior of mouse tips

This commit is contained in:
Roy Qu 2022-01-15 11:22:20 +08:00
parent bf17e494fd
commit 04770a6fd8
2 changed files with 13 additions and 2 deletions

View File

@ -22,6 +22,7 @@ Red Panda C++ Version 0.13.2
- fix: If project's compiler set is not the same with the default compiler set, auto openned project's file will use wrong compiler set to do syntax check. - fix: If project's compiler set is not the same with the default compiler set, auto openned project's file will use wrong compiler set to do syntax check.
- fix: open a project file through "File"->"Open" will not correctly connect it with the project internally - fix: open a project file through "File"->"Open" will not correctly connect it with the project internally
- fix: wrong project program directory parameter is sent to the debugger - fix: wrong project program directory parameter is sent to the debugger
- enhancement: better behavior of mouse tips
Red Panda C++ Version 0.13.1 Red Panda C++ Version 0.13.1
- enhancement: suppoort localization info in project templates - enhancement: suppoort localization info in project templates

View File

@ -1080,6 +1080,9 @@ bool Editor::event(QEvent *event)
} else if (cursor() == Qt::PointingHandCursor) { } else if (cursor() == Qt::PointingHandCursor) {
updateMouseCursor(); updateMouseCursor();
} }
if (pMainWindow->functionTip()->isVisible()) {
pMainWindow->functionTip()->hide();
}
QToolTip::showText(mapToGlobal(helpEvent->pos()),hint); QToolTip::showText(mapToGlobal(helpEvent->pos()),hint);
event->ignore(); event->ignore();
} else { } else {
@ -2577,6 +2580,9 @@ void Editor::exportAsHTML(const QString &htmlFilename)
void Editor::showCompletion(const QString& preWord,bool autoComplete) void Editor::showCompletion(const QString& preWord,bool autoComplete)
{ {
if (pMainWindow->functionTip()->isVisible()) {
pMainWindow->functionTip()->hide();
}
if (!pSettings->codeCompletion().enabled()) if (!pSettings->codeCompletion().enabled())
return; return;
if (!mParser->enabled()) if (!mParser->enabled())
@ -3060,8 +3066,8 @@ void Editor::cancelHint()
// disable editor hint // disable editor hint
QToolTip::hideText(); QToolTip::hideText();
mCurrentWord = ""; //mCurrentWord = "";
mCurrentTipType = TipType::None; //mCurrentTipType = TipType::None;
updateMouseCursor(); updateMouseCursor();
} }
@ -3129,6 +3135,9 @@ void Editor::showDebugHint(const QString &s, int line)
} }
if (pMainWindow->debugger()->commandRunning()) if (pMainWindow->debugger()->commandRunning())
return; return;
if (pMainWindow->functionTip()->isVisible()) {
pMainWindow->functionTip()->hide();
}
connect(pMainWindow->debugger(), &Debugger::evalValueReady, connect(pMainWindow->debugger(), &Debugger::evalValueReady,
this, &Editor::onTipEvalValueReady); this, &Editor::onTipEvalValueReady);
mCurrentDebugTipWord = s; mCurrentDebugTipWord = s;
@ -3358,6 +3367,7 @@ void Editor::updateFunctionTip()
pMainWindow->functionTip()->setParamIndex( pMainWindow->functionTip()->setParamIndex(
paramPos paramPos
); );
cancelHint();
pMainWindow->functionTip()->show(); pMainWindow->functionTip()->show();
} }