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