#include "logwidget.h"
#include "ctextedit.h"

#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>

LogWidget::LogWidget(QWidget *parent)
    : FancyWindow(parent)
{
    mCentralWidget = new QWidget;

    mMainVLayout = new QVBoxLayout;

    mLogTextEdit = new CTextEdit;
    mLogTextEdit->setObjectName("LogWidgetLogTextEdit");
    QString logStr = "001 2023/03/21 10:53:31.478 玉兰花正在盛开，他静静的伫立在风中，煞是惹眼。\n"
                     "002 2023/03/21 10:53:45.142 寒意未尽，暖意刚起，此时的玉兰开得优雅而大方，绚烂而惊艳。\n"
                     "003 2023/03/21 10:53:49.342 那白色的花朵开满枝头，没有叶子，那整个树头变成了一个白色的花团，那一个个怒放的花朵就像一个个张开翅膀的蝴蝶，形态各异，随时似乎要展翅高飞......\n"
                     "004 2023/03/21 10:53:52.254 经过了一年的蛰伏，从养精蓄锐，到含苞待放，再到今天的彻底盛开，玉兰花用尽自己的全力装点这初春里还稍显荒芜的世界。\n"
                     "005 2023/03/21 10:53:56.531 玉兰花静静的伫立在那里，仿佛在用一场花事叙说着自己与春天的故事。\n";


    mLogTextEdit->append(logStr);
    mMainVLayout->addWidget(mLogTextEdit);

//    mButtonHLayout = new QHBoxLayout;
//    mSubmitButton = new QPushButton;
//    mSubmitButton->setText("确定");
//    mSubmitButton->setFixedSize(80, 40);
//    mSubmitButton->setObjectName("LogWidgetSubmitButton");
//    mCancelButton = new QPushButton;
//    mCancelButton->setText("取消");
//    mCancelButton->setFixedSize(80, 40);
//    mCancelButton->setObjectName("LogWidgetCancelButton");
//    mButtonHLayout->addStretch();
//    mButtonHLayout->addWidget(mSubmitButton);
//    mButtonHLayout->addWidget(mCancelButton);
//    mMainVLayout->addLayout(mButtonHLayout);

    mCentralWidget->setLayout(mMainVLayout);
    this->setCentralWidget(mCentralWidget);
    this->setObjectName("LogWidget");

//    connect(mSubmitButton, &QPushButton::clicked, this, &LogWidget::hide);
//    connect(mCancelButton, &QPushButton::clicked, this, &LogWidget::hide);
}

LogWidget::~LogWidget()
{

}
