* Added a BWindow::InViewTransaction() that determines whether or not the

window is currently updating its drawings as suggested by Stippi.
* Add this method to decide whether to call _FontChanged() in
  BListView::SetFont().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34109 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-11-18 10:48:44 +00:00
parent 289d85d2ac
commit 09749e95dc
3 changed files with 12 additions and 4 deletions

View File

@ -185,6 +185,7 @@ public:
void EndViewTransaction();
// referred as CommitViewTransaction()
// in BeBook
bool InViewTransaction() const;
BRect Bounds() const;
BRect Frame() const;

View File

@ -655,10 +655,9 @@ void
BListView::SetFont(const BFont* font, uint32 mask)
{
BView::SetFont(font, mask);
//_FontChanged();
// TODO: this absolutely kills the performance, if a BListItem
// changes the font when drawing - if this should be called at all,
// it should only be done outside any updates!
if (Window() != NULL && !Window()->InViewTransaction())
_FontChanged();
}

View File

@ -682,6 +682,14 @@ BWindow::EndViewTransaction()
}
bool
BWindow::InViewTransaction() const
{
BAutolock locker(const_cast<BWindow*>(this));
return fInTransaction;
}
bool
BWindow::IsFront() const
{