mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-02-02 11:17:39 +08:00
fix bug #455
This commit is contained in:
parent
b3e26d17a2
commit
db89d2485c
@ -327,19 +327,8 @@ void FluFramelessHelper::componentComplete(){
|
|||||||
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME);
|
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME);
|
||||||
}
|
}
|
||||||
LONG exstyle = ::GetWindowLong(hwnd, GWL_EXSTYLE);
|
LONG exstyle = ::GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||||
exstyle = exstyle | WS_EX_LAYERED;
|
exstyle = exstyle | 0x02000000;
|
||||||
::SetWindowLongPtr(hwnd, GWL_EXSTYLE, exstyle);
|
::SetWindowLongPtr(hwnd, GWL_EXSTYLE, exstyle);
|
||||||
::SetLayeredWindowAttributes(hwnd, RGB(251, 255, 242), 0, LWA_COLORKEY);
|
|
||||||
connect(window,&QQuickWindow::activeChanged,this,[this,hwnd]{
|
|
||||||
if(this->window->isActive()){
|
|
||||||
LONG exstyle = ::GetWindowLong(hwnd, GWL_EXSTYLE);
|
|
||||||
if(exstyle & WS_EX_LAYERED){
|
|
||||||
exstyle = exstyle &~ WS_EX_LAYERED;
|
|
||||||
::SetWindowLongPtr(hwnd, GWL_EXSTYLE, exstyle);
|
|
||||||
::SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
#else
|
#else
|
||||||
window->setFlags((window->flags() & (~Qt::WindowMinMaxButtonsHint) & (~Qt::Dialog)) | Qt::FramelessWindowHint | Qt::Window);
|
window->setFlags((window->flags() & (~Qt::WindowMinMaxButtonsHint) & (~Qt::Dialog)) | Qt::FramelessWindowHint | Qt::Window);
|
||||||
window->installEventFilter(this);
|
window->installEventFilter(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user