mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 10:33:54 -07:00
Clang-format (#3028)
* 1/3 Add .clang-format file and travis compilation check * 2/3 Run clang-format * 3/3 Fix compilation problems due to include reordering * 3bis/3 AfterControlStatement: false
This commit is contained in:
parent
8dbdd24c8e
commit
b29bd9e070
272 changed files with 13378 additions and 9535 deletions
|
|
@ -2,14 +2,21 @@
|
|||
#define PHASESTOOLBAR_H
|
||||
|
||||
#include <QFrame>
|
||||
#include <QList>
|
||||
#include <QGraphicsObject>
|
||||
#include <QList>
|
||||
|
||||
namespace google { namespace protobuf { class Message; } }
|
||||
namespace google
|
||||
{
|
||||
namespace protobuf
|
||||
{
|
||||
class Message;
|
||||
}
|
||||
} // namespace google
|
||||
class Player;
|
||||
class GameCommand;
|
||||
|
||||
class PhaseButton : public QObject, public QGraphicsItem {
|
||||
class PhaseButton : public QObject, public QGraphicsItem
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QGraphicsItem)
|
||||
private:
|
||||
|
|
@ -19,26 +26,35 @@ private:
|
|||
QTimer *activeAnimationTimer;
|
||||
QAction *doubleClickAction;
|
||||
double width;
|
||||
|
||||
|
||||
void updatePixmap(QPixmap &pixmap);
|
||||
private slots:
|
||||
void updateAnimation();
|
||||
|
||||
public:
|
||||
PhaseButton(const QString &_name, QGraphicsItem *parent = 0, QAction *_doubleClickAction = 0, bool _highlightable = true);
|
||||
PhaseButton(const QString &_name,
|
||||
QGraphicsItem *parent = 0,
|
||||
QAction *_doubleClickAction = 0,
|
||||
bool _highlightable = true);
|
||||
QRectF boundingRect() const;
|
||||
void setWidth(double _width);
|
||||
void setActive(bool _active);
|
||||
bool getActive() const { return active; }
|
||||
bool getActive() const
|
||||
{
|
||||
return active;
|
||||
}
|
||||
void triggerDoubleClickAction();
|
||||
signals:
|
||||
void clicked();
|
||||
|
||||
protected:
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/);
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
|
||||
};
|
||||
|
||||
class PhasesToolbar : public QObject, public QGraphicsItem {
|
||||
class PhasesToolbar : public QObject, public QGraphicsItem
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QGraphicsItem)
|
||||
private:
|
||||
|
|
@ -49,13 +65,20 @@ private:
|
|||
static const int spaceCount = 6;
|
||||
static const double marginSize;
|
||||
void rearrangeButtons();
|
||||
|
||||
public:
|
||||
PhasesToolbar(QGraphicsItem *parent = 0);
|
||||
QRectF boundingRect() const;
|
||||
void retranslateUi();
|
||||
void setHeight(double _height);
|
||||
double getWidth() const { return width; }
|
||||
int phaseCount() const { return buttonList.size(); }
|
||||
double getWidth() const
|
||||
{
|
||||
return width;
|
||||
}
|
||||
int phaseCount() const
|
||||
{
|
||||
return buttonList.size();
|
||||
}
|
||||
QString getLongPhaseName(int phase) const;
|
||||
public slots:
|
||||
void setActivePhase(int phase);
|
||||
|
|
@ -66,6 +89,7 @@ private slots:
|
|||
void actDrawCard();
|
||||
signals:
|
||||
void sendGameCommand(const ::google::protobuf::Message &command, int playerId);
|
||||
|
||||
protected:
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue