Set some static variables for magic number constants
This commit is contained in:
@@ -23,6 +23,10 @@
|
|||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
|
|
||||||
|
static const float kPopUpIndicatorWidth = 10.0f;
|
||||||
|
static const float kMarginWidth = 3.0f;
|
||||||
|
|
||||||
|
|
||||||
_BMCFilter_::_BMCFilter_(BMenuField* menuField, uint32 what)
|
_BMCFilter_::_BMCFilter_(BMenuField* menuField, uint32 what)
|
||||||
:
|
:
|
||||||
BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, what),
|
BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, what),
|
||||||
@@ -271,7 +275,7 @@ _BMCMenuBar_::MinSize()
|
|||||||
|
|
||||||
if (fShowPopUpMarker) {
|
if (fShowPopUpMarker) {
|
||||||
// account for popup indicator + a few pixels margin
|
// account for popup indicator + a few pixels margin
|
||||||
size.width += 13.0;
|
size.width += kPopUpIndicatorWidth + kMarginWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
return BLayoutUtils::ComposeSize(ExplicitMinSize(), size);
|
return BLayoutUtils::ComposeSize(ExplicitMinSize(), size);
|
||||||
@@ -317,7 +321,9 @@ _BMCMenuBar_::_Init(bool setMaxContentWidth)
|
|||||||
if (be_control_look != NULL)
|
if (be_control_look != NULL)
|
||||||
left = right = be_control_look->DefaultLabelSpacing();
|
left = right = be_control_look->DefaultLabelSpacing();
|
||||||
|
|
||||||
SetItemMargins(left, top, right + fShowPopUpMarker ? 10 : 0, bottom);
|
SetItemMargins(left, top,
|
||||||
|
right + fShowPopUpMarker ? kPopUpIndicatorWidth + kMarginWidth : 0,
|
||||||
|
bottom);
|
||||||
|
|
||||||
fPreviousWidth = Bounds().Width();
|
fPreviousWidth = Bounds().Width();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user