Mercurial > vim
comparison src/gui_w32.c @ 5249:47a09a572ea6 v7.4b.001
updated for version 7.4b.001
Problem: Win32: dialog may extend off-screen.
Solution: Reduce the size, use correct borders. (Andrei Olsen)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Thu, 01 Aug 2013 13:20:42 +0200 |
parents | 8f983df0299f |
children | 7ed1ec814daf |
comparison
equal
deleted
inserted
replaced
5248:feddf3681a17 | 5249:47a09a572ea6 |
---|---|
3177 /* We don't have a window, use the desktop area. */ | 3177 /* We don't have a window, use the desktop area. */ |
3178 get_work_area(&workarea_rect); | 3178 get_work_area(&workarea_rect); |
3179 maxDialogWidth = workarea_rect.right - workarea_rect.left - 100; | 3179 maxDialogWidth = workarea_rect.right - workarea_rect.left - 100; |
3180 if (maxDialogWidth > 600) | 3180 if (maxDialogWidth > 600) |
3181 maxDialogWidth = 600; | 3181 maxDialogWidth = 600; |
3182 maxDialogHeight = workarea_rect.bottom - workarea_rect.top - 100; | 3182 /* Leave some room for the taskbar. */ |
3183 maxDialogHeight = workarea_rect.bottom - workarea_rect.top - 150; | |
3183 } | 3184 } |
3184 else | 3185 else |
3185 { | 3186 { |
3186 /* Use our own window for the size, unless it's very small. */ | 3187 /* Use our own window's client area for the size, unless it's very |
3187 GetWindowRect(s_hwnd, &rect); | 3188 * small. */ |
3189 GetClientRect(s_hwnd, &rect); | |
3188 maxDialogWidth = rect.right - rect.left | 3190 maxDialogWidth = rect.right - rect.left |
3189 - (GetSystemMetrics(SM_CXFRAME) + | 3191 - (GetSystemMetrics(SM_CXFRAME) + |
3190 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; | 3192 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; |
3191 if (maxDialogWidth < DLG_MIN_MAX_WIDTH) | 3193 if (maxDialogWidth < DLG_MIN_MAX_WIDTH) |
3192 maxDialogWidth = DLG_MIN_MAX_WIDTH; | 3194 maxDialogWidth = DLG_MIN_MAX_WIDTH; |
3193 | 3195 |
3194 maxDialogHeight = rect.bottom - rect.top | 3196 maxDialogHeight = rect.bottom - rect.top |
3195 - (GetSystemMetrics(SM_CXFRAME) + | 3197 - (GetSystemMetrics(SM_CYFRAME) + |
3196 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; | 3198 GetSystemMetrics(SM_CXPADDEDBORDER)) * 4; |
3197 if (maxDialogHeight < DLG_MIN_MAX_HEIGHT) | 3199 if (maxDialogHeight < DLG_MIN_MAX_HEIGHT) |
3198 maxDialogHeight = DLG_MIN_MAX_HEIGHT; | 3200 maxDialogHeight = DLG_MIN_MAX_HEIGHT; |
3199 } | 3201 } |
3200 | 3202 |
3201 /* Set dlgwidth to width of message. | 3203 /* Set dlgwidth to width of message. |