Small changes, nothing important

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15942 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2006-01-13 20:49:41 +00:00
parent fc3a8a1c73
commit b5cd88a5c7
3 changed files with 25 additions and 26 deletions
+6 -9
View File
@@ -228,31 +228,28 @@ _BMCMenuBar_::FrameResized(float width, float height)
{ {
// we need to take care of resizing and cleaning up // we need to take care of resizing and cleaning up
// the parent menu field // the parent menu field
BMenuField* menuField = dynamic_cast<BMenuField*>(Parent()); float diff = Frame().right - fMenuField->Bounds().right;
if (menuField) {
float diff = Frame().right - menuField->Bounds().right;
if (Window()) { if (Window()) {
if (diff > 0) { if (diff > 0) {
// clean up the dirty right top corner of // clean up the dirty right top corner of
// the menu field when enlarging // the menu field when enlarging
BRect dirty(menuField->Bounds()); BRect dirty(fMenuField->Bounds());
dirty.left = dirty.right - 2; dirty.left = dirty.right - 2;
dirty.bottom = Frame().top - 1; dirty.bottom = Frame().top - 1;
menuField->Invalidate(dirty); fMenuField->Invalidate(dirty);
} else if (diff < 0) { } else if (diff < 0) {
// clean up the dirty right line of // clean up the dirty right line of
// the menu field when shrinking // the menu field when shrinking
BRect dirty(menuField->Bounds()); BRect dirty(fMenuField->Bounds());
dirty.left = dirty.right + diff + 1; dirty.left = dirty.right + diff + 1;
dirty.right = dirty.left + 1; dirty.right = dirty.left + 1;
menuField->Invalidate(dirty); fMenuField->Invalidate(dirty);
} }
} }
// we have been shrinked or enlarged and need to take // we have been shrinked or enlarged and need to take
// of the size of the parent menu field as well // of the size of the parent menu field as well
// NOTE: no worries about follow mode, we follow left and top // NOTE: no worries about follow mode, we follow left and top
menuField->ResizeBy(diff + 2, 0.0); fMenuField->ResizeBy(diff + 2, 0.0);
}
BMenuBar::FrameResized(width, height); BMenuBar::FrameResized(width, height);
} }
+2
View File
@@ -625,6 +625,7 @@ BMenuItem::DrawMarkSymbol()
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_4_TINT)); B_DARKEN_4_TINT));
fSuper->BeginLineArray(4);
fSuper->StrokeLine(BPoint(fBounds.left + 6.0f, fBounds.bottom - 4.0f), fSuper->StrokeLine(BPoint(fBounds.left + 6.0f, fBounds.bottom - 4.0f),
BPoint(fBounds.left + 10.0f, fBounds.bottom - 13.0f)); BPoint(fBounds.left + 10.0f, fBounds.bottom - 13.0f));
fSuper->StrokeLine(BPoint(fBounds.left + 5.0f, fBounds.bottom - 4.0f), fSuper->StrokeLine(BPoint(fBounds.left + 5.0f, fBounds.bottom - 4.0f),
@@ -633,6 +634,7 @@ BMenuItem::DrawMarkSymbol()
BPoint(fBounds.left + 3.0f, fBounds.bottom - 9.0f)); BPoint(fBounds.left + 3.0f, fBounds.bottom - 9.0f));
fSuper->StrokeLine(BPoint(fBounds.left + 4.0f, fBounds.bottom - 4.0f), fSuper->StrokeLine(BPoint(fBounds.left + 4.0f, fBounds.bottom - 4.0f),
BPoint(fBounds.left + 2.0f, fBounds.bottom - 9.0f)); BPoint(fBounds.left + 2.0f, fBounds.bottom - 9.0f));
fSuper->EndLineArray();
fSuper->SetDrawingMode(B_OP_COPY); fSuper->SetDrawingMode(B_OP_COPY);
} }
+2 -2
View File
@@ -157,12 +157,12 @@ BOptionPopUp::AddOptionAt(const char *name, int32 value, int32 index)
BMessage *message = MakeValueMessage(value); BMessage *message = MakeValueMessage(value);
if (message == NULL) if (message == NULL)
return B_ERROR; // TODO: Should return B_NO_MEMORY instead ? return B_NO_MEMORY;
BMenuItem *newItem = new BMenuItem(name, message); BMenuItem *newItem = new BMenuItem(name, message);
if (newItem == NULL) { if (newItem == NULL) {
delete message; delete message;
return B_ERROR; // TODO: same as above return B_NO_MEMORY;
} }
menu->AddItem(newItem, index); menu->AddItem(newItem, index);