优化窗口属性设置逻辑
This commit is contained in:
parent
da6611ca65
commit
07410beab5
|
@ -395,7 +395,7 @@ void MenuWindow::init()
|
|||
setColor("transparent");
|
||||
|
||||
// setFlags(Qt::FramelessWindowHint);
|
||||
setFlag(Qt::WindowStaysOnTopHint);
|
||||
setFlags(Qt::Window | Qt::WindowStaysOnTopHint);
|
||||
WindowHelper::setWindowAttribute(this);
|
||||
WindowHelper::removeHeaderBar(this);
|
||||
WindowHelper::windowBlur(this, true);
|
||||
|
@ -429,6 +429,12 @@ void MenuWindow::updateGeometry()
|
|||
return;
|
||||
}
|
||||
|
||||
if (m_isFullScreen) {
|
||||
setMaximumSize(rect.size());
|
||||
} else {
|
||||
setMinimumSize(rect.size());
|
||||
}
|
||||
|
||||
WindowHelper::setWindowGeometry(this, rect);
|
||||
setMinimumSize(geometry().size());
|
||||
setMaximumSize(geometry().size());
|
||||
|
@ -486,7 +492,13 @@ void MenuWindow::enableWindowBlur(bool enable)
|
|||
void MenuWindow::exposeEvent(QExposeEvent *event)
|
||||
{
|
||||
if (isExposed()) {
|
||||
if (QX11Info::isPlatformX11()) {
|
||||
requestActivate();
|
||||
} else {
|
||||
WindowHelper::setWindowAttribute(this);
|
||||
// WindowHelper::removeHeaderBar(this);
|
||||
updateGeometry();
|
||||
}
|
||||
}
|
||||
QQuickView::exposeEvent(event);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue