Skip to content

Commit

Permalink
- enhancement: better behavior of mouse tips
Browse files Browse the repository at this point in the history
  • Loading branch information
royqh1979 committed Jan 15, 2022
1 parent bf17e49 commit 04770a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: 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
- enhancement: better behavior of mouse tips

Red Panda C++ Version 0.13.1
- enhancement: suppoort localization info in project templates
Expand Down
14 changes: 12 additions & 2 deletions RedPandaIDE/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,9 @@ bool Editor::event(QEvent *event)
} else if (cursor() == Qt::PointingHandCursor) {
updateMouseCursor();
}
if (pMainWindow->functionTip()->isVisible()) {
pMainWindow->functionTip()->hide();
}
QToolTip::showText(mapToGlobal(helpEvent->pos()),hint);
event->ignore();
} else {
Expand Down Expand Up @@ -2577,6 +2580,9 @@ void Editor::exportAsHTML(const QString &htmlFilename)

void Editor::showCompletion(const QString& preWord,bool autoComplete)
{
if (pMainWindow->functionTip()->isVisible()) {
pMainWindow->functionTip()->hide();
}
if (!pSettings->codeCompletion().enabled())
return;
if (!mParser->enabled())
Expand Down Expand Up @@ -3060,8 +3066,8 @@ void Editor::cancelHint()

// disable editor hint
QToolTip::hideText();
mCurrentWord = "";
mCurrentTipType = TipType::None;
//mCurrentWord = "";
//mCurrentTipType = TipType::None;
updateMouseCursor();
}

Expand Down Expand Up @@ -3129,6 +3135,9 @@ void Editor::showDebugHint(const QString &s, int line)
}
if (pMainWindow->debugger()->commandRunning())
return;
if (pMainWindow->functionTip()->isVisible()) {
pMainWindow->functionTip()->hide();
}
connect(pMainWindow->debugger(), &Debugger::evalValueReady,
this, &Editor::onTipEvalValueReady);
mCurrentDebugTipWord = s;
Expand Down Expand Up @@ -3358,6 +3367,7 @@ void Editor::updateFunctionTip()
pMainWindow->functionTip()->setParamIndex(
paramPos
);
cancelHint();
pMainWindow->functionTip()->show();
}

Expand Down

0 comments on commit 04770a6

Please sign in to comment.