mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 11:06:43 +00:00
Fix for line focus when clicking on a verifier script error
- setFocus() on the script editor, otherwise setting the text cursor has no effect. - setFocus() must be done after the widgets are created/shown, or the newly created widgets will "steal" the focus again. - Missing useHint in case subviews are reused.
This commit is contained in:
parent
e6e02714a0
commit
6ff2523d8a
2 changed files with 6 additions and 2 deletions
|
@ -485,6 +485,8 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
||||||
(!isReferenceable && id == sb->getUniversalId()))
|
(!isReferenceable && id == sb->getUniversalId()))
|
||||||
{
|
{
|
||||||
sb->setFocus();
|
sb->setFocus();
|
||||||
|
if (!hint.empty())
|
||||||
|
sb->useHint (hint);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -515,8 +517,6 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
||||||
assert(view);
|
assert(view);
|
||||||
view->setParent(this);
|
view->setParent(this);
|
||||||
mSubViews.append(view); // only after assert
|
mSubViews.append(view); // only after assert
|
||||||
if (!hint.empty())
|
|
||||||
view->useHint (hint);
|
|
||||||
|
|
||||||
int minWidth = userSettings.setting ("window/minimum-width", QString("325")).toInt();
|
int minWidth = userSettings.setting ("window/minimum-width", QString("325")).toInt();
|
||||||
view->setMinimumWidth(minWidth);
|
view->setMinimumWidth(minWidth);
|
||||||
|
@ -538,6 +538,9 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
||||||
this, SLOT (updateSubViewIndicies (SubView *)));
|
this, SLOT (updateSubViewIndicies (SubView *)));
|
||||||
|
|
||||||
view->show();
|
view->show();
|
||||||
|
|
||||||
|
if (!hint.empty())
|
||||||
|
view->useHint (hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVDoc::View::newView()
|
void CSVDoc::View::newView()
|
||||||
|
|
|
@ -68,6 +68,7 @@ void CSVWorld::ScriptSubView::useHint (const std::string& hint)
|
||||||
if (cursor.movePosition (QTextCursor::Down, QTextCursor::MoveAnchor, line))
|
if (cursor.movePosition (QTextCursor::Down, QTextCursor::MoveAnchor, line))
|
||||||
cursor.movePosition (QTextCursor::Right, QTextCursor::MoveAnchor, column);
|
cursor.movePosition (QTextCursor::Right, QTextCursor::MoveAnchor, column);
|
||||||
|
|
||||||
|
mEditor->setFocus();
|
||||||
mEditor->setTextCursor (cursor);
|
mEditor->setTextCursor (cursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue