Skip to content

Commit 52eeb74

Browse files
committed
updated for version 7.4b.018
Problem: Win32: Dialog can still be too big. Solution: Move the check for height further down. (Andrei Olsen)
1 parent aa9918a commit 52eeb74

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

src/gui_w32.c

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3184,9 +3184,8 @@ gui_mch_dialog(
31843184
}
31853185
else
31863186
{
3187-
/* Use our own window's client area for the size, unless it's very
3188-
* small. */
3189-
GetClientRect(s_hwnd, &rect);
3187+
/* Use our own window for the size, unless it's very small. */
3188+
GetWindowRect(s_hwnd, &rect);
31903189
maxDialogWidth = rect.right - rect.left
31913190
- (GetSystemMetrics(SM_CXFRAME) +
31923191
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
@@ -3195,7 +3194,8 @@ gui_mch_dialog(
31953194

31963195
maxDialogHeight = rect.bottom - rect.top
31973196
- (GetSystemMetrics(SM_CYFRAME) +
3198-
GetSystemMetrics(SM_CXPADDEDBORDER)) * 4;
3197+
GetSystemMetrics(SM_CXPADDEDBORDER)) * 4
3198+
- GetSystemMetrics(SM_CYCAPTION);
31993199
if (maxDialogHeight < DLG_MIN_MAX_HEIGHT)
32003200
maxDialogHeight = DLG_MIN_MAX_HEIGHT;
32013201
}
@@ -3262,16 +3262,9 @@ gui_mch_dialog(
32623262

32633263
messageWidth += 10; /* roundoff space */
32643264

3265-
/* Restrict the size to a maximum. Causes a scrollbar to show up. */
3266-
if (msgheight > maxDialogHeight)
3267-
{
3268-
msgheight = maxDialogHeight;
3269-
scroll_flag = WS_VSCROLL;
3270-
messageWidth += GetSystemMetrics(SM_CXVSCROLL);
3271-
}
3272-
32733265
/* Add width of icon to dlgwidth, and some space */
3274-
dlgwidth = messageWidth + DLG_ICON_WIDTH + 3 * dlgPaddingX;
3266+
dlgwidth = messageWidth + DLG_ICON_WIDTH + 3 * dlgPaddingX
3267+
+ GetSystemMetrics(SM_CXVSCROLL);
32753268

32763269
if (msgheight < DLG_ICON_HEIGHT)
32773270
msgheight = DLG_ICON_HEIGHT;
@@ -3345,8 +3338,8 @@ gui_mch_dialog(
33453338

33463339
// Dialog height.
33473340
if (vertical)
3348-
dlgheight = msgheight + 2 * dlgPaddingY +
3349-
DLG_VERT_PADDING_Y + 2 * fontHeight * numButtons;
3341+
dlgheight = msgheight + 2 * dlgPaddingY
3342+
+ DLG_VERT_PADDING_Y + 2 * fontHeight * numButtons;
33503343
else
33513344
dlgheight = msgheight + 3 * dlgPaddingY + 2 * fontHeight;
33523345

@@ -3355,6 +3348,16 @@ gui_mch_dialog(
33553348
if (textfield != NULL)
33563349
dlgheight += editboxheight;
33573350

3351+
/* Restrict the size to a maximum. Causes a scrollbar to show up. */
3352+
if (dlgheight > maxDialogHeight)
3353+
{
3354+
msgheight = msgheight - (dlgheight - maxDialogHeight);
3355+
dlgheight = maxDialogHeight;
3356+
scroll_flag = WS_VSCROLL;
3357+
/* Make sure scrollbar doesn't appear in the middle of the dialog */
3358+
messageWidth = dlgwidth - DLG_ICON_WIDTH - 3 * dlgPaddingX;
3359+
}
3360+
33583361
add_word(PixelToDialogY(dlgheight));
33593362

33603363
add_word(0); // Menu

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ static char *(features[]) =
727727

728728
static int included_patches[] =
729729
{ /* Add new patch number below this line */
730+
/**/
731+
18,
730732
/**/
731733
17,
732734
/**/

0 commit comments

Comments
 (0)