The MenuBar background is now drawn correctly when selected.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13319 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-06-28 15:11:58 +00:00
parent 843c11c953
commit 0c26ddbc29
1 changed files with 26 additions and 24 deletions

View File

@ -137,7 +137,9 @@ BMenuBar::Draw(BRect updateRect)
{ {
// TODO: implement additional border styles // TODO: implement additional border styles
if (IsEnabled()) { if (IsEnabled()) {
PushState(); // ToDo: this is a work-around for broken PushState()/PopState()
// PushState();
rgb_color color = HighColor();
BRect bounds(Bounds()); BRect bounds(Bounds());
// Restore the background of the previously selected menuitem // Restore the background of the previously selected menuitem
@ -155,10 +157,10 @@ BMenuBar::Draw(BRect updateRect)
StrokeLine(BPoint(0.0f, bounds.bottom), BPoint(bounds.right, bounds.bottom)); StrokeLine(BPoint(0.0f, bounds.bottom), BPoint(bounds.right, bounds.bottom));
StrokeLine(BPoint(bounds.right, 0.0f), BPoint(bounds.right, bounds.bottom)); StrokeLine(BPoint(bounds.right, 0.0f), BPoint(bounds.right, bounds.bottom));
PopState(); // PopState();
SetHighColor(color);
DrawItems(updateRect); DrawItems(updateRect);
} else { } else {
LayoutItems(0); LayoutItems(0);
Sync(); Sync();
@ -397,7 +399,8 @@ BMenuBar::Track(int32 *action, int32 startIndex, bool showMenu)
BMenuItem *resultItem = NULL; BMenuItem *resultItem = NULL;
BWindow *window = Window(); BWindow *window = Window();
int localAction = MENU_ACT_NONE; int localAction = MENU_ACT_NONE;
do {
while (true) {
bigtime_t snoozeAmount = 30000; bigtime_t snoozeAmount = 30000;
if (window->LockWithTimeout(200000) < B_OK) if (window->LockWithTimeout(200000) < B_OK)
break; break;
@ -437,8 +440,7 @@ BMenuBar::Track(int32 *action, int32 startIndex, bool showMenu)
if (snoozeAmount > 0) if (snoozeAmount > 0)
snooze(snoozeAmount); snooze(snoozeAmount);
}
} while (true);
if (window->Lock()) { if (window->Lock()) {
if (fSelected != NULL) if (fSelected != NULL)