Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
GRASS - set correctly qtermwidget font, fixes #7340
  • Loading branch information
blazek committed May 30, 2013
1 parent ca86153 commit 8a4499b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/plugins/grass/qtermwidget/TerminalDisplay.cpp
Expand Up @@ -211,10 +211,12 @@ void TerminalDisplay::setVTFont( const QFont& f )
// mono-spaced font, in which case kerning information should have an effect.
// Disabling kerning saves some computation when rendering text.
font.setKerning( false );

QWidget::setFont( font );
fontChange( font );
}

// This was in the block above so that font was not properly set if called
// before the widget was rendered and got its size and it was causing #7340 (cursor shift)
QWidget::setFont( font );
fontChange( font );
}

void TerminalDisplay::setFont( const QFont & )
Expand Down Expand Up @@ -803,7 +805,7 @@ void TerminalDisplay::scrollImage( int lines , const QRect& screenWindowRegion )
QRegion TerminalDisplay::hotSpotRegion() const
{
QRegion region;
foreach( Filter::HotSpot* hotSpot , _filterChain->hotSpots() )
foreach ( Filter::HotSpot* hotSpot , _filterChain->hotSpots() )
{
QRect rect;
rect.setLeft( hotSpot->startColumn() );
Expand Down Expand Up @@ -1080,7 +1082,7 @@ void TerminalDisplay::paintEvent( QPaintEvent* pe )
QPainter paint( this );
//qDebug("%s %d paintEvent %d %d", __FILE__, __LINE__, paint.window().top(), paint.window().right());

foreach( QRect rect, ( pe->region() & contentsRect() ).rects() )
foreach ( QRect rect, ( pe->region() & contentsRect() ).rects() )
{
drawBackground( paint, rect, palette().background().color(), true /* use opacity setting */ );
drawContents( paint, rect );
Expand Down

0 comments on commit 8a4499b

Please sign in to comment.