Mercurial > octave-nkf
comparison libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp @ 16617:3a17dd5964e3
use average width for character size in GUI terminal for Windows
* QWinTErminalImpl.cpp (QConsolePrivate::updateConsoleSize):
Use QFontMetrics::averageCharWidth instead of maxWidth.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 06 May 2013 00:56:09 -0400 |
parents | dae674adf045 |
children | 13728d41fb6a |
comparison
equal
deleted
inserted
replaced
16616:b383c8a22116 | 16617:3a17dd5964e3 |
---|---|
488 void QConsolePrivate::updateConsoleSize (bool sync) | 488 void QConsolePrivate::updateConsoleSize (bool sync) |
489 { | 489 { |
490 QFontMetrics fm (m_font); | 490 QFontMetrics fm (m_font); |
491 QSize winSize = m_consoleView->size (); | 491 QSize winSize = m_consoleView->size (); |
492 | 492 |
493 m_charSize.rwidth () = fm.maxWidth (); | 493 m_charSize.rwidth () = fm.averageCharWidth (); |
494 m_charSize.rheight () = fm.lineSpacing (); | 494 m_charSize.rheight () = fm.lineSpacing (); |
495 | 495 |
496 m_consoleRect.setWidth (winSize.width () / fm.maxWidth ()); | 496 m_consoleRect.setWidth (winSize.width () / fm.averageCharWidth ()); |
497 m_consoleRect.setHeight (winSize.height () / fm.lineSpacing ()); | 497 m_consoleRect.setHeight (winSize.height () / fm.lineSpacing ()); |
498 | 498 |
499 m_bufferSize.rwidth () = m_consoleRect.width (); | 499 m_bufferSize.rwidth () = m_consoleRect.width (); |
500 m_bufferSize.rheight () = qMax (m_bufferSize.height (), | 500 m_bufferSize.rheight () = qMax (m_bufferSize.height (), |
501 m_consoleRect.height ()); | 501 m_consoleRect.height ()); |