Opened 10 years ago

Closed 5 years ago

#3970 closed bug (fixed)

B[Outline]ListView Redraw problems

Reported by: darkwyrm Owned by: axeld
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

There seems to be a problem with either BListView or BOutlineListView redraw when using BListView::InvalidateItem. It can be reproduced simply by running Paladin and compiling a project.

As files are compiled, they should be lighting up in blue, but as of hrev30852, they are not. This has been a problem for quite a while, but I just now got around to filing the report. Clicking on Force Rebuild from the Build menu should cause all visible items in the project to be redrawn in a light gray color, and this doesn't happen either. In both instances, the code in Paladin is iterating over the items and calling InvalidateItem().

This issue does not occur in R5 or Zeta.

Change History (2)

comment:1 by darkwyrm, 10 years ago

I've nailed down the exact problem. It actually is a result of the particular implementation of BStringItem in Haiku.

void
SourceFileItem::DrawItem(BView *owner, BRect frame, bool complete)
{
	rgb_color color = owner->HighColor();
	
	owner->SetFont(be_plain_font);
	switch (fDisplayState)
	{
		case SFITEM_MISSING:
		{
			owner->SetHighColor(0,0,0);
			BFont italics;
			italics.SetFace(B_ITALIC_FACE);
			owner->SetFont(&italics);
			break;
		}
		case SFITEM_BUILDING:
		{
			if (color.red != 0 || color.green != 0 || color.blue != 255)
				owner->SetHighColor(0,0,255);
			break;
		}
		case SFITEM_NEEDS_BUILD:
		{
			if(IsSelected())
				owner->SetHighColor(255,255,255);
			else
				owner->SetHighColor(144,144,144);
			break;
		}
		default:
		{
			if (color.red != 0 || color.green != 0 || color.blue != 0)
				owner->SetHighColor(0,0,0);
			break;
		}
	}
	
	BStringItem::DrawItem(owner,frame,complete);
}

When the above code is executed on R5 or Zeta, setting the high color before calling the parent class' DrawItem method results in drawing the item with the color set before the call is made. Haiku's implementation differs in that it modifies the high color before the string is drawn. In short, this is a behavioral difference in Haiku from R5/Zeta.

comment:2 by pulkomandy, 5 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev48478.

Note: See TracTickets for help on using tickets.