From a04887e8587551615ca96307a2412ccb4dcc3529 Mon Sep 17 00:00:00 2001 From: RickyRister Date: Wed, 18 Dec 2024 21:27:16 -0800 Subject: [PATCH] fix after rebase --- cockatrice/src/game/zones/view_zone_widget.cpp | 6 +++--- cockatrice/src/game/zones/view_zone_widget.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cockatrice/src/game/zones/view_zone_widget.cpp b/cockatrice/src/game/zones/view_zone_widget.cpp index ada77474e..0d33716ee 100644 --- a/cockatrice/src/game/zones/view_zone_widget.cpp +++ b/cockatrice/src/game/zones/view_zone_widget.cpp @@ -281,7 +281,7 @@ static qreal determineNewZoneHeight(qreal oldZoneHeight) return calcMaxInitialHeight(); } -void ZoneViewWidget::resizeToZoneContents() +void ZoneViewWidget::resizeToZoneContents(bool forceInitialHeight) { QRectF zoneRect = zone->getOptimumRect(); qreal totalZoneHeight = zoneRect.height(); @@ -292,7 +292,7 @@ void ZoneViewWidget::resizeToZoneContents() QSizeF maxSize(width, zoneRect.height() + extraHeight + 10); qreal currentZoneHeight = rect().height() - extraHeight - 10; - qreal newZoneHeight = determineNewZoneHeight(currentZoneHeight); + qreal newZoneHeight = forceInitialHeight ? calcMaxInitialHeight() : determineNewZoneHeight(currentZoneHeight); QSizeF initialSize(width, newZoneHeight + extraHeight + 10); @@ -342,7 +342,7 @@ void ZoneViewWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) if (size().height() < maximumHeight() || size().width() < maximumWidth()) { resize(maximumSize()); } else { - resizeToZoneContents(); + resizeToZoneContents(true); } } } \ No newline at end of file diff --git a/cockatrice/src/game/zones/view_zone_widget.h b/cockatrice/src/game/zones/view_zone_widget.h index af44a2af1..5f878f738 100644 --- a/cockatrice/src/game/zones/view_zone_widget.h +++ b/cockatrice/src/game/zones/view_zone_widget.h @@ -63,7 +63,7 @@ private slots: void processGroupBy(int value); void processSortBy(int value); void processSetPileView(QT_STATE_CHANGED_T value); - void resizeToZoneContents(); + void resizeToZoneContents(bool forceInitialHeight = false); void handleScrollBarChange(int value); void zoneDeleted(); void moveEvent(QGraphicsSceneMoveEvent * /* event */) override;