mirror of
https://github.com/wgh136/flutter_qjs.git
synced 2025-09-27 21:37:24 +00:00
windows wrapper
This commit is contained in:
@@ -174,8 +174,7 @@ Win32Window::MessageHandler(HWND hwnd,
|
||||
return 0;
|
||||
}
|
||||
case WM_SIZE:
|
||||
RECT rect;
|
||||
GetClientRect(hwnd, &rect);
|
||||
RECT rect = GetClientArea();
|
||||
if (child_content_ != nullptr) {
|
||||
// Size and position the child window.
|
||||
MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left,
|
||||
@@ -188,11 +187,6 @@ Win32Window::MessageHandler(HWND hwnd,
|
||||
SetFocus(child_content_);
|
||||
}
|
||||
return 0;
|
||||
|
||||
// Messages that are directly forwarded to embedding.
|
||||
case WM_FONTCHANGE:
|
||||
SendMessage(child_content_, WM_FONTCHANGE, NULL, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return DefWindowProc(window_handle_, message, wparam, lparam);
|
||||
@@ -218,8 +212,7 @@ Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept {
|
||||
void Win32Window::SetChildContent(HWND content) {
|
||||
child_content_ = content;
|
||||
SetParent(content, window_handle_);
|
||||
RECT frame;
|
||||
GetClientRect(window_handle_, &frame);
|
||||
RECT frame = GetClientArea();
|
||||
|
||||
MoveWindow(content, frame.left, frame.top, frame.right - frame.left,
|
||||
frame.bottom - frame.top, true);
|
||||
@@ -227,6 +220,12 @@ void Win32Window::SetChildContent(HWND content) {
|
||||
SetFocus(child_content_);
|
||||
}
|
||||
|
||||
RECT Win32Window::GetClientArea() {
|
||||
RECT frame;
|
||||
GetClientRect(window_handle_, &frame);
|
||||
return frame;
|
||||
}
|
||||
|
||||
HWND Win32Window::GetHandle() {
|
||||
return window_handle_;
|
||||
}
|
||||
|
Reference in New Issue
Block a user