适配windows(测试)

This commit is contained in:
DelLevin-Home
2026-06-30 23:01:37 +08:00
parent 1192f8f7e0
commit afd012b766
9 changed files with 75 additions and 13 deletions

View File

@@ -38,3 +38,10 @@ target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
# Run the Flutter tool portions of the build. This must not be removed.
add_dependencies(${BINARY_NAME} flutter_assemble)
# Bundle sqlite3.dll for sqflite_common_ffi
add_custom_command(TARGET ${BINARY_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/sqlite3.dll"
"$<TARGET_FILE_DIR:${BINARY_NAME}>/sqlite3.dll"
)

View File

@@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
FlutterWindow window(project);
Win32Window::Point origin(10, 10);
Win32Window::Size size(1280, 720);
if (!window.Create(L"mooknote", origin, size)) {
if (!window.Create(L"MookNote", origin, size)) {
return EXIT_FAILURE;
}
window.SetQuitOnClose(true);

BIN
windows/runner/sqlite3.dll Normal file

Binary file not shown.

View File

@@ -197,6 +197,12 @@ Win32Window::MessageHandler(HWND hwnd,
return 0;
}
case WM_GETMINMAXINFO: {
auto info = reinterpret_cast<MINMAXINFO*>(lparam);
info->ptMinTrackSize.x = 360;
info->ptMinTrackSize.y = 640;
return 0;
}
case WM_SIZE: {
RECT rect = GetClientArea();
if (child_content_ != nullptr) {