Make Minimize window work.

This commit is contained in:
balloonflower 2018-03-19 09:05:24 +08:00
parent e8d05da023
commit 4e95744fd9
5 changed files with 11 additions and 4 deletions

1
debian/changelog vendored
View File

@ -24,5 +24,6 @@ kylin-assistant (1.0.0-0ubuntu1) bionic; urgency=low
* Rewrite theme ui module.
* Scaning system with Thread.
* Renice process priority.
* Make Minimize window work.
-- lixiang <lixiang@kylinos.cn> Mon, 29 Jan 2018 17:54:44 +0800

View File

@ -45,7 +45,7 @@ InfoGui::InfoGui(QWidget *parent)
m_scrollArea = new QScrollArea;
m_scrollArea->setWidgetResizable(true);
m_scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_scrollArea->setStyleSheet("QScrollArea{border: none;background-color: #ffffff;}");
// m_scrollArea->setStyleSheet("QScrollArea{border: none;background-color: #ffffff;}");
m_vLayout->setSpacing(10);
m_vLayout->setMargin(0);

View File

@ -62,10 +62,12 @@ StartupWidget::StartupWidget(QWidget *parent)
qRegisterMetaType<StartupDataPtrList>();
qRegisterMetaType<QList<StartupData>>();
//kobe:如果不加Qt::WindowMinimizeButtonHint则调用setFixedSize()之后,调用窗口最小化函数将会没有效果
this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint);
// this->setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint);//Attention: Qt::WindowCloseButtonHint make showMinimized() valid
this->setAutoFillBackground(true);
this->setMouseTracking(true);
this->setWindowFlags(/*this->windowFlags() | */Qt::FramelessWindowHint | Qt::WindowCloseButtonHint);//去掉边框
// this->setWindowFlags(/*this->windowFlags() | */Qt::FramelessWindowHint | Qt::WindowCloseButtonHint);//去掉边框
// this->setAttribute(Qt::WA_TranslucentBackground);//背景透明
// this->setAutoFillBackground(true);
// this->setMouseTracking(true);

View File

@ -40,7 +40,9 @@ SystemMonitor::SystemMonitor(QWidget *parent)
// this->setWindowFlags(this->windowFlags() | Qt::FramelessWindowHint | Qt::WindowCloseButtonHint);//去掉边框
// this->setAttribute(Qt::WA_TranslucentBackground);//背景透明
this->setWindowFlags(Qt::FramelessWindowHint);
//kobe:如果不加Qt::WindowMinimizeButtonHint则调用setFixedSize()之后,调用窗口最小化函数将会没有效果
this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint);
// this->setWindowFlags(Qt::FramelessWindowHint);
// this->setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint);//Attention: Qt::WindowCloseButtonHint make showMinimized() valid
this->setAutoFillBackground(true);

View File

@ -71,8 +71,10 @@ MainWindow::MainWindow(QString cur_arch, int d_count, QWidget* parent/*, Qt::Win
//For Unity
// this->setWindowFlags(/*Qt::Window | */Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint);//Attention: Qt::WindowCloseButtonHint make showMinimized() valid
//kobe:如果不加Qt::WindowMinimizeButtonHint则调用setFixedSize()之后,调用窗口最小化函数将会没有效果
this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint);
//For UKUI and Mate
this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowCloseButtonHint);
// this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowCloseButtonHint);
this->setAttribute(Qt::WA_TranslucentBackground);
this->setAutoFillBackground(true);
this->setMouseTracking(true);