fix searchbar show/hide

This commit is contained in:
henrypp committed 2021-11-09 18:31:55 +06:00
1 parent c76da4beb2
commit edf607fdca
2 files changed
+14 -2

No files matched your search

+10 -2
View File
@@ -1338,7 +1338,7 @@ VOID _app_toolbar_resize (_In_ HWND hwnd, _In_ LONG dpi_value)
RtlZeroMemory (&rbi, sizeof (rbi));
rbi.cbSize = sizeof (rbi);
rbi.fMask = RBBIM_ID | RBBIM_IDEALSIZE | RBBIM_CHILDSIZE;
rbi.fMask = RBBIM_ID | RBBIM_CHILD | RBBIM_IDEALSIZE | RBBIM_CHILDSIZE;
if (!SendMessage (config.hrebar, RB_GETBANDINFO, (WPARAM)i, (LPARAM)&rbi))
continue;
@@ -1356,7 +1356,15 @@ VOID _app_toolbar_resize (_In_ HWND hwnd, _In_ LONG dpi_value)
}
else if (rbi.wID == REBAR_SEARCH_ID)
{
rbi.cxIdeal = (UINT)_r_dc_getdpi (180, dpi_value);
if (_r_wnd_isvisible (rbi.hwndChild))
{
rbi.cxIdeal = (UINT)_r_dc_getdpi (180, dpi_value);
}
else
{
rbi.cxIdeal = 0;
}
rbi.cxMinChild = rbi.cxIdeal;
rbi.cyMinChild = 20;
}
+4
View File
@@ -2879,8 +2879,12 @@ INT_PTR CALLBACK DlgProc (_In_ HWND hwnd, _In_ UINT msg, _In_ WPARAM wparam, _In
_r_config_setboolean (L"IsShowSearchBar", new_val);
if (config.hsearchbar)
{
_app_search_setvisible (hwnd, config.hsearchbar);
SendMessage (hwnd, WM_SIZE, 0, 0);
}
break;
}