mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
* [Game] Playmats Took 19 seconds Took 1 minute * [Playmats] Add fixed override and configurable fallbacks to settings. Took 29 minutes Took 43 seconds * Add main to test. Took 1 minute Took 29 seconds * Move settings to own group Took 11 minutes * Some attempts to refresh macOS compositor Took 2 minutes * Try something else Took 17 minutes * Don't manipulate live list Took 11 minutes * Change things about resolution, address comments. Took 45 minutes Took 12 minutes * Comments. Took 14 minutes Took 8 seconds * Re-order settings menu location Took 2 minutes * Rename PlaymatResolution to Info and add enums Took 8 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
/**
|
|
* @file game_view.h
|
|
* @ingroup GameGraphics
|
|
*/
|
|
//! \todo Document this file.
|
|
|
|
#ifndef GAMEVIEW_H
|
|
#define GAMEVIEW_H
|
|
|
|
#include "tally/tally.h"
|
|
|
|
#include <QGraphicsView>
|
|
|
|
class GameScene;
|
|
class QGridLayout;
|
|
class QLabel;
|
|
class QRubberBand;
|
|
|
|
class GameView : public QGraphicsView
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
QAction *aCloseMostRecentZoneView;
|
|
QRubberBand *rubberBand;
|
|
QLabel *dragCountLabel;
|
|
QLabel *totalCountLabel;
|
|
QWidget *tallyContainer;
|
|
QGridLayout *tallyLayout;
|
|
QPointF selectionOrigin;
|
|
QRect previousBandRect; ///< Last rubber-band rect for targeted repaint
|
|
QList<TallyRow> cachedTallyRows; ///< Cached entries to avoid redundant rebuilds
|
|
|
|
QSize rebuildTallyLabels(const QList<TallyRow> &entries);
|
|
void clearTallyLabels();
|
|
|
|
protected:
|
|
void resizeEvent(QResizeEvent *event) override;
|
|
private slots:
|
|
void startRubberBand(const QPointF &selectionOrigin);
|
|
void resizeRubberBand(const QPointF &cursorPoint, int selectedCount);
|
|
void stopRubberBand();
|
|
void refreshShortcuts();
|
|
void updateTotalSelectionCount(const QSize &viewSize = QSize());
|
|
void setFocusDisabled(bool disabled);
|
|
public slots:
|
|
void updateSceneRect(const QRectF &rect);
|
|
|
|
public:
|
|
explicit GameView(GameScene *scene, QWidget *parent = nullptr);
|
|
};
|
|
|
|
#endif
|