Fix Deck Popup Glitchy Rendering

- 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:
ZeldaZach 2024-11-28 16:20:48 -05:00
parent 37bb1367db
commit d65b233366
No known key found for this signature in database

View file

@ -120,6 +120,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::processSortByType(QT_STATE_CHANGED_T value)