#include "tccMainWindow.h"
#include "tccToolBox.h"
#include <QDockWidget>
#include <QMdiArea>

TccMainWindow::TccMainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    initializeUI();
}

TccMainWindow::~TccMainWindow()
{
}

void TccMainWindow::initializeUI()
{
    //toolBox by dock
    m_pDockToolBox = new QDockWidget(QString::fromWCharArray(L"资源管理"));
    m_pDockToolBox->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
    m_pDockToolBox->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
    QString strStyleSheet = "QDockWidget{\n"
                            "   color:rgb(250,250,250);\n"
                            "   font:9pt;\n"
                            "}\n"
                            "QDockWidget::title{\n"
                            "   padding:5px;\n"
                            "   background-color:rgb(0, 122, 204);\n"
                            "}\n";
    m_pDockToolBox->setStyleSheet(strStyleSheet);
    m_pToolBox = new TccToolBox(this);
    m_pDockToolBox->setWidget(m_pToolBox);
    //mdiArea
    m_pMdiArea = new QMdiArea(this);
    QBrush brush(QColor(40, 44, 52, 230));
    brush.setStyle(Qt::SolidPattern);
    m_pMdiArea->setBackground(brush);

    this->setCentralWidget(m_pMdiArea);
    this->addDockWidget(Qt::LeftDockWidgetArea, m_pDockToolBox);
    this->setStyleSheet("QMainWindow::separator{\n"
                        "   width:2px;\n"
                        "   background-color:rgb(4, 4, 4);\n"
                        "}");
}
