implement feature

This commit is contained in:
RickyRister 2024-12-16 23:41:08 -08:00
parent 90564acaee
commit 9f95c731d1
2 changed files with 14 additions and 0 deletions

View file

@ -333,3 +333,16 @@ void ZoneViewWidget::initStyleOption(QStyleOption *option) const
if (titleBar)
titleBar->icon = QPixmap("theme:cockatrice");
}
void ZoneViewWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{
if (event->pos().y() <= 0) {
// expand window to full height and width if not currently at full height and width
// otherwise shrink window to initial max height
if (size().height() < maximumHeight() || size().width() < maximumWidth()) {
resize(maximumSize());
} else {
resizeToZoneContents();
}
}
}

View file

@ -89,6 +89,7 @@ public:
protected:
void closeEvent(QCloseEvent *event) override;
void initStyleOption(QStyleOption *option) const override;
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
};
#endif