[fix] fix Windows privacy cover build and adjust branding spacing

This commit is contained in:
kunkundi
2026-10-28 11:35:49 +08:00
parent af49d5ba28
commit d989df275b
2 changed files with 3 additions and 3 deletions
@@ -123,7 +123,7 @@ void DrawUnlockInstructions(NSString* value, NSSize size, CGFloat scale,
// AppKit coordinates are points; Retina backing scale is applied by AppKit.
const CGFloat scale = std::min({CGFloat(1), width / 960, height / 280});
const CGFloat margin = 32 * scale, brand_gap = 8 * scale;
NSAttributedString* brand = Text(@"CrossDesk远程控制中", 29 * scale,
NSAttributedString* brand = Text(@" CrossDesk 远程控制中", 29 * scale,
NSFontWeightSemibold, NSColor.whiteColor);
const CGFloat logo_size = 60 * scale;
const CGFloat brand_text_width = std::ceil(brand.size.width);
@@ -69,7 +69,7 @@ bool DrawPrivacyCover(HDC dc, const RECT& rect, UINT dpi, HINSTANCE module,
std::array<Line, kInstructionLines + 1> lines{{
{unlock_hint, 17, FW_NORMAL, RGB(166, 174, 186)},
{L"+", 16, FW_SEMIBOLD, RGB(229, 233, 240)},
{L"CrossDesk远程控制中", 29, FW_SEMIBOLD, RGB(255, 255, 255)},
{L" CrossDesk 远程控制中", 29, FW_SEMIBOLD, RGB(255, 255, 255)},
}};
constexpr UINT flags = DT_CENTER | DT_WORDBREAK | DT_NOPREFIX;
constexpr UINT brand_flags = DT_LEFT | DT_SINGLELINE | DT_NOPREFIX;
@@ -132,7 +132,7 @@ bool DrawPrivacyCover(HDC dc, const RECT& rect, UINT dpi, HINSTANCE module,
}
const int content_height = static_cast<int>(lines[0].bounds.bottom) + line_gap + key_height;
// Center the instructions independently of the footer, leaving room on short displays.
const int top = (std::min)(rect.top + (height - content_height) / 2,
const int top = (std::min)(static_cast<int>(rect.top) + (height - content_height) / 2,
brand_bottom - brand_height - px(32) - content_height);
if (top < rect.top + margin || (std::max)(row_width, text_width) + 2 * margin > width)
return false;