mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 18:43:55 -07:00
Clamp all DeckPreviewWidget children to the card size on resize. (#5669)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
3620664a9f
commit
d76e8f9146
1 changed files with 5 additions and 2 deletions
|
|
@ -51,10 +51,13 @@ void DeckPreviewWidget::retranslateUi()
|
||||||
void DeckPreviewWidget::resizeEvent(QResizeEvent *event)
|
void DeckPreviewWidget::resizeEvent(QResizeEvent *event)
|
||||||
{
|
{
|
||||||
QWidget::resizeEvent(event);
|
QWidget::resizeEvent(event);
|
||||||
if (bannerCardDisplayWidget == nullptr || bannerCardComboBox == nullptr) {
|
if (bannerCardDisplayWidget == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bannerCardComboBox->setMaximumWidth(bannerCardDisplayWidget->width());
|
QList<QWidget *> widgets = findChildren<QWidget *>();
|
||||||
|
for (QWidget *widget : widgets) {
|
||||||
|
widget->setMaximumWidth(bannerCardDisplayWidget->width());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckPreviewWidget::initializeUi(const bool deckLoadSuccess)
|
void DeckPreviewWidget::initializeUi(const bool deckLoadSuccess)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue