移动端界面大小设置:默认 600 逻辑高,系统选项可选 600/700/800
Android 上 40250 界面原先固定按 800 逻辑像素高排版,弹窗文字在手机上只有约 1 mm 高。 - UIScaleMode.h + host ui_scale.cpp:逻辑高度来自保存的设置(默认 600),ui_height.cfg 保存,下次启动生效; 桌面可用 MT_UI_HEIGHT 测试 - app.GetUIHeight/GetAppliedUIHeight/SetUIHeight - mt_uiscale PORT 模块:系统选项对话框加高一行,"界面大小 大/中/小",修改后聊天提示重启生效 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e33e41c12b
commit
71d8f8c6e7
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "input_keymap.h"
|
||||
#include "texture_decode.h"
|
||||
#include "ui_scale.h"
|
||||
|
||||
#ifdef MT_NATIVE_HAS_LIVE_CLIENT
|
||||
#include "platform/ScriptLib/PythonBoot.h"
|
||||
@@ -141,20 +142,17 @@ void VulkanWindow::request_screenshot(std::string path, std::uint64_t frame) {
|
||||
std::uint32_t VulkanWindow::logical_width() const {
|
||||
int w = 0, h = 0;
|
||||
if (window_) SDL_GetWindowSize(window_, &w, &h);
|
||||
#ifdef __ANDROID__
|
||||
// Keep the 40250 UI at the same height as the macOS 1280x800 window,
|
||||
// while retaining the device aspect ratio on wider phone displays.
|
||||
if (w > 0 && h > 0) return std::max(1, int(std::lround(double(w) * 800.0 / h)));
|
||||
#endif
|
||||
// The UI size setting (ui_scale.h; always on Android, MT_UI_HEIGHT on the desktop) fixes the logical
|
||||
// height and keeps the device aspect ratio on wider phone displays.
|
||||
if (const int ui_h = mt_host::ui_height(); ui_h > 0 && w > 0 && h > 0)
|
||||
return std::max(1, int(std::lround(double(w) * ui_h / h)));
|
||||
return w > 0 ? static_cast<std::uint32_t>(w) : extent_.width;
|
||||
}
|
||||
|
||||
std::uint32_t VulkanWindow::logical_height() const {
|
||||
int w = 0, h = 0;
|
||||
if (window_) SDL_GetWindowSize(window_, &w, &h);
|
||||
#ifdef __ANDROID__
|
||||
if (w > 0 && h > 0) return 800;
|
||||
#endif
|
||||
if (const int ui_h = mt_host::ui_height(); ui_h > 0 && w > 0 && h > 0) return std::uint32_t(ui_h);
|
||||
return h > 0 ? static_cast<std::uint32_t>(h) : extent_.height;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user