respect wxBU_EXACTFIT
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
1b488c0eeb
commit
1b4651028a
@ -2282,14 +2282,17 @@ void wxGTKRenderer::AdjustSize(wxSize *size, const wxWindow *window)
|
|||||||
{
|
{
|
||||||
if ( wxDynamicCast(window, wxButton) )
|
if ( wxDynamicCast(window, wxButton) )
|
||||||
{
|
{
|
||||||
// TODO: this is ad hoc...
|
if ( !(window->GetWindowStyle() & wxBU_EXACTFIT) )
|
||||||
size->x += 3*window->GetCharWidth();
|
{
|
||||||
wxCoord minBtnHeight = 18;
|
// TODO: this is ad hoc...
|
||||||
if ( size->y < minBtnHeight )
|
size->x += 3*window->GetCharWidth();
|
||||||
size->y = minBtnHeight;
|
wxCoord minBtnHeight = 18;
|
||||||
|
if ( size->y < minBtnHeight )
|
||||||
|
size->y = minBtnHeight;
|
||||||
|
|
||||||
// button border width
|
// button border width
|
||||||
size->y += 4;
|
size->y += 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ( wxDynamicCast(window, wxScrollBar) )
|
else if ( wxDynamicCast(window, wxScrollBar) )
|
||||||
{
|
{
|
||||||
|
@ -255,6 +255,7 @@ public:
|
|||||||
const wxMenuGeometryInfo& geomInfo);
|
const wxMenuGeometryInfo& geomInfo);
|
||||||
#endif
|
#endif
|
||||||
virtual void GetComboBitmaps(wxBitmap *bmpNormal,
|
virtual void GetComboBitmaps(wxBitmap *bmpNormal,
|
||||||
|
wxBitmap *bmpFocus,
|
||||||
wxBitmap *bmpPressed,
|
wxBitmap *bmpPressed,
|
||||||
wxBitmap *bmpDisabled);
|
wxBitmap *bmpDisabled);
|
||||||
|
|
||||||
@ -2759,6 +2760,7 @@ wxWin32Renderer::GetMenuGeometry(wxWindow *WXUNUSED(win),
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxWin32Renderer::GetComboBitmaps(wxBitmap *bmpNormal,
|
void wxWin32Renderer::GetComboBitmaps(wxBitmap *bmpNormal,
|
||||||
|
wxBitmap *bmpFocus,
|
||||||
wxBitmap *bmpPressed,
|
wxBitmap *bmpPressed,
|
||||||
wxBitmap *bmpDisabled)
|
wxBitmap *bmpDisabled)
|
||||||
{
|
{
|
||||||
@ -3008,19 +3010,17 @@ void wxWin32Renderer::AdjustSize(wxSize *size, const wxWindow *window)
|
|||||||
#if wxUSE_BUTTON
|
#if wxUSE_BUTTON
|
||||||
if ( wxDynamicCast(window, wxButton) )
|
if ( wxDynamicCast(window, wxButton) )
|
||||||
{
|
{
|
||||||
// TODO
|
if ( !(window->GetWindowStyle() & wxBU_EXACTFIT) )
|
||||||
size->x += 3*window->GetCharWidth();
|
{
|
||||||
#if 0 // do allow creating small buttons if wanted
|
// TODO: don't harcode all this
|
||||||
wxSize sizeDef = wxButton::GetDefaultSize();
|
size->x += 3*window->GetCharWidth();
|
||||||
if ( size->x < sizeDef.x )
|
|
||||||
size->x = sizeDef.x;
|
|
||||||
#endif // 0
|
|
||||||
|
|
||||||
wxCoord heightBtn = (11*(window->GetCharHeight() + 8))/10;
|
wxCoord heightBtn = (11*(window->GetCharHeight() + 8))/10;
|
||||||
if ( size->y < heightBtn - 8 )
|
if ( size->y < heightBtn - 8 )
|
||||||
size->y = heightBtn;
|
size->y = heightBtn;
|
||||||
else
|
else
|
||||||
size->y += 9;
|
size->y += 9;
|
||||||
|
}
|
||||||
|
|
||||||
// no border width adjustments for buttons
|
// no border width adjustments for buttons
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user