B08002 - win32gui: message window sizing (from <Someone>)
>>> - When I set font and font size of the message window, the >>> message window size doesn't calculate correctly to show the >>> number of message lines specified. For example, I set the font >>> size to 6, and the number of messages to display to 8. Now >>> there is whitespace at the top of my message window. When I >>> set the font size to 14 now, I see only 5.5 message lines. >>> This is unintuitive: the interface should recalculate the >>> window size needed to display the correct number of lines. >>> >> I agree, especially since the message window size is >> recalculated correctly if you save and restore. An easy way out >> would be to set those options to DISP_IN_GAME. > > That seems like a good work-around until the proper fix is done. The patch is attached. I moved the code that was computing the font size to mswin_message_window_size(). This will cause the message window to resize properly if the message font size changes. There are also 2 minor bits in mswproc.c to invalidate the message window when the font changes.
This commit is contained in:
@@ -1782,6 +1782,7 @@ void mswin_preference_update(const char *pref)
|
||||
mswin_get_font(NHW_STATUS, ATR_INVERSE, hdc, TRUE);
|
||||
ReleaseDC(GetNHApp()->hMainWnd, hdc);
|
||||
|
||||
InvalidateRect(mswin_hwnd_from_winid(WIN_STATUS), NULL, TRUE);
|
||||
mswin_layout_main_window(NULL);
|
||||
return;
|
||||
}
|
||||
@@ -1802,6 +1803,7 @@ void mswin_preference_update(const char *pref)
|
||||
mswin_get_font(NHW_MESSAGE, ATR_INVERSE, hdc, TRUE);
|
||||
ReleaseDC(GetNHApp()->hMainWnd, hdc);
|
||||
|
||||
InvalidateRect(mswin_hwnd_from_winid(WIN_MESSAGE), NULL, TRUE);
|
||||
mswin_layout_main_window(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user