ui: Fixed unhovering active error removes active highlight
This commit is contained in:
@@ -755,7 +755,7 @@ void QtCodeArea::defocusTokenIds(const std::vector<Id>& tokenIds)
|
|||||||
{
|
{
|
||||||
if (m_navigator->hasErrors() && tokenIds.size() == 1)
|
if (m_navigator->hasErrors() && tokenIds.size() == 1)
|
||||||
{
|
{
|
||||||
QtCodeField::defocusTokenIds(tokenIds);
|
QtCodeField::defocusTokenIds(utility::toVector(m_navigator->getActiveLocalTokenIds()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -293,14 +293,14 @@ void QtCodeField::mouseReleaseEvent(QMouseEvent* event)
|
|||||||
activateAnnotations(annotations);
|
activateAnnotations(annotations);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtCodeField::focusTokenIds(const std::vector<Id>& tokenIds)
|
void QtCodeField::focusTokenIds(const std::vector<Id>& focusedTokenIds)
|
||||||
{
|
{
|
||||||
annotateText(std::set<Id>(), std::set<Id>(), std::set<Id>(tokenIds.begin(), tokenIds.end()));
|
annotateText(std::set<Id>(), std::set<Id>(), std::set<Id>(focusedTokenIds.begin(), focusedTokenIds.end()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtCodeField::defocusTokenIds(const std::vector<Id>& tokenIds)
|
void QtCodeField::defocusTokenIds(const std::vector<Id>& activeTokenIds)
|
||||||
{
|
{
|
||||||
annotateText(std::set<Id>(), std::set<Id>(), std::set<Id>());
|
annotateText(std::set<Id>(activeTokenIds.begin(), activeTokenIds.end()), std::set<Id>(), std::set<Id>());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QtCodeField::annotateText(
|
bool QtCodeField::annotateText(
|
||||||
@@ -513,13 +513,7 @@ void QtCodeField::setHoveredAnnotations(const std::vector<const Annotation*>& an
|
|||||||
{
|
{
|
||||||
if (m_hoveredAnnotations.size())
|
if (m_hoveredAnnotations.size())
|
||||||
{
|
{
|
||||||
std::vector<Id> tokenIds;
|
defocusTokenIds({});
|
||||||
for (const Annotation* annotation : m_hoveredAnnotations)
|
|
||||||
{
|
|
||||||
tokenIds.insert(tokenIds.end(), annotation->tokenIds.begin(), annotation->tokenIds.end());
|
|
||||||
}
|
|
||||||
|
|
||||||
defocusTokenIds(tokenIds);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_hoveredAnnotations = annotations;
|
m_hoveredAnnotations = annotations;
|
||||||
|
|||||||
Reference in New Issue
Block a user