Opened 20 months ago

#14401 new bug

BMenu::DrawBackground contains unused code

Reported by: ahwayakchih Owned by: nobody
Priority: low Milestone: Unscheduled
Component: Kits/Interface Kit Version: R1/Development
Keywords: BMenu, be_control_look Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


I'm new to the BControlLooks stuff, so i'm sorry if i'm mistaken, but it looks like BMenu::DrawBackground prepares flags that it never uses.

At there is:

	uint32 flags = 0;
	if (!IsEnabled())
		flags |= BControlLook::B_DISABLED;

	if (IsFocus())
		flags |= BControlLook::B_FOCUSED;

and then at there is:

be_control_look->DrawMenuBackground(this, rect, updateRect, base, 0,

flags is not used at all.

I noticed that because in my old code, i was drawing menu item background by calling FillRect with HighColor set to B_MENU_BACKGROUND_COLOR and on Haiku it kept showing up a tiny bit darker than the menu that does not use custom draw logic. So i looked into the BMenu sources to check how it draws background by default :). Looks like be_control_look changes something, even though in system theme i have menu color set to default (216,216,216).

Change History (0)

Note: See TracTickets for help on using tickets.