Avoid additional calculations in WindowHelper::updateMargins
This commit is contained in:
parent
92cb6f6809
commit
e66ad9c80c
1 changed files with 2 additions and 10 deletions
|
|
@ -851,19 +851,11 @@ void WindowHelper::updateMargins() {
|
||||||
_updatingMargins = true;
|
_updatingMargins = true;
|
||||||
const auto guard = gsl::finally([&] { _updatingMargins = false; });
|
const auto guard = gsl::finally([&] { _updatingMargins = false; });
|
||||||
|
|
||||||
RECT r, a;
|
RECT r{};
|
||||||
|
|
||||||
GetClientRect(_handle, &r);
|
|
||||||
a = r;
|
|
||||||
|
|
||||||
const auto style = GetWindowLongPtr(_handle, GWL_STYLE);
|
const auto style = GetWindowLongPtr(_handle, GWL_STYLE);
|
||||||
const auto styleEx = GetWindowLongPtr(_handle, GWL_EXSTYLE);
|
const auto styleEx = GetWindowLongPtr(_handle, GWL_EXSTYLE);
|
||||||
AdjustWindowRectEx(&a, style, false, styleEx);
|
AdjustWindowRectEx(&a, style, false, styleEx);
|
||||||
auto margins = QMargins(
|
auto margins = QMargins(r.left, r.top, -r.right, -r.bottom);
|
||||||
a.left - r.left,
|
|
||||||
a.top - r.top,
|
|
||||||
r.right - a.right,
|
|
||||||
r.bottom - a.bottom);
|
|
||||||
if (style & WS_MAXIMIZE) {
|
if (style & WS_MAXIMIZE) {
|
||||||
RECT w, m;
|
RECT w, m;
|
||||||
GetWindowRect(_handle , &w);
|
GetWindowRect(_handle , &w);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue