Fix the size up-down control becoming smaller every time the apply button is pressed in the Desktop Integration tab.
UDM_SETBUDDY always shrinks the buddy window for a up-down control according to tests. And a PSN_SETACTIVE notification is sent every time the apply button is pressed, thus init_dialog() gets called again and sends an extra UDM_SETBUDDY message.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- programs/winecfg/theme.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/programs/winecfg/theme.c b/programs/winecfg/theme.c index b38b2ff26d6..687ea571311 100644 --- a/programs/winecfg/theme.c +++ b/programs/winecfg/theme.c @@ -434,6 +434,12 @@ static void enable_size_and_color_controls (HWND dialog, BOOL enable) }
static void init_dialog (HWND dialog) +{ + SendDlgItemMessageW(dialog, IDC_SYSPARAM_SIZE_UD, UDM_SETBUDDY, + (WPARAM)GetDlgItem(dialog, IDC_SYSPARAM_SIZE), 0); +} + +static void update_dialog (HWND dialog) { updating_ui = TRUE;
@@ -452,7 +458,6 @@ static void init_dialog (HWND dialog) } theme_dirty = FALSE;
- SendDlgItemMessageW(dialog, IDC_SYSPARAM_SIZE_UD, UDM_SETBUDDY, (WPARAM)GetDlgItem(dialog, IDC_SYSPARAM_SIZE), 0); SendDlgItemMessageW(dialog, IDC_SYSPARAM_SIZE_UD, UDM_SETRANGE, 0, MAKELONG(100, 8));
updating_ui = FALSE; @@ -1197,6 +1202,7 @@ ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) update_shell_folder_listview(hDlg); read_sysparams(hDlg); init_mime_types(hDlg); + init_dialog(hDlg); break;
case WM_DESTROY: @@ -1349,7 +1355,7 @@ ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) break; } case PSN_SETACTIVE: { - init_dialog (hDlg); + update_dialog(hDlg); break; } }