Merge pull request #1257 from RaiKoHoff/Dev_RC_Fixes

Selecting external toolbar from config
This commit is contained in:
Rainer Kottenhoff 2019-05-27 22:37:36 +02:00 committed by GitHub
commit 78f37b5f9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1932,9 +1932,10 @@ void CreateBars(HWND hwnd, HINSTANCE hInstance)
hbmp = _LoadBitmapFile(s_tchToolbarBitmap);
BITMAP bmp;
ZeroMemory(&bmp, sizeof(BITMAP));
GetObject(hbmp, sizeof(BITMAP), &bmp);
bool const dimOk = (bmp.bmWidth >= (bmp.bmHeight * NUMTOOLBITMAPS));
bool const dimOk = (bmp.bmWidth >= (bmp.bmHeight * NUMTOOLBITMAPS)) && hbmp;
if (!dimOk) {
InfoBoxLng(MB_ICONWARNING, NULL, IDS_MUI_ERR_BITMAP, s_tchToolbarBitmap,
@ -7443,7 +7444,7 @@ void LoadSettings()
WCHAR tchHighDpiToolBar[32] = { L'\0' };
StringCchPrintf(tchHighDpiToolBar, COUNTOF(tchHighDpiToolBar), L"%ix%i HighDpiToolBar", ResX, ResY);
s_iToolBarTheme = IniSectionGetInt(pIniSection, tchHighDpiToolBar, -1);
s_iToolBarTheme = StrIsNotEmpty(s_tchToolbarBitmap) ? 2 : clampi(s_iToolBarTheme, -1, 1);
s_iToolBarTheme = clampi(s_iToolBarTheme, -1, StrIsEmpty(s_tchToolbarBitmap) ? 1 : 2);
if (s_iToolBarTheme < 0) { // undefined: determine high DPI (higher than Full-HD)
s_iToolBarTheme = IsFullHDOrHigher(Globals.hwndMain, ResX, ResY) ? 1 : 0;
}