From 42039004b5a46c9dfe2e19ebaf848ebd903103ed Mon Sep 17 00:00:00 2001 From: harry Date: Mon, 16 Jan 2023 20:21:10 -0500 Subject: [PATCH] Fix for Qt GUI symbolic debug filename widget size exploding when the ROM file path is large. --- src/drivers/Qt/SymbolicDebug.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/drivers/Qt/SymbolicDebug.cpp b/src/drivers/Qt/SymbolicDebug.cpp index dbb7dab9..7ad3a57f 100644 --- a/src/drivers/Qt/SymbolicDebug.cpp +++ b/src/drivers/Qt/SymbolicDebug.cpp @@ -1416,6 +1416,7 @@ void SymbolEditWindow::setAddr( int addrIn ) { char stmp[64]; std::string filename; + size_t size; addr = addrIn; @@ -1438,7 +1439,13 @@ void SymbolEditWindow::setAddr( int addrIn ) generateNLFilenameForAddress( addr, filename ); filepath->setText( tr(filename.c_str()) ); - filepath->setMinimumWidth( charWidth * (filepath->text().size() + 4) ); + + size = filepath->text().size(); + + // Limit max size so that widget size doesn't explode on a large file path. + if (size > 32) size = 32; + + filepath->setMinimumWidth( charWidth * (size + 4) ); } //-------------------------------------------------------------- void SymbolEditWindow::setBank( int bankIn )