fix(src/windows): 添加监听屏幕尺寸变化
This commit is contained in:
parent
e6eba046fb
commit
657ea87cfa
|
@ -78,7 +78,7 @@ void WindowHelper::setRegion(QWindow *window, qreal x, qreal y, qreal w, qreal h
|
|||
WindowGeometryHelper::WindowGeometryHelper(QObject *parent) : QObject(parent)
|
||||
{
|
||||
initPanelSetting();
|
||||
initScreenMonitor();
|
||||
// initScreenMonitor();
|
||||
updateGeometry();
|
||||
|
||||
connect(MenuSetting::instance(), &MenuSetting::changed, this, [this] (const QString& key) {
|
||||
|
@ -483,9 +483,15 @@ void MenuWindow::activeMenuWindow(bool active)
|
|||
}
|
||||
|
||||
if (active) {
|
||||
if (screen() != UkuiQuick::WindowProxy::currentScreen()) {
|
||||
if (screen()) {
|
||||
screen()->disconnect(this);
|
||||
}
|
||||
this->setScreen(UkuiQuick::WindowProxy::currentScreen());
|
||||
connect(screen(), &QScreen::geometryChanged, this, &MenuWindow::updateGeometry);
|
||||
updateGeometry();
|
||||
}
|
||||
}
|
||||
|
||||
setVisible(active);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue