Yesterday's commit triggered some other visual bugs: hopefully fixed them all. A disabled menufield now doesn't open its associated menu anymore.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15906 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -6,8 +6,6 @@
|
||||
* Marc Flerackers ([email protected])
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -36,7 +34,7 @@ BMenuField::BMenuField(BRect frame, const char *name, const char *label,
|
||||
false, this);
|
||||
|
||||
AddChild(fMenuBar);
|
||||
fMenuBar->AddItem(menu);
|
||||
fMenuBar->AddItem(new _BMCItem_(menu));
|
||||
|
||||
fMenuBar->SetFont(be_plain_font);
|
||||
|
||||
@@ -223,7 +221,7 @@ BMenuField::AllAttached()
|
||||
void
|
||||
BMenuField::MouseDown(BPoint where)
|
||||
{
|
||||
if (where.x > fDivider && !fMenuBar->Frame().Contains(where))
|
||||
if (!IsEnabled() || (where.x > fDivider && !fMenuBar->Frame().Contains(where)))
|
||||
return;
|
||||
|
||||
BRect bounds = fMenuBar->ConvertFromParent(Bounds());
|
||||
@@ -245,6 +243,9 @@ BMenuField::KeyDown(const char *bytes, int32 numBytes)
|
||||
case B_RIGHT_ARROW:
|
||||
case B_DOWN_ARROW:
|
||||
{
|
||||
if (!IsEnabled())
|
||||
break;
|
||||
|
||||
BRect bounds = fMenuBar->ConvertFromParent(Bounds());
|
||||
|
||||
fMenuBar->StartMenuBar(0, true, true, &bounds);
|
||||
|
||||
Reference in New Issue
Block a user