Remember cursor position and return focus to the formula field.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-10-05 16:52:18 +03:00
parent 67240af260
commit 61178e64de

View File

@ -1129,7 +1129,10 @@ void TMainWindow::ShowMData()
void TMainWindow::DeployFormula()
{
SCASSERT(ui->plainTextEditFormula != nullptr);
SCASSERT(ui->pushButtonGrow != nullptr)
SCASSERT(ui->pushButtonGrow != nullptr);
const QTextCursor cursor = ui->plainTextEditFormula->textCursor();
if (ui->plainTextEditFormula->height() < DIALOG_MAX_FORMULA_HEIGHT)
{
ui->plainTextEditFormula->setFixedHeight(DIALOG_MAX_FORMULA_HEIGHT);
@ -1150,6 +1153,9 @@ void TMainWindow::DeployFormula()
setUpdatesEnabled(false);
repaint();
setUpdatesEnabled(true);
ui->plainTextEditFormula->setFocus();
ui->plainTextEditFormula->setTextCursor(cursor);
}
//---------------------------------------------------------------------------------------------------------------------