feat(ui): 重做启动器界面并修复 DPI 发糊
- 交叉编译补嵌 runner.exe.manifest:GNUn res 不再丢掉 DPI 声明,缩放屏不再位图拉伸 - main.cpp 建窗前自行声明 Per-Monitor V2 DPI 感知(三级回退) - win32_window 初始窗口按显示器工作区上限收缩,避免 150% 缩放后超出屏幕 - 重做主题:中性石墨底 + 高对比正文、统一字号/间距/圆角令牌、Segoe UI + 雅黑字体栈 - 首页/下载/设置/关于四页重排,宽屏自适应、小窗不溢出 - 修复下拉框字体丢失、封面遮罩盖住占位、任务状态未翻译等问题 - 截图脚本:注入 CJK/图标字体、runAsync 取像素、补小窗回归用例
This commit is contained in:
1 parent
6ee2e8bead
commit
e67cc63998
10 files changed
+2518
-1080
No files matched your search
@@ -134,11 +134,27 @@ bool Win32Window::Create(const std::wstring& title,
|
||||
UINT dpi = FlutterDesktopGetDpiForMonitor(monitor);
|
||||
double scale_factor = dpi / 96.0;
|
||||
|
||||
// Cap the initial size to the monitor work area. 1280x720 logical is
|
||||
// 1920x1080 physical at 150% scaling, which no longer fits on a 1080p
|
||||
// screen; clamping keeps the window usable instead of hanging off-screen.
|
||||
int physical_width = Scale(size.width, scale_factor);
|
||||
int physical_height = Scale(size.height, scale_factor);
|
||||
MONITORINFO monitor_info{};
|
||||
monitor_info.cbSize = sizeof(MONITORINFO);
|
||||
if (::GetMonitorInfoW(monitor, &monitor_info)) {
|
||||
const int max_width =
|
||||
(monitor_info.rcWork.right - monitor_info.rcWork.left) * 92 / 100;
|
||||
const int max_height =
|
||||
(monitor_info.rcWork.bottom - monitor_info.rcWork.top) * 92 / 100;
|
||||
if (physical_width > max_width) physical_width = max_width;
|
||||
if (physical_height > max_height) physical_height = max_height;
|
||||
}
|
||||
|
||||
HWND window = CreateWindow(
|
||||
window_class, title.c_str(), WS_OVERLAPPEDWINDOW,
|
||||
Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),
|
||||
Scale(size.width, scale_factor), Scale(size.height, scale_factor),
|
||||
nullptr, nullptr, GetModuleHandle(nullptr), this);
|
||||
physical_width, physical_height, nullptr, nullptr,
|
||||
GetModuleHandle(nullptr), this);
|
||||
|
||||
if (!window) {
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user