mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
visual improvements: card hover effect, independent scaling of ZoneViewWidget
This commit is contained in:
parent
6b7c5eefd3
commit
46fdae43cd
8 changed files with 127 additions and 34 deletions
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef ZONEVIEWWIDGET_H
|
||||
#define ZONEVIEWWIDGET_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QGraphicsScene>
|
||||
#include <QGraphicsWidget>
|
||||
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
class CardZone;
|
||||
class ZoneViewZone;
|
||||
class Player;
|
||||
|
|
@ -13,12 +13,32 @@ class QScrollBar;
|
|||
class QCheckBox;
|
||||
class GameScene;
|
||||
class ServerInfo_Card;
|
||||
class QGraphicsSceneMouseEvent;
|
||||
|
||||
class TitleLabel : public QGraphicsWidget {
|
||||
Q_OBJECT
|
||||
private:
|
||||
QString text;
|
||||
QPointF buttonDownPos;
|
||||
public:
|
||||
TitleLabel();
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/);
|
||||
void setText(const QString &_text) { text = _text; update(); }
|
||||
signals:
|
||||
void mouseMoved(QPointF scenePos);
|
||||
protected:
|
||||
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
};
|
||||
|
||||
class ZoneViewWidget : public QGraphicsWidget {
|
||||
Q_OBJECT
|
||||
private:
|
||||
ZoneViewZone *zone;
|
||||
|
||||
TitleLabel *titleLabel;
|
||||
QPushButton *closeButton;
|
||||
QScrollBar *scrollBar;
|
||||
QCheckBox *sortByNameCheckBox, *sortByTypeCheckBox, *shuffleCheckBox;
|
||||
|
||||
|
|
@ -29,6 +49,7 @@ signals:
|
|||
private slots:
|
||||
void resizeToZoneContents();
|
||||
void zoneDeleted();
|
||||
void moveWidget(QPointF scenePos);
|
||||
public:
|
||||
ZoneViewWidget(Player *_player, CardZone *_origZone, int numberCards = 0, bool _revealZone = false, const QList<ServerInfo_Card *> &cardList = QList<ServerInfo_Card *>());
|
||||
ZoneViewZone *getZone() const { return zone; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue