Merge pull request #22838 from dan-masek:fix_issue_22837

Fix issue 22837: No more blank buttons on toolbar after resizing the window
pull/22856/head
Dan Mašek 2 years ago committed by GitHub
parent 5db4f1f7df
commit aba2167d9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      modules/highgui/src/window_w32.cpp

@ -1939,15 +1939,9 @@ static LRESULT CALLBACK HGToolbarProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPAR
case WM_NCCALCSIZE:
{
LRESULT ret = CallWindowProc(window->toolbar.toolBarProc, hwnd, uMsg, wParam, lParam);
int rows = (int)SendMessage(hwnd, TB_GETROWS, 0, 0);
if(window->toolbar.rows != rows)
{
SendMessage(window->toolbar.toolbar, TB_BUTTONCOUNT, 0, 0);
CvTrackbar* trackbar = window->toolbar.first;
for( ; trackbar != 0; trackbar = trackbar->next )
{
for (; trackbar != 0; trackbar = trackbar->next) {
RECT rect = { 0 };
SendMessage(window->toolbar.toolbar, TB_GETITEMRECT,
(WPARAM)trackbar->id, (LPARAM)&rect);
@ -1957,8 +1951,7 @@ static LRESULT CALLBACK HGToolbarProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPAR
MoveWindow(trackbar->buddy, rect.left, rect.top,
HG_BUDDY_WIDTH, rect.bottom - rect.top, FALSE);
}
window->toolbar.rows = rows;
}
window->toolbar.rows = static_cast<int>(SendMessage(hwnd, TB_GETROWS, 0, 0));
return ret;
}
}

Loading…
Cancel
Save