🔧 fix(appearance): 修复100%%不透明仍透明并隔离Dev图标缓存

This commit is contained in:
Syngnat
2026-02-06 14:33:15 +08:00
parent c2c88d743b
commit 0cb9cb8bc9
2 changed files with 5 additions and 1 deletions

View File

@@ -8,7 +8,7 @@
<key>CFBundleExecutable</key>
<string>{{.OutputFilename}}</string>
<key>CFBundleIdentifier</key>
<string>com.wails.{{.Name}}</string>
<string>com.wails.{{.Name}}.dev</string>
<key>CFBundleVersion</key>
<string>{{.Info.ProductVersion}}</string>
<key>CFBundleGetInfoString</key>

View File

@@ -40,6 +40,10 @@ const getPlatformFactors = () => {
export const normalizeOpacityForPlatform = (opacity: number | undefined): number => {
const raw = clamp(opacity ?? DEFAULT_OPACITY, MIN_OPACITY, MAX_OPACITY);
// 用户显式拉到 100%% 时,必须保持完全不透明,不能再被平台映射压低。
if (raw >= MAX_OPACITY - 1e-6) {
return MAX_OPACITY;
}
const factors = getPlatformFactors();
if (!factors) {
return raw;