From efe7ccb43c5f2a918634f8f717610b3f8796ddc5 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Fri, 30 Mar 2018 15:51:05 +0100 Subject: [PATCH] [ui] fix an issue where the advanced toolbars may not display * Super-strange behaviour, that happens on Windows 7, at low zoom factors, only when compiled with MSVC (MinGW is fine) and only when the advanced options are set to be displayed on startup... * Looks like TB_GETIDEALSIZE is screwy - Thanks a lot Microsoft! --- src/rufus.c | 5 +++++ src/rufus.rc | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index 21725f78..04c9acfd 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -1847,6 +1847,9 @@ static void CreateAdditionalControls(HWND hDlg) GetWindowRect(GetDlgItem(hDlg, IDC_ADVANCED_DRIVE_PROPERTIES), &rc); MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2); SendMessage(hAdvancedDeviceToolbar, TB_GETIDEALSIZE, (WPARAM)FALSE, (LPARAM)&sz); + // Yeah, so, like, TB_GETIDEALSIZE totally super doesn't work on Windows 7, for low zoom factor and when compiled with MSVC... + if (sz.cx < 16) + sz.cx = fw; SetWindowPos(hAdvancedDeviceToolbar, HWND_TOP, rc.left + toolbar_dx, rc.top, sz.cx, rc.bottom - rc.top, 0); utf8_to_wchar_no_alloc(lmprintf((advanced_mode_format) ? MSG_122 : MSG_121, lmprintf(MSG_120)), wtbtext[1], ARRAYSIZE(wtbtext[1])); @@ -1867,6 +1870,8 @@ static void CreateAdditionalControls(HWND hDlg) GetWindowRect(GetDlgItem(hDlg, IDC_ADVANCED_FORMAT_OPTIONS), &rc); MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2); SendMessage(hAdvancedFormatToolbar, TB_GETIDEALSIZE, (WPARAM)FALSE, (LPARAM)&sz); + if (sz.cx < 16) + sz.cx = fw; SetWindowPos(hAdvancedFormatToolbar, HWND_TOP, rc.left + toolbar_dx, rc.top, sz.cx, rc.bottom - rc.top, 0); // Create the bottom toolbar diff --git a/src/rufus.rc b/src/rufus.rc index e555cac3..9ac52f91 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 232, 326 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 3.0.1237" +CAPTION "Rufus 3.0.1238" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -371,8 +371,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,18,1237,0 - PRODUCTVERSION 2,18,1237,0 + FILEVERSION 2,18,1238,0 + PRODUCTVERSION 2,18,1238,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -389,13 +389,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "2.18.1237" + VALUE "FileVersion", "2.18.1238" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "2.18.1237" + VALUE "ProductVersion", "2.18.1238" END END BLOCK "VarFileInfo"