#include "funcbuttonwidget.h"
#include "iconhelper.h"

#include <QVBoxLayout>
#include <QToolButton>

FuncButtonWidget::FuncButtonWidget(QWidget *parent)
    : QWidget(parent)
{
    QColor normalTextColor = QColor("#FFFFFF");
    QColor hoverTextColor = QColor("#FFFFFF");
    QColor checkTextColor = QColor("#FFFFFF");

    int pixSize = 30;
    int imgWidth = 40, imgHeight = 40;

    QPixmap start = IconHelper::Instance()->getPixmap(normalTextColor.name(), 0xf01d, pixSize, imgWidth, imgHeight);
    QPixmap stop = IconHelper::Instance()->getPixmap(normalTextColor.name(), 0xf011, pixSize, imgWidth, imgHeight);
    QPixmap reset = IconHelper::Instance()->getPixmap(normalTextColor.name(), 0xf01e, pixSize, imgWidth, imgHeight);


    mButtonVLayout = new QVBoxLayout;
    mSetupButton = new QToolButton;
    mSetupButton->setIcon(QIcon(start));
    mSetupButton->setIconSize(QSize(50, 50));
    mSetupButton->setObjectName("SidePanelSetupButton");
    mSetupButton->setText("启动");
    mSetupButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    mPauseButton = new QToolButton;
    mPauseButton->setIcon(QIcon(stop));
    mPauseButton->setIconSize(QSize(50, 50));
    mPauseButton->setObjectName("SidePanelPauseButton");
    mPauseButton->setText("暂停");
    mPauseButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    mWaitButton = new QToolButton;
    mWaitButton->setIcon(QIcon(reset));
    mWaitButton->setIconSize(QSize(50, 50));
    mWaitButton->setObjectName("SidePanelWaitButton");
    mWaitButton->setText("等待");
    mWaitButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    mButtonVLayout->setAlignment(Qt::AlignCenter);
    mButtonVLayout->addWidget(mSetupButton);
    mButtonVLayout->addWidget(mPauseButton);
    mButtonVLayout->addWidget(mWaitButton);
    this->setLayout(mButtonVLayout);
}

FuncButtonWidget::~FuncButtonWidget()
{

}
