mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-05-07 13:37:46 +00:00
ui9
Removed unnecessary addition of 10 to browser height calculation and added comments for clarity.
This commit is contained in:
parent
bc77c0cb42
commit
306edddf08
1 changed files with 6 additions and 3 deletions
|
|
@ -447,19 +447,19 @@ void update_manager::update(bool auto_accept)
|
|||
changelog_browser->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
changelog_browser->setHtml(QStringLiteral("<h3>%0</h3>%1").arg(tr("Changelog:"), changelog_html));
|
||||
|
||||
// Measure height for 6 entries directly
|
||||
// Measure height for 6 entries directly.
|
||||
int browser_height;
|
||||
|
||||
if (changelog_count > 6)
|
||||
{
|
||||
// Temporarily render only 6 entries to get exact pixel height
|
||||
changelog_browser->setHtml(QStringLiteral("<h3>%0</h3>%1").arg(tr("Changelog:"), changelog_html_capped));
|
||||
browser_height = static_cast<int>(changelog_browser->document()->size().height()) + 10;
|
||||
browser_height = static_cast<int>(changelog_browser->document()->size().height());
|
||||
changelog_browser->setHtml(QStringLiteral("<h3>%0</h3>%1").arg(tr("Changelog:"), changelog_html));
|
||||
}
|
||||
else
|
||||
{
|
||||
browser_height = static_cast<int>(changelog_browser->document()->size().height()) + 10;
|
||||
browser_height = static_cast<int>(changelog_browser->document()->size().height());
|
||||
}
|
||||
|
||||
changelog_browser->setFixedSize(500, browser_height);
|
||||
|
|
@ -472,6 +472,9 @@ 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 so it doesn't resize when toggling
|
||||
mb.setMinimumWidth(540);
|
||||
|
||||
QObject::connect(toggle_btn, &QPushButton::clicked, [changelog_browser, toggle_btn, &mb, show_text, hide_text]()
|
||||
{
|
||||
const bool becoming_visible = !changelog_browser->isVisible();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue