Size toolbar buttons automatically only for horizontal toolbars.
Buttons with fixed width look better for vertical toolbars so apply TBSTYLE_AUTOSIZE style to the buttons only for horizontal toolbars.
This commit is contained in:
@@ -1018,13 +1018,15 @@ bool wxToolBar::Realize()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instead of using fixed widths for all buttons, size them
|
// When toolbar has wxTB_HORZ_LAYOUT style then
|
||||||
|
// instead of using fixed widths for all buttons, size them
|
||||||
// automatically according to the size of their bitmap and text
|
// automatically according to the size of their bitmap and text
|
||||||
// label, if present. This particularly matters for toolbars
|
// label, if present. They look hideously ugly without autosizing
|
||||||
// with the wxTB_HORZ_LAYOUT style: they look hideously ugly
|
// when the labels have even slightly different lengths.
|
||||||
// without autosizing when the labels have even slightly
|
if ( !IsVertical() )
|
||||||
// different lengths.
|
{
|
||||||
button.fsStyle |= TBSTYLE_AUTOSIZE;
|
button.fsStyle |= TBSTYLE_AUTOSIZE;
|
||||||
|
}
|
||||||
|
|
||||||
bitmapId++;
|
bitmapId++;
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user