mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-21 01:42: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);
|
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()
|
void ZoneViewWidget::resizeToZoneContents()
|
||||||
{
|
{
|
||||||
QRectF zoneRect = zone->getOptimumRect();
|
QRectF zoneRect = zone->getOptimumRect();
|
||||||
|
|
@ -261,7 +274,6 @@ void ZoneViewWidget::resizeToZoneContents()
|
||||||
resize(initialSize);
|
resize(initialSize);
|
||||||
|
|
||||||
zone->setGeometry(QRectF(0, -scrollBar->value(), zoneContainer->size().width(), totalZoneHeight));
|
zone->setGeometry(QRectF(0, -scrollBar->value(), zoneContainer->size().width(), totalZoneHeight));
|
||||||
scrollBar->setMaximum(totalZoneHeight - initialZoneHeight);
|
|
||||||
|
|
||||||
if (layout())
|
if (layout())
|
||||||
layout()->invalidate();
|
layout()->invalidate();
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ private slots:
|
||||||
void handleScrollBarChange(int value);
|
void handleScrollBarChange(int value);
|
||||||
void zoneDeleted();
|
void zoneDeleted();
|
||||||
void moveEvent(QGraphicsSceneMoveEvent * /* event */);
|
void moveEvent(QGraphicsSceneMoveEvent * /* event */);
|
||||||
|
void resizeEvent(QGraphicsSceneResizeEvent * /* event */);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ZoneViewWidget(Player *_player,
|
ZoneViewWidget(Player *_player,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue