Flush the bitmap caches for the zoom and close button, when their hightlight

changes. Fixes that the buttons were not drawn with the right color when the
S&T tab highlight was active.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39648 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-11-26 14:52:56 +00:00
parent 07655104d5
commit 37ba7e5389
2 changed files with 26 additions and 1 deletions

View File

@ -242,6 +242,29 @@ DefaultDecorator::RegionAt(BPoint where) const
}
bool
DefaultDecorator::SetRegionHighlight(Region region, uint8 highlight,
BRegion* dirty)
{
// Invalidate the bitmap caches for the close/zoom button, when the
// highlight changes.
switch (region) {
case REGION_CLOSE_BUTTON:
if (highlight != RegionHighlight(region))
memset(&fCloseBitmaps, 0, sizeof(fCloseBitmaps));
break;
case REGION_ZOOM_BUTTON:
if (highlight != RegionHighlight(region))
memset(&fZoomBitmaps, 0, sizeof(fZoomBitmaps));
break;
default:
break;
}
return Decorator::SetRegionHighlight(region, highlight, dirty);
}
void
DefaultDecorator::ExtendDirtyRegion(Region region, BRegion& dirty)
{
@ -1500,7 +1523,6 @@ DefaultDecorator::_GetBitmapForButton(Component item, bool down, int32 width,
}
void
DefaultDecorator::_GetComponentColors(Component component,
ComponentColors _colors)

View File

@ -40,6 +40,9 @@ public:
virtual Region RegionAt(BPoint where) const;
virtual bool SetRegionHighlight(Region region,
uint8 highlight, BRegion* dirty);
virtual void ExtendDirtyRegion(Region region,
BRegion& dirty);