forked from qt-creator/qt-creator
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).
This commit is contained in:
@@ -427,7 +427,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
|||||||
advancedMenu->addAction(cmd, Core::Constants::G_EDIT_FONT);
|
advancedMenu->addAction(cmd, Core::Constants::G_EDIT_FONT);
|
||||||
|
|
||||||
a = new QAction(tr("Reset Font Size"), this);
|
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);
|
modecontext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+0")));
|
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+0")));
|
||||||
connect(a, SIGNAL(triggered()), m_centralWidget, SLOT(resetZoom()));
|
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()
|
void BaseTextEditor::maybeSelectLine()
|
||||||
{
|
{
|
||||||
QTextCursor cursor = textCursor();
|
QTextCursor cursor = textCursor();
|
||||||
|
@@ -418,6 +418,7 @@ protected:
|
|||||||
void keyPressEvent(QKeyEvent *e);
|
void keyPressEvent(QKeyEvent *e);
|
||||||
void wheelEvent(QWheelEvent *e);
|
void wheelEvent(QWheelEvent *e);
|
||||||
void changeEvent(QEvent *e);
|
void changeEvent(QEvent *e);
|
||||||
|
void focusOutEvent(QFocusEvent *e);
|
||||||
|
|
||||||
void showEvent(QShowEvent *);
|
void showEvent(QShowEvent *);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user