/*
 * Copyright (C) 2022, KylinSoft Co., Ltd.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * Authors: Xin Li <lixin@kylinos.cn>
 */
#include "tipwindow.h"
#include "mainwindow.h"
#include <kysdk/applications/ukuistylehelper/ukuistylehelper.h>
TipWindow::TipWindow(QWidget *parent) : QDialog(parent)
{
    int WIDTH = 300;
    int HEIGHT = 50;
    //    mainWid = new QWidget();
    tipLabel = new QLabel(this);
    hLayout = new QHBoxLayout(this);
    this->setFixedSize(WIDTH, HEIGHT);
    setTipWindow();
}

void TipWindow::setTipWindow()
{
    tipLabel->setText(tr("Analysis..."));
    tipLabel->setFixedSize(150, 30);
    this->setWindowFlag(Qt::Tool); //此代码必须在此窗管协议前，否则此模态窗口背景不变灰
    hLayout->addWidget(tipLabel);
    this->setLayout(hLayout);
    // 添加窗管协议
    kdk::UkuiStyleHelper::self()->removeHeader(this);
    this->setAttribute(Qt::WA_ShowModal, true);
}
