X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0b165ed6b209ea9f5ddd7bfb1813c6f0718a9a3d..f78024a1f98fac96991a9f87804000512a32a976:/src/generic/logg.cpp diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index 68555e35e6..6a12263b57 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -44,6 +44,7 @@ #include "wx/sizer.h" #include "wx/statbmp.h" #include "wx/button.h" + #include "wx/settings.h" #endif // WX_PRECOMP #if wxUSE_LOGGUI || wxUSE_LOGWINDOW @@ -869,7 +870,13 @@ void wxLogDialog::CreateDetailsControls() int y; GetTextExtent(_T("H"), (int*)NULL, &y, (int*)NULL, (int*)NULL, &font); int height = wxMax(y*(count + 3), 100); - m_listctrl->SetSize(-1, height); + + // if the height as computed from list items exceeds, together with the + // actual message & controls, the screen, make it smaller + int heightMax = + (3*wxSystemSettings::GetSystemMetric(wxSYS_SCREEN_Y))/5 - GetSize().y; + + m_listctrl->SetSize(-1, wxMin(height, heightMax)); } void wxLogDialog::OnListSelect(wxListEvent& event)