mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-28 08:04:13 +08:00
issues/776
This commit is contained in:
parent
e872c05d5c
commit
d271e69e21
@ -152,16 +152,16 @@ DECLARE void _SetTheme(
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// https://learn.microsoft.com/zh-cn/windows/win32/api/dwmapi/ne-dwmapi-dwm_systembackdrop_type
|
||||
// 设置背景
|
||||
static const DWM_SYSTEMBACKDROP_TYPE BACKDROP_MAP[] = {
|
||||
DWMSBT_AUTO, DWMSBT_TRANSIENTWINDOW, DWMSBT_MAINWINDOW, DWMSBT_TABBEDWINDOW};
|
||||
DWM_SYSTEMBACKDROP_TYPE value = BACKDROP_MAP[(int)backdrop];
|
||||
|
||||
// 非常诡异,这里mar,BACKDROP_MAP,value的声明顺序会导致在win7-32位上崩溃,原因未知。
|
||||
MARGINS mar{-1, -1, -1, -1};
|
||||
// 这个最重要,不可以跳过,否则transaprent会黑。win7无效,仍然是黑的,所以win7不可以使用QTWIN11主题。
|
||||
DwmExtendFrameIntoClientArea(_hWnd, &mar);
|
||||
|
||||
// https://learn.microsoft.com/zh-cn/windows/win32/api/dwmapi/ne-dwmapi-dwm_systembackdrop_type
|
||||
// 设置背景
|
||||
static const DWM_SYSTEMBACKDROP_TYPE BACKDROP_MAP[] = {
|
||||
DWMSBT_AUTO, DWMSBT_TRANSIENTWINDOW, DWMSBT_MAINWINDOW, DWMSBT_TABBEDWINDOW};
|
||||
DWM_SYSTEMBACKDROP_TYPE value = BACKDROP_MAP[backdrop];
|
||||
// 不管操作系统版本了,硬设置就行,测试不会崩溃,让系统自己处理。
|
||||
DwmSetWindowAttribute(_hWnd, DWMWA_SYSTEMBACKDROP_TYPE, &value, sizeof(value));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user