#include "infodisplaywidget.h"
#include "iconhelper.h"
#include "entityproperty.h"

#include <QIcon>
#include <QPixmap>
#include <QVBoxLayout>

InfoDisplayWidget::InfoDisplayWidget(QWidget *parent)
    :QTabWidget(parent)
{
    initUI();
}

EntityProperty *InfoDisplayWidget::getEntityPropertyWidget()
{
    return mPropertyWidget;
}

void InfoDisplayWidget::initUI()
{
    mTaskWidget = new QWidget;
    {
        QVBoxLayout* vLayout = new QVBoxLayout;
        QLabel* labelTitle = new QLabel;
        labelTitle->setStyleSheet("font: bold 18px;");
        labelTitle->setText("制定任务");
        QFrame* hLine = new QFrame;
        hLine->setFrameShape(QFrame::HLine);
        QLabel* label1 = new QLabel("XXX编队前往XXXX地点进行海洋勘测        任务1");
        QLabel* label2 = new QLabel("XXX编队前往XXXX地点进行海洋搜索        任务2");
        QLabel* label3 = new QLabel("XXX编队前往XXXX地点进行海洋侦察        任务3");
        QLabel* label4 = new QLabel("XXX编队前往XXXX地点进行海洋探测        任务4");
        QLabel* label5 = new QLabel("XXX编队前往XXXX地点进行海洋打击        任务5");
        QLabel* label6 = new QLabel("XXX编队前往XXXX地点进行海洋打击        任务6");
        vLayout->addWidget(labelTitle);
        vLayout->addWidget(hLine);
        vLayout->addWidget(label1);
        vLayout->addWidget(label2);
        vLayout->addWidget(label3);
        vLayout->addWidget(label4);
        vLayout->addWidget(label5);
        vLayout->addWidget(label6);
        vLayout->addStretch();
        mTaskWidget->setLayout(vLayout);
    }

    mPlanWidget = new QWidget;
    mQuotaWidget = new QWidget;
    mPropertyWidget = new EntityProperty;

    QPixmap pix;
    pix = IconHelper::Instance()->getPixmap("#1de9b6", 0xf2b9, 30, 35, 35);
    this->addTab(mPropertyWidget, QIcon(pix),"属性");
    pix = IconHelper::Instance()->getPixmap("#1de9b6", 0xf160, 30, 35, 35);
    this->addTab(mTaskWidget, QIcon(pix), "任务");
    pix = IconHelper::Instance()->getPixmap("#1de9b6", 0xf1b3, 30, 35, 35);
    this->addTab(mPlanWidget, QIcon(pix),"计划");
    pix = IconHelper::Instance()->getPixmap("#1de9b6", 0xf2bc, 30, 35, 35);
    this->addTab(mQuotaWidget, QIcon(pix),"指标");

}
