* Only take the popup marker into account if fShowPopUpMarker is true.
* Automatic whitespace cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32173 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
01592a4057
commit
d82ea8abda
@ -7,6 +7,7 @@
|
|||||||
* Stephan Aßmus <superstippi@gmx.de>
|
* Stephan Aßmus <superstippi@gmx.de>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <BMCPrivate.h>
|
#include <BMCPrivate.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -151,7 +152,7 @@ _BMCMenuBar_::Draw(BRect updateRect)
|
|||||||
be_control_look->DrawMenuFieldBackground(this, rect,
|
be_control_look->DrawMenuFieldBackground(this, rect,
|
||||||
updateRect, base, fShowPopUpMarker, flags);
|
updateRect, base, fShowPopUpMarker, flags);
|
||||||
|
|
||||||
_DrawItems(updateRect);
|
_DrawItems(updateRect);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -203,7 +204,7 @@ _BMCMenuBar_::Draw(BRect updateRect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BRect r(bounds);
|
BRect r(bounds);
|
||||||
r.left = r.right - 10.0;
|
r.left = r.right - 10.0;
|
||||||
|
|
||||||
BeginLineArray(6);
|
BeginLineArray(6);
|
||||||
// bottom below item text, darker then BMenuBar
|
// bottom below item text, darker then BMenuBar
|
||||||
@ -272,7 +273,7 @@ _BMCMenuBar_::FrameResized(float width, float height)
|
|||||||
dirty.right = Frame().right + 2;
|
dirty.right = Frame().right + 2;
|
||||||
dirty.left = dirty.left - diff - 4;
|
dirty.left = dirty.left - diff - 4;
|
||||||
fMenuField->Invalidate(dirty);
|
fMenuField->Invalidate(dirty);
|
||||||
|
|
||||||
// clean up the arrow part
|
// clean up the arrow part
|
||||||
dirty = Bounds();
|
dirty = Bounds();
|
||||||
dirty.left = dirty.right - diff - 12;
|
dirty.left = dirty.right - diff - 12;
|
||||||
@ -285,7 +286,7 @@ _BMCMenuBar_::FrameResized(float width, float height)
|
|||||||
dirty.left = Frame().right - 2;
|
dirty.left = Frame().right - 2;
|
||||||
dirty.right = dirty.left - diff + 4;
|
dirty.right = dirty.left - diff + 4;
|
||||||
fMenuField->Invalidate(dirty);
|
fMenuField->Invalidate(dirty);
|
||||||
|
|
||||||
// clean up the arrow part
|
// clean up the arrow part
|
||||||
dirty = Bounds();
|
dirty = Bounds();
|
||||||
dirty.left = dirty.right - 12;
|
dirty.left = dirty.right - 12;
|
||||||
@ -315,16 +316,16 @@ _BMCMenuBar_::MessageReceived(BMessage *msg)
|
|||||||
|
|
||||||
if (item && item->Submenu() && item->Submenu()->Window()) {
|
if (item && item->Submenu() && item->Submenu()->Window()) {
|
||||||
BMessage message(B_KEY_DOWN);
|
BMessage message(B_KEY_DOWN);
|
||||||
|
|
||||||
message.AddInt8("byte", B_ESCAPE);
|
message.AddInt8("byte", B_ESCAPE);
|
||||||
message.AddInt8("key", B_ESCAPE);
|
message.AddInt8("key", B_ESCAPE);
|
||||||
message.AddInt32("modifiers", 0);
|
message.AddInt32("modifiers", 0);
|
||||||
message.AddInt8("raw_char", B_ESCAPE);
|
message.AddInt8("raw_char", B_ESCAPE);
|
||||||
|
|
||||||
Window()->PostMessage(&message, this, NULL);
|
Window()->PostMessage(&message, this, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
default:
|
default:
|
||||||
BMenuBar::MessageReceived(msg);
|
BMenuBar::MessageReceived(msg);
|
||||||
break;
|
break;
|
||||||
@ -367,8 +368,12 @@ _BMCMenuBar_::MinSize()
|
|||||||
{
|
{
|
||||||
BSize size;
|
BSize size;
|
||||||
BMenuBar::GetPreferredSize(&size.width, &size.height);
|
BMenuBar::GetPreferredSize(&size.width, &size.height);
|
||||||
// account for popup indicator + a few pixels margin
|
|
||||||
size.width += 13.0;
|
if (fShowPopUpMarker) {
|
||||||
|
// account for popup indicator + a few pixels margin
|
||||||
|
size.width += 13.0;
|
||||||
|
}
|
||||||
|
|
||||||
return BLayoutUtils::ComposeSize(ExplicitMinSize(), size);
|
return BLayoutUtils::ComposeSize(ExplicitMinSize(), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,7 +389,7 @@ _BMCMenuBar_::MaxSize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_BMCMenuBar_
|
_BMCMenuBar_
|
||||||
&_BMCMenuBar_::operator=(const _BMCMenuBar_ &)
|
&_BMCMenuBar_::operator=(const _BMCMenuBar_ &)
|
||||||
{
|
{
|
||||||
return *this;
|
return *this;
|
||||||
|
Loading…
Reference in New Issue
Block a user