forked from github_mirror/framelesshelper
FIX frame in QMainWindow (#58)
Co-authored-by: Julien Maille <julien.maille@data-pixel.com>
This commit is contained in:
parent
987a8397dc
commit
938756a757
|
@ -85,6 +85,7 @@ void MainWindow::showEvent(QShowEvent *event)
|
||||||
FramelessWindowsManager::setHitTestVisibleInChrome(win, titleBarWidget->closeButton, true);
|
FramelessWindowsManager::setHitTestVisibleInChrome(win, titleBarWidget->closeButton, true);
|
||||||
FramelessWindowsManager::setHitTestVisibleInChrome(win, appMainWindow->menubar, true);
|
FramelessWindowsManager::setHitTestVisibleInChrome(win, appMainWindow->menubar, true);
|
||||||
inited = true;
|
inited = true;
|
||||||
|
setContentsMargins(1, 1, 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,9 +96,9 @@ void MainWindow::changeEvent(QEvent *event)
|
||||||
bool shouldUpdate = false;
|
bool shouldUpdate = false;
|
||||||
if (event->type() == QEvent::WindowStateChange) {
|
if (event->type() == QEvent::WindowStateChange) {
|
||||||
if (isMaximized() || isFullScreen()) {
|
if (isMaximized() || isFullScreen()) {
|
||||||
layout()->setContentsMargins(0, 0, 0, 0);
|
setContentsMargins(0, 0, 0, 0);
|
||||||
} else if (!isMinimized()) {
|
} else if (!isMinimized()) {
|
||||||
layout()->setContentsMargins(1, 1, 1, 1);
|
setContentsMargins(1, 1, 1, 1);
|
||||||
}
|
}
|
||||||
shouldUpdate = true;
|
shouldUpdate = true;
|
||||||
Q_EMIT windowStateChanged();
|
Q_EMIT windowStateChanged();
|
||||||
|
|
Loading…
Reference in New Issue