Skip to content

Commit

Permalink
- Fix ModelicaEditor text cursor for linux.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10138 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Oct 17, 2011
1 parent 6f9768c commit 07d7cf6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion OMEdit/OMEditGUI/ModelicaEditor.cpp
Expand Up @@ -273,6 +273,7 @@ void ModelicaEditor::highlightCurrentLine()
selection.cursor.clearSelection();
extraSelections.append(selection);
setExtraSelections(extraSelections);
setTextCursor(textCursor());
}

//! Slot activated when ModelicaEditor updateRequest signal is raised.
Expand Down Expand Up @@ -305,7 +306,15 @@ void ModelicaEditor::lineNumberAreaPaintEvent(QPaintEvent *event)
if (block.isVisible() && bottom >= event->rect().top())
{
QString number = QString::number(blockNumber + 1);
painter.setPen(Qt::gray);
// make the current highlighted line number darker
if (blockNumber == textCursor().blockNumber())
{
painter.setPen(QColor(64, 64, 64));
}
else
{
painter.setPen(Qt::gray);
}
painter.setFont(document()->defaultFont());
QFontMetrics fontMetrics (document()->defaultFont());
painter.drawText(0, top, mpLineNumberArea->width() - 5, fontMetrics.height(), Qt::AlignRight, number);
Expand Down

0 comments on commit 07d7cf6

Please sign in to comment.