From 1afff67178d334197c16354e8a704d99d2fded51 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Mon, 6 May 2013 17:04:27 -0400 Subject: [PATCH] Set some static variables for magic number constants --- src/kits/interface/BMCPrivate.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/BMCPrivate.cpp b/src/kits/interface/BMCPrivate.cpp index 05e36fcdac..54240fe715 100644 --- a/src/kits/interface/BMCPrivate.cpp +++ b/src/kits/interface/BMCPrivate.cpp @@ -23,6 +23,10 @@ #include +static const float kPopUpIndicatorWidth = 10.0f; +static const float kMarginWidth = 3.0f; + + _BMCFilter_::_BMCFilter_(BMenuField* menuField, uint32 what) : BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, what), @@ -271,7 +275,7 @@ _BMCMenuBar_::MinSize() if (fShowPopUpMarker) { // account for popup indicator + a few pixels margin - size.width += 13.0; + size.width += kPopUpIndicatorWidth + kMarginWidth; } return BLayoutUtils::ComposeSize(ExplicitMinSize(), size); @@ -317,7 +321,9 @@ _BMCMenuBar_::_Init(bool setMaxContentWidth) if (be_control_look != NULL) 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();