From c890f6c1bb06d4f115f1aa49d6fd30421a9c2037 Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Sun, 9 Jan 2022 16:31:31 -0500 Subject: [PATCH] Another fix to ensure that Qt TAS piano roll frame number width is at least 9 chars wide. --- src/drivers/Qt/TasEditor/TasEditorWindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp index 978ec383..eb7fbfd5 100644 --- a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp +++ b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp @@ -4294,6 +4294,7 @@ void QPianoRoll::setFont( QFont &newFont ) //---------------------------------------------------------------------------- void QPianoRoll::calcFontData(void) { + QRect rect; QWidget::setFont(font); QFontMetrics metrics(font); #if QT_VERSION > QT_VERSION_CHECK(5, 11, 0) @@ -4316,6 +4317,14 @@ void QPianoRoll::calcFontData(void) pxWidthBtnCol = 3 * pxCharWidth; pxWidthCtlCol = 8 * pxWidthBtnCol; + rect = metrics.boundingRect( tr("000000000") ); + + //printf("FrameWidth: %i %i\n", pxWidthFrameCol, rect.width() ); + if ( pxWidthFrameCol < rect.width() ) + { + pxWidthFrameCol = rect.width(); + } + pxFrameColX = pxWidthCol1; for (int i=0; i<4; i++)