From 916eaa41136d87fa52b78fdfa5612d432cdeef9a Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sun, 18 Oct 2015 21:56:24 +0100 Subject: [PATCH] [ui] fix an issue with automatic resizing of the update policy * Closes #620 --- ChangeLog.txt | 1 + src/rufus.rc | 10 +++++----- src/stdlg.c | 22 +++++++++++++++------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index a9fe4bb4..f19c5050 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,6 +2,7 @@ o Version 2.5 (2015.10.??) Add SHA-256 checksum verification Add a cheat mode to disable exclusive USB drive locking (Alt-,) Add digital signature check on update downloads + Fix an issue with improper display of the update settings under some conditions Report Windows build number in the log (Windows 8 or later) Localization improvements Additional translation updates diff --git a/src/rufus.rc b/src/rufus.rc index 12d831ad..9a09b2d9 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 242, 376 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Rufus 2.5.781" +CAPTION "Rufus 2.5.782" FONT 8, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 @@ -319,8 +319,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,5,781,0 - PRODUCTVERSION 2,5,781,0 + FILEVERSION 2,5,782,0 + PRODUCTVERSION 2,5,782,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -337,13 +337,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "2.5.781" + VALUE "FileVersion", "2.5.782" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2015 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "2.5.781" + VALUE "ProductVersion", "2.5.782" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index f262bc79..4301e1f8 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -598,9 +598,11 @@ INT_PTR CALLBACK AboutCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP RECT rect; REQRESIZE* rsz; wchar_t wUrl[256]; + static BOOL resized_already = TRUE; switch (message) { case WM_INITDIALOG: + resized_already = FALSE; // Execute dialog localization apply_localization(IDD_ABOUTBOX, hDlg); SetTitleBarIcon(hDlg); @@ -630,12 +632,15 @@ INT_PTR CALLBACK AboutCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP case WM_NOTIFY: switch (((LPNMHDR)lParam)->code) { case EN_REQUESTRESIZE: - GetWindowRect(GetDlgItem(hDlg, edit_id[0]), &rect); - dy = rect.bottom - rect.top; - rsz = (REQRESIZE *)lParam; - dy -= rsz->rc.bottom - rsz->rc.top; - ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, edit_id[0]), 0, 0, 0, -dy, 1.0f); - ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, edit_id[1]), 0, -dy, 0, dy, 1.0f); + if (!resized_already) { + resized_already = TRUE; + GetWindowRect(GetDlgItem(hDlg, edit_id[0]), &rect); + dy = rect.bottom - rect.top; + rsz = (REQRESIZE *)lParam; + dy -= rsz->rc.bottom - rsz->rc.top; + ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, edit_id[0]), 0, 0, 0, -dy, 1.0f); + ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, edit_id[1]), 0, -dy, 0, dy, 1.0f); + } break; case EN_LINK: enl = (ENLINK*) lParam; @@ -1244,9 +1249,11 @@ INT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM l static HWND hFrequency, hBeta; int32_t freq; char update_policy_text[4096]; + static BOOL resized_already = TRUE; switch (message) { case WM_INITDIALOG: + resized_already = FALSE; hUpdatesDlg = hDlg; apply_localization(IDD_UPDATE_POLICY, hDlg); SetTitleBarIcon(hDlg); @@ -1294,7 +1301,8 @@ INT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM l SendMessage(hPolicy, EM_REQUESTRESIZE, 0, 0); break; case WM_NOTIFY: - if (((LPNMHDR)lParam)->code == EN_REQUESTRESIZE) { + if ((((LPNMHDR)lParam)->code == EN_REQUESTRESIZE) && (!resized_already)) { + resized_already = TRUE; hPolicy = GetDlgItem(hDlg, IDC_POLICY); GetWindowRect(hPolicy, &rect); dy = rect.bottom - rect.top;