Fixed width of scrollbars in wxUniv.
The AdjustSize renderer function for wxUniv's GTK and MSW theme adjusted the size of a scrollbar while it already had the correct size, resulting in scrollbars being twice as wide. Fixed by not adjusting the size of a scrollbar anymore in AdjustSize. Closes #11660. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2267,12 +2267,13 @@ void wxGTKRenderer::AdjustSize(wxSize *size, const wxWindow *window)
|
|||||||
#if wxUSE_SCROLLBAR
|
#if wxUSE_SCROLLBAR
|
||||||
if ( wxDynamicCast(window, wxScrollBar) )
|
if ( wxDynamicCast(window, wxScrollBar) )
|
||||||
{
|
{
|
||||||
// we only set the width of vert scrollbars and height of the
|
/*
|
||||||
// horizontal ones
|
Don't adjust the size for a scrollbar as its DoGetBestClientSize
|
||||||
if ( window->GetWindowStyle() & wxSB_HORIZONTAL )
|
already has the correct size set. Any size changes here would get
|
||||||
size->y = m_sizeScrollbarArrow.x;
|
added to the best size, making the scrollbar larger.
|
||||||
else
|
Also skip border width adjustments, they don't make sense for us.
|
||||||
size->x = m_sizeScrollbarArrow.x;
|
*/
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif // wxUSE_SCROLLBAR
|
#endif // wxUSE_SCROLLBAR
|
||||||
|
@@ -3142,14 +3142,12 @@ void wxWin32Renderer::AdjustSize(wxSize *size, const wxWindow *window)
|
|||||||
#if wxUSE_SCROLLBAR
|
#if wxUSE_SCROLLBAR
|
||||||
if ( wxDynamicCast(window, wxScrollBar) )
|
if ( wxDynamicCast(window, wxScrollBar) )
|
||||||
{
|
{
|
||||||
// we only set the width of vert scrollbars and height of the
|
/*
|
||||||
// horizontal ones
|
Don't adjust the size for a scrollbar as its DoGetBestClientSize
|
||||||
if ( window->GetWindowStyle() & wxSB_HORIZONTAL )
|
already has the correct size set. Any size changes here would get
|
||||||
size->y = m_sizeScrollbarArrow.y;
|
added to the best size, making the scrollbar larger.
|
||||||
else
|
Also skip border width adjustments, they don't make sense for us.
|
||||||
size->x = m_sizeScrollbarArrow.x;
|
*/
|
||||||
|
|
||||||
// skip border width adjustments, they don't make sense for us
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_SCROLLBAR
|
#endif // wxUSE_SCROLLBAR
|
||||||
|
Reference in New Issue
Block a user