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
+20 -23
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) { if (Window()) {
float diff = Frame().right - menuField->Bounds().right; if (diff > 0) {
if (Window()) { // clean up the dirty right top corner of
if (diff > 0) { // the menu field when enlarging
// clean up the dirty right top corner of BRect dirty(fMenuField->Bounds());
// the menu field when enlarging dirty.left = dirty.right - 2;
BRect dirty(menuField->Bounds()); dirty.bottom = Frame().top - 1;
dirty.left = dirty.right - 2; fMenuField->Invalidate(dirty);
dirty.bottom = Frame().top - 1; } else if (diff < 0) {
menuField->Invalidate(dirty); // clean up the dirty right line of
} else if (diff < 0) { // the menu field when shrinking
// clean up the dirty right line of BRect dirty(fMenuField->Bounds());
// the menu field when shrinking dirty.left = dirty.right + diff + 1;
BRect dirty(menuField->Bounds()); dirty.right = dirty.left + 1;
dirty.left = dirty.right + diff + 1; fMenuField->Invalidate(dirty);
dirty.right = dirty.left + 1;
menuField->Invalidate(dirty);
}
} }
// we have been shrinked or enlarged and need to take
// of the size of the parent menu field as well
// NOTE: no worries about follow mode, we follow left and top
menuField->ResizeBy(diff + 2, 0.0);
} }
// we have been shrinked or enlarged and need to take
// of the size of the parent menu field as well
// NOTE: no worries about follow mode, we follow left and top
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);
} }
+3 -3
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);
@@ -355,7 +355,7 @@ BOptionPopUp::BOptionPopUp(const BOptionPopUp &clone)
BOptionPopUp & BOptionPopUp &
BOptionPopUp::operator=(const BOptionPopUp & clone) BOptionPopUp::operator=(const BOptionPopUp & clone)
{ {
return *this; return *this;
} }