mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -07:00
Merge c3d6bdcbe7 into b1fe4c85d3
This commit is contained in:
commit
a94db13601
2 changed files with 23 additions and 0 deletions
|
|
@ -121,6 +121,13 @@ ZoneViewWidget::ZoneViewWidget(Player *_player,
|
||||||
|
|
||||||
extraHeight = vbox->sizeHint(Qt::PreferredSize).height();
|
extraHeight = vbox->sizeHint(Qt::PreferredSize).height();
|
||||||
|
|
||||||
|
QGraphicsProxyWidget *cardLocationLabelProxy = new QGraphicsProxyWidget;
|
||||||
|
cardLocationLabelProxy->setWidget(&cardLocationLabel);
|
||||||
|
if (!_isReversed && showLibraryLabel(_origZone, numberCards)) {
|
||||||
|
cardLocationLabel.setText(tr("Top of Library"));
|
||||||
|
vbox->addItem(cardLocationLabelProxy);
|
||||||
|
}
|
||||||
|
|
||||||
QGraphicsLinearLayout *zoneHBox = new QGraphicsLinearLayout(Qt::Horizontal);
|
QGraphicsLinearLayout *zoneHBox = new QGraphicsLinearLayout(Qt::Horizontal);
|
||||||
|
|
||||||
zoneContainer = new QGraphicsWidget(this);
|
zoneContainer = new QGraphicsWidget(this);
|
||||||
|
|
@ -139,6 +146,11 @@ ZoneViewWidget::ZoneViewWidget(Player *_player,
|
||||||
|
|
||||||
vbox->addItem(zoneHBox);
|
vbox->addItem(zoneHBox);
|
||||||
|
|
||||||
|
if (_isReversed && showLibraryLabel(_origZone, numberCards)) {
|
||||||
|
cardLocationLabel.setText(tr("Bottom of Library"));
|
||||||
|
vbox->addItem(cardLocationLabelProxy);
|
||||||
|
}
|
||||||
|
|
||||||
zone = new ZoneViewZone(new ZoneViewZoneLogic(player, _origZone, numberCards, _revealZone, _writeableRevealZone,
|
zone = new ZoneViewZone(new ZoneViewZoneLogic(player, _origZone, numberCards, _revealZone, _writeableRevealZone,
|
||||||
_isReversed, zoneContainer),
|
_isReversed, zoneContainer),
|
||||||
zoneContainer);
|
zoneContainer);
|
||||||
|
|
@ -575,3 +587,11 @@ void ZoneViewWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
||||||
expandWindow();
|
expandWindow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ZoneViewWidget::showLibraryLabel(CardZoneLogic *zone, int numberOfCards)
|
||||||
|
{
|
||||||
|
if (zone == nullptr || numberOfCards < 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return zone->getName() == ZoneNames::DECK;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QGraphicsProxyWidget>
|
#include <QGraphicsProxyWidget>
|
||||||
#include <QGraphicsWidget>
|
#include <QGraphicsWidget>
|
||||||
|
#include <QLabel>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <libcockatrice/utility/macros.h>
|
#include <libcockatrice/utility/macros.h>
|
||||||
|
|
@ -62,6 +63,7 @@ private:
|
||||||
QComboBox sortBySelector;
|
QComboBox sortBySelector;
|
||||||
QCheckBox shuffleCheckBox;
|
QCheckBox shuffleCheckBox;
|
||||||
QCheckBox pileViewCheckBox;
|
QCheckBox pileViewCheckBox;
|
||||||
|
QLabel cardLocationLabel;
|
||||||
|
|
||||||
bool canBeShuffled;
|
bool canBeShuffled;
|
||||||
int extraHeight;
|
int extraHeight;
|
||||||
|
|
@ -74,6 +76,7 @@ private:
|
||||||
|
|
||||||
void stopWindowDrag();
|
void stopWindowDrag();
|
||||||
void startWindowDrag(QGraphicsSceneMouseEvent *event);
|
void startWindowDrag(QGraphicsSceneMouseEvent *event);
|
||||||
|
bool showLibraryLabel(CardZoneLogic *zone, int numberOfCards);
|
||||||
QRectF closeButtonRect(QWidget *styleWidget) const;
|
QRectF closeButtonRect(QWidget *styleWidget) const;
|
||||||
/**
|
/**
|
||||||
* @brief Resolves the QGraphicsView to use for drag coordinate mapping
|
* @brief Resolves the QGraphicsView to use for drag coordinate mapping
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue