[haiku-commits] r39648 - haiku/trunk/src/servers/app

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 26 Nov 2010 15:52:56 +0100 (CET)

Author: bonefish
Date: 2010-11-26 15:52:56 +0100 (Fri, 26 Nov 2010)
New Revision: 39648
Changeset: http://dev.haiku-os.org/changeset/39648

Modified:
   haiku/trunk/src/servers/app/DefaultDecorator.cpp
   haiku/trunk/src/servers/app/DefaultDecorator.h
Log:
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.


Modified: haiku/trunk/src/servers/app/DefaultDecorator.cpp
===================================================================
--- haiku/trunk/src/servers/app/DefaultDecorator.cpp    2010-11-26 13:55:20 UTC 
(rev 39647)
+++ haiku/trunk/src/servers/app/DefaultDecorator.cpp    2010-11-26 14:52:56 UTC 
(rev 39648)
@@ -242,6 +242,29 @@
 }
 
 
+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 @@
 }
 
 
-
 void
 DefaultDecorator::_GetComponentColors(Component component,
        ComponentColors _colors)

Modified: haiku/trunk/src/servers/app/DefaultDecorator.h
===================================================================
--- haiku/trunk/src/servers/app/DefaultDecorator.h      2010-11-26 13:55:20 UTC 
(rev 39647)
+++ haiku/trunk/src/servers/app/DefaultDecorator.h      2010-11-26 14:52:56 UTC 
(rev 39648)
@@ -40,6 +40,9 @@
 
        virtual Region                          RegionAt(BPoint where) const;
 
+       virtual bool                            SetRegionHighlight(Region 
region,
+                                                                       uint8 
highlight, BRegion* dirty);
+
        virtual void                            ExtendDirtyRegion(Region region,
                                                                        
BRegion& dirty);
 


Other related posts:

  • » [haiku-commits] r39648 - haiku/trunk/src/servers/app - ingo_weinhold