#include "framelesswindow.h"
#include "titlebar.h"
#include "mainwindow.h"
#include "global.h"

FramelessWindow::FramelessWindow(QWidget *parent, Qt::WindowFlags flags)
    :QMainWindow(parent, flags)
{
    initUI();
    connects();
}

FramelessWindow::~FramelessWindow()
{
}

void FramelessWindow::initUI()
{
    initFrameless();

    mMainWindow = new MainWindow;

    this->setCentralWidget(mMainWindow);
    this->setWindowTitle(appName() + " " + appVersion());
    this->setWindowIcon(QIcon(":/images/logo.png"));
    //this->showMaximized();
}

void FramelessWindow::initFrameless()
{
    mTitleBar = new TitleBar(this);
    mTitleBar->updateWidgetFlags();
    mTitleBar->setFixedHeight(55);
    mTitleBar->setLogoButtonSize(50, 50);
    mTitleBar->setTitleFontSizeAndColor(30, "#ffffff", true);
}



void FramelessWindow::connects()
{
//    connect(mTitleBar->menuButton, &QPushButton::clicked, mMainWindow, &MainWindow::setMenuVisiable);
//    connect(mMainWindow, &MainWindow::signalQuit, this, [=](){
//        this->close();
//    });
}

