Small code simplifications. No functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29690 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+10
-11
@@ -2029,7 +2029,7 @@ BMenu::_ComputeColumnLayout(int32 index, bool bestFit, bool moveItems,
|
|||||||
if (index > 0)
|
if (index > 0)
|
||||||
frame = ItemAt(index - 1)->Frame();
|
frame = ItemAt(index - 1)->Frame();
|
||||||
else
|
else
|
||||||
frame.Set(0, 0, 0, 0);
|
frame.Set(0, 0, 0, -1);
|
||||||
|
|
||||||
for (; index < fItems.CountItems(); index++) {
|
for (; index < fItems.CountItems(); index++) {
|
||||||
BMenuItem *item = ItemAt(index);
|
BMenuItem *item = ItemAt(index);
|
||||||
@@ -2048,7 +2048,7 @@ BMenu::_ComputeColumnLayout(int32 index, bool bestFit, bool moveItems,
|
|||||||
}
|
}
|
||||||
|
|
||||||
item->fBounds.left = 0.0f;
|
item->fBounds.left = 0.0f;
|
||||||
item->fBounds.top = frame.bottom + (index > 0 ? 1.0f : 0.0f);
|
item->fBounds.top = frame.bottom + 1.0f;
|
||||||
item->fBounds.bottom = item->fBounds.top + height + fPad.top
|
item->fBounds.bottom = item->fBounds.top + height + fPad.top
|
||||||
+ fPad.bottom;
|
+ fPad.bottom;
|
||||||
|
|
||||||
@@ -2090,18 +2090,17 @@ BMenu::_ComputeRowLayout(int32 index, bool bestFit, bool moveItems,
|
|||||||
|
|
||||||
for (int32 i = 0; i < fItems.CountItems(); i++) {
|
for (int32 i = 0; i < fItems.CountItems(); i++) {
|
||||||
BMenuItem *item = ItemAt(i);
|
BMenuItem *item = ItemAt(i);
|
||||||
|
|
||||||
float width, height;
|
float width, height;
|
||||||
if (item != NULL) {
|
item->GetContentSize(&width, &height);
|
||||||
item->GetContentSize(&width, &height);
|
|
||||||
|
|
||||||
item->fBounds.left = frame.right;
|
item->fBounds.left = frame.right;
|
||||||
item->fBounds.top = 0.0f;
|
item->fBounds.top = 0.0f;
|
||||||
item->fBounds.right = item->fBounds.left + width + fPad.left
|
item->fBounds.right = item->fBounds.left + width + fPad.left
|
||||||
+ fPad.right;
|
+ fPad.right;
|
||||||
|
|
||||||
frame.right = item->Frame().right + 1.0f;
|
frame.right = item->Frame().right + 1.0f;
|
||||||
frame.bottom = max_c(frame.bottom, height + fPad.top + fPad.bottom);
|
frame.bottom = max_c(frame.bottom, height + fPad.top + fPad.bottom);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moveItems) {
|
if (moveItems) {
|
||||||
|
|||||||
Reference in New Issue
Block a user