Opened 15 years ago

Closed 15 years ago

#5440 closed bug (fixed)

[Interface Kit] empty space between selected item and menu item separator is 1px more than necessary

Reported by: diver Owned by: axeld
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Tested with hrev35548 in VirtualBox 3.0.12.

Attachments (1)

Deskbar.png (21.2 KB ) - added by diver 15 years ago.

Download all attachments as: .zip

Change History (4)

by diver, 15 years ago

Attachment: Deskbar.png added

comment:1 by diver, 15 years ago

Version: R1/alpha1R1/Development

comment:2 by jackburton, 15 years ago

One of the problem, I think, is that, while the separator height changes with the font size, the actual drawing is always just 2 horizontal lines:

void
BSeparatorItem::GetContentSize(float* _width, float* _height)
{
	if (_width != NULL)
		*_width = 2.0;

	if (_height != NULL) {
		BFont font(be_plain_font);
		if (Menu())
			Menu()->GetFont(&font);
		*_height = floorf(font.Size() * 0.8);
	}
}

BSeparatorItem::Draw():

	menu->SetHighColor(tint_color(lowColor, B_DARKEN_1_TINT));
	menu->StrokeLine(BPoint(bounds.left + 1.0f, bounds.top + 4.0f),
		BPoint(bounds.right - 1.0f, bounds.top + 4.0f));
	menu->SetHighColor(tint_color(lowColor, B_LIGHTEN_2_TINT));
	menu->StrokeLine(BPoint(bounds.left + 1.0f, bounds.top + 5.0f),
		BPoint(bounds.right - 1.0f, bounds.top + 5.0f));

So, either we use a fixed size for the separator item, or change some code in its drawing (and also in BMenu drawing code, I think), to accomodate the variable sized separator.

comment:3 by jackburton, 15 years ago

Resolution: fixed
Status: newclosed

Should be fixed in hrev35856,

Note: See TracTickets for help on using tickets.