implement ui
This commit is contained in:
35
src/ui/HeaderBar.h
Normal file
35
src/ui/HeaderBar.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "Tick.h"
|
||||
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
|
||||
class HeaderBar : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit HeaderBar(QWidget* parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void onStateUpdated(Tick tick, int buildingBlocks, double gameSpeed);
|
||||
|
||||
signals:
|
||||
void speedChanged(double multiplier);
|
||||
|
||||
private slots:
|
||||
void onSpeedButton(int index);
|
||||
|
||||
private:
|
||||
QLabel* m_timeLabel;
|
||||
QLabel* m_blocksLabel;
|
||||
std::vector<QPushButton*> m_speedButtons;
|
||||
|
||||
static const double kSpeeds[];
|
||||
static const int kSpeedCount;
|
||||
};
|
||||
Reference in New Issue
Block a user