Fix Deck Popup Glitchy Rendering (#5204)

- QLabel sizes weren't taken into account until the widget is rendered
- Long QLabels can cause exacerbated issues
- Force refresh after 1ms to take QLabels into account
This commit is contained in:
Zach H 2024-11-29 09:53:19 -08:00 committed by GitHub
parent 17eabf2004
commit 1d8651bc00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -140,6 +140,15 @@ ZoneViewWidget::ZoneViewWidget(Player *_player,
connect(zone, SIGNAL(optimumRectChanged()), this, SLOT(resizeToZoneContents()));
connect(zone, SIGNAL(beingDeleted()), this, SLOT(zoneDeleted()));
zone->initializeCards(cardList);
auto *lastResizeBeforeVisibleTimer = new QTimer(this);
connect(lastResizeBeforeVisibleTimer, &QTimer::timeout, this, [=] {
resizeToZoneContents();
disconnect(lastResizeBeforeVisibleTimer);
lastResizeBeforeVisibleTimer->deleteLater();
});
lastResizeBeforeVisibleTimer->setSingleShot(true);
lastResizeBeforeVisibleTimer->start(1);
}
void ZoneViewWidget::processGroupBy(int index)