From bbe2baffa02fb4178ef7ecb156a35710ab948a77 Mon Sep 17 00:00:00 2001 From: fanlumaster <1730976608@qq.com> Date: Wed, 5 Nov 2025 12:38:53 +0800 Subject: [PATCH] [ui]: set settings window to apply mica materia --- server/html/webview2/settings/style.css | 5 +++-- server/src/window/ime_windows.cpp | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/server/html/webview2/settings/style.css b/server/html/webview2/settings/style.css index 088dcb1a..cdea422f 100644 --- a/server/html/webview2/settings/style.css +++ b/server/html/webview2/settings/style.css @@ -6,7 +6,7 @@ --item-active-hover: rgba(255, 255, 255, 0.06); --text-color: #f3f3f3; --border-color: rgba(255, 255, 255, 0.08); - --card-bg: rgba(38, 38, 38, 0.8); + --card-bg: rgba(38, 38, 38, 0.5); --titlebar-height: 32px; } @@ -24,7 +24,8 @@ body { width: 100vw; color: var(--text-color); /* background: var(--bg-color); */ - background: #202020; + /* background: #202020; */ + background: transparent; /* backdrop-filter: blur(20px) saturate(160%); */ -webkit-backdrop-filter: blur(20px) saturate(160%); /* overflow: hidden; */ diff --git a/server/src/window/ime_windows.cpp b/server/src/window/ime_windows.cpp index 1c8da557..d2970e25 100644 --- a/server/src/window/ime_windows.cpp +++ b/server/src/window/ime_windows.cpp @@ -194,6 +194,11 @@ int CreateCandidateWindow(HINSTANCE hInstance) ::global_hwnd_settings = hwnd_settings; BOOL cloak = TRUE; DwmSetWindowAttribute(hwnd_settings, DWMWA_CLOAK, &cloak, sizeof(cloak)); + /* 设置标题栏和窗口区域为 mica 材质 */ + MARGINS margins = {-1}; + DwmExtendFrameIntoClientArea(hwnd_settings, &margins); + DWM_SYSTEMBACKDROP_TYPE backdrop = DWMSBT_MAINWINDOW; // Mica 背景类型 + DwmSetWindowAttribute(hwnd_settings, DWMWA_SYSTEMBACKDROP_TYPE, &backdrop, sizeof(backdrop)); // // floating toolbar 窗口