From e9d64e0a8cea0b92378bde064b6d018c5eaa8a93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Dan=20Ma=C5=A1ek?= Date: Tue, 15 Nov 2022 01:18:46 +0100 Subject: [PATCH] Fix #22767: Ensure that the buttons are spaced to the size of the toolbar window, which is always visible. (rebased to 3.x) --- modules/highgui/src/window_w32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/highgui/src/window_w32.cpp b/modules/highgui/src/window_w32.cpp index 13ad679..7c5668c 100644 --- a/modules/highgui/src/window_w32.cpp +++ b/modules/highgui/src/window_w32.cpp @@ -2253,7 +2253,7 @@ icvCreateTrackbar( const char* trackbar_name, const char* window_name, tbis.cbSize = sizeof(tbis); tbis.dwMask = TBIF_SIZE; - GetClientRect(window->hwnd, &rect); + GetClientRect(window->toolbar.toolbar, &rect); tbis.cx = (unsigned short)(rect.right - rect.left); SendMessage(window->toolbar.toolbar, TB_SETBUTTONINFO, @@ -2271,7 +2271,7 @@ icvCreateTrackbar( const char* trackbar_name, const char* window_name, trackbar->parent = window; trackbar->pos = 0; trackbar->data = 0; - trackbar->id = bcount; + trackbar->id = tbs.idCommand; trackbar->next = window->toolbar.first; trackbar->name = (char*)(trackbar + 1); memcpy( trackbar->name, trackbar_name, len + 1 ); -- 2.7.4