mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-20 17:32:15 -07:00
get thing to work
This commit is contained in:
parent
c9c56d5c73
commit
3affc0b56a
2 changed files with 14 additions and 1 deletions
|
|
@ -245,6 +245,19 @@ void ZoneViewWidget::moveEvent(QGraphicsSceneMoveEvent * /* event */)
|
|||
setPos(scenePos);
|
||||
}
|
||||
|
||||
void ZoneViewWidget::resizeEvent(QGraphicsSceneResizeEvent *event)
|
||||
{
|
||||
if (!zone)
|
||||
return;
|
||||
|
||||
// We need to manually resize the scroll bar whenever the window gets resized
|
||||
qreal totalZoneHeight = zone->getOptimumRect().height();
|
||||
qreal newWindowHeight = event->newSize().height();
|
||||
qreal newZoneHeight = newWindowHeight - extraHeight - 10;
|
||||
|
||||
scrollBar->setMaximum(totalZoneHeight - newZoneHeight);
|
||||
}
|
||||
|
||||
void ZoneViewWidget::resizeToZoneContents()
|
||||
{
|
||||
QRectF zoneRect = zone->getOptimumRect();
|
||||
|
|
@ -261,7 +274,6 @@ void ZoneViewWidget::resizeToZoneContents()
|
|||
resize(initialSize);
|
||||
|
||||
zone->setGeometry(QRectF(0, -scrollBar->value(), zoneContainer->size().width(), totalZoneHeight));
|
||||
scrollBar->setMaximum(totalZoneHeight - initialZoneHeight);
|
||||
|
||||
if (layout())
|
||||
layout()->invalidate();
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ private slots:
|
|||
void handleScrollBarChange(int value);
|
||||
void zoneDeleted();
|
||||
void moveEvent(QGraphicsSceneMoveEvent * /* event */);
|
||||
void resizeEvent(QGraphicsSceneResizeEvent * /* event */);
|
||||
|
||||
public:
|
||||
ZoneViewWidget(Player *_player,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue