mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Updated reveal zone check boxes
I saw in some images from other platforms it can take up alot of space. Made the boxed horizontal, rather than vertical. WIP Remade reveal zone + darkened card area to eaisily see boundries + reverted back to using a window + window can be resized + removed fake title bar and "X" + moved all cards revealed slightly to the right, makes it easier to drag-select from the left Cleanup Changed style to use cockatrice icon Changed cast from static_cast to qstyleoption_cast
This commit is contained in:
parent
cf24f4aa04
commit
1e0c4cbf87
3 changed files with 20 additions and 26 deletions
|
|
@ -1,6 +1,8 @@
|
|||
#include <math.h>
|
||||
#include <QDebug>
|
||||
#include <QGraphicsSceneWheelEvent>
|
||||
#include <QBrush>
|
||||
#include <QPainter>
|
||||
#include "zoneviewzone.h"
|
||||
#include "player.h"
|
||||
#include "carddragitem.h"
|
||||
|
|
@ -32,8 +34,11 @@ QRectF ZoneViewZone::boundingRect() const
|
|||
return bRect;
|
||||
}
|
||||
|
||||
void ZoneViewZone::paint(QPainter * /*painter*/, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
|
||||
void ZoneViewZone::paint(QPainter * painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
|
||||
{
|
||||
QBrush windowBrush(QColor(240,240,240));
|
||||
windowBrush.setColor(windowBrush.color().darker(150));
|
||||
painter->fillRect(boundingRect(), windowBrush);
|
||||
}
|
||||
|
||||
void ZoneViewZone::initializeCards(const QList<const ServerInfo_Card *> &cardList)
|
||||
|
|
@ -123,7 +128,7 @@ void ZoneViewZone::reorganizeCards()
|
|||
}
|
||||
|
||||
lastCardType = cardType;
|
||||
qreal x = typeColumn * CARD_WIDTH;
|
||||
qreal x = 7 + (typeColumn * CARD_WIDTH);
|
||||
qreal y = typeRow * CARD_HEIGHT / 3;
|
||||
c->setPos(x + 5, y + 5);
|
||||
c->setRealZValue(i);
|
||||
|
|
@ -132,7 +137,7 @@ void ZoneViewZone::reorganizeCards()
|
|||
} else {
|
||||
for (int i = 0; i < cardCount; i++) {
|
||||
CardItem *c = cardsToDisplay.at(i);
|
||||
qreal x = (i / rows) * CARD_WIDTH;
|
||||
qreal x = 7 + ((i / rows) * CARD_WIDTH);
|
||||
qreal y = (i % rows) * CARD_HEIGHT / 3;
|
||||
c->setPos(x + 5, y + 5);
|
||||
c->setRealZValue(i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue