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