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:
Artur Wieczorek
2015-12-09 21:06:05 +01:00
parent 757117ab2a
commit 9b56c41c6a

View File

@@ -1018,13 +1018,15 @@ bool wxToolBar::Realize()
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
// label, if present. This particularly matters for toolbars
// with the wxTB_HORZ_LAYOUT style: they look hideously ugly
// without autosizing when the labels have even slightly
// different lengths.
button.fsStyle |= TBSTYLE_AUTOSIZE;
// label, if present. They look hideously ugly without autosizing
// when the labels have even slightly different lengths.
if ( !IsVertical() )
{
button.fsStyle |= TBSTYLE_AUTOSIZE;
}
bitmapId++;
break;