This commit is contained in:
Kravickas 2026-03-29 21:44:47 +02:00 committed by GitHub
parent 6cff6f80b7
commit caf9b9d410
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -463,9 +463,6 @@ void update_manager::update(bool auto_accept)
grid->addWidget(toggle_btn, row++, 0, 1, cols);
grid->addWidget(changelog_browser, row++, 0, 1, cols);
// Pre-size dialog to fit the widest changelog entry
mb.setMinimumWidth(content_width + 60);
QObject::connect(toggle_btn, &QPushButton::clicked, [changelog_browser, toggle_btn, &mb, show_text, hide_text]()
{
const bool becoming_visible = !changelog_browser->isVisible();
@ -492,6 +489,14 @@ void update_manager::update(bool auto_accept)
grid->addWidget(button_box, row, 0, 1, cols);
}
// Force dialog width to fit the widest changelog entry before showing
if (!longest_line.isEmpty())
{
const QFontMetrics fm = mb.fontMetrics();
const int dialog_width = fm.horizontalAdvance(longest_line) + 100;
mb.setFixedWidth(dialog_width);
}
update_log.notice("Asking user for permission to update...");
if (mb.exec() == QMessageBox::No)