Commit b7635dda authored by mae's avatar mae
Browse files

tune editor mouse cursor behaviour

the fix makes the mouse cursor visible when the editor loses focus.
This fixes an issue with the completion box, where on mac and windows
no mouse cursor would be visible (it worked on X11 due to the way
X11 does mouse grabbing for popup windows).
parent a21ebf54
......@@ -427,7 +427,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
advancedMenu->addAction(cmd, Core::Constants::G_EDIT_FONT);
a = new QAction(tr("Reset Font Size"), this);
cmd = am->registerAction(a, TextEditor::Constants::DECREASE_FONT_SIZE,
cmd = am->registerAction(a, TextEditor::Constants::RESET_FONT_SIZE,
modecontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+0")));
connect(a, SIGNAL(triggered()), m_centralWidget, SLOT(resetZoom()));
......
......@@ -4179,6 +4179,14 @@ void BaseTextEditor::changeEvent(QEvent *e)
}
}
void BaseTextEditor::focusOutEvent(QFocusEvent *e)
{
QPlainTextEdit::focusOutEvent(e);
if (viewport()->cursor().shape() == Qt::BlankCursor)
viewport()->setCursor(Qt::IBeamCursor);
}
void BaseTextEditor::maybeSelectLine()
{
QTextCursor cursor = textCursor();
......
......@@ -418,6 +418,7 @@ protected:
void keyPressEvent(QKeyEvent *e);
void wheelEvent(QWheelEvent *e);
void changeEvent(QEvent *e);
void focusOutEvent(QFocusEvent *e);
void showEvent(QShowEvent *);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment