Skip to content

Commit

Permalink
Nicer way of ensuring selected character is in view
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 2, 2019
1 parent c534f5f commit 57fa547
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gui/symbology/characterwidget.cpp
Expand Up @@ -118,7 +118,9 @@ void CharacterWidget::setCharacter( QChar character )
{
QScrollArea *scrollArea = qobject_cast< QScrollArea *>( widget->parent() );
if ( scrollArea && mLastKey < 65536 )
scrollArea->verticalScrollBar()->setValue( mLastKey / mColumns * mSquareSize );
{
scrollArea->ensureVisible( 0, mLastKey / mColumns * mSquareSize );
}
}
if ( changed )
emit characterSelected( mLastKey );
Expand Down

0 comments on commit 57fa547

Please sign in to comment.