[haiku-commits] haiku: hrev44047 - src/kits/interface

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 18 Apr 2012 02:53:04 +0200 (CEST)

hrev44047 adds 1 changeset to branch 'master'
old head: 9e195872df77517e2b21e12e3e2da77e2497533c
new head: 889692191d3374f5ad42e7b0d02a45e3dfd65294

----------------------------------------------------------------------------

8896921: Fix Deskcalc drawing rounded corners on the desktop as a replicant, 
although I am not sure why I'm even bothering at this point.

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev44047
Commit:      889692191d3374f5ad42e7b0d02a45e3dfd65294
URL:         http://cgit.haiku-os.org/haiku/commit/?id=8896921
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Wed Apr 18 00:52:32 2012 UTC

----------------------------------------------------------------------------

1 files changed, 16 insertions(+), 4 deletions(-)
src/kits/interface/ControlLook.cpp |   20 ++++++++++++++++----

----------------------------------------------------------------------------

diff --git a/src/kits/interface/ControlLook.cpp 
b/src/kits/interface/ControlLook.cpp
index 96dfea8..1665b5a 100644
--- a/src/kits/interface/ControlLook.cpp
+++ b/src/kits/interface/ControlLook.cpp
@@ -560,6 +560,7 @@ BControlLook::DrawScrollBarBackground(BView* view, BRect& 
rect1, BRect& rect2,
        DrawScrollBarBackground(view, rect2, updateRect, base, flags, 
orientation);
 }
 
+
 void
 BControlLook::DrawScrollBarBackground(BView* view, BRect& rect,
        const BRect& updateRect, const rgb_color& base, uint32 flags,
@@ -1920,10 +1921,12 @@ BControlLook::_DrawButtonFrame(BView* view, BRect& rect,
                defaultIndicatorTint = (B_NO_TINT + defaultIndicatorTint) / 2;
 
        rgb_color defaultIndicatorColor = tint_color(base, 
defaultIndicatorTint);
-       rgb_color cornerBgColor = background;
+       rgb_color cornerBgColor;
+
+       drawing_mode oldMode = view->DrawingMode();
 
        if ((flags & B_DEFAULT_BUTTON) != 0) {
-               // draw default button indicator
+               cornerBgColor = defaultIndicatorColor;
                edgeLightColor = _EdgeLightColor(defaultIndicatorColor,
                        contrast * ((flags & B_DISABLED) != 0 ? 0.3 : 0.8),
                        brightness * ((flags & B_DISABLED) != 0 ? 1.0 : 0.9), 
flags);
@@ -1931,8 +1934,7 @@ BControlLook::_DrawButtonFrame(BView* view, BRect& rect,
                        contrast * ((flags & B_DISABLED) != 0 ? 0.3 : 0.8),
                        brightness * ((flags & B_DISABLED) != 0 ? 1.0 : 0.9), 
flags);
 
-               cornerBgColor = defaultIndicatorColor;
-
+               // draw default button indicator
                view->SetHighColor(background);
                view->FillRect(rect);
                view->SetHighColor(base);
@@ -1946,6 +1948,14 @@ BControlLook::_DrawButtonFrame(BView* view, BRect& rect,
                view->StrokeRoundRect(rect, leftTopRadius, leftTopRadius);
                rect.InsetBy(1, 1);
        } else {
+               if ((flags & B_BLEND_FRAME) != 0) {
+                       cornerBgColor = (rgb_color){ background.red, 
background.blue,
+                               background.green, 0 };
+
+                       view->SetDrawingMode(B_OP_ALPHA);
+               } else
+                       cornerBgColor = background;
+
                edgeLightColor = _EdgeLightColor(background,
                        contrast * ((flags & B_DISABLED) != 0 ? 0.0 : 1.0),
                        brightness * 1.0, flags);
@@ -2021,6 +2031,8 @@ BControlLook::_DrawButtonFrame(BView* view, BRect& rect,
                        brightness * 1.0, flags, borders);
        }
 
+       view->SetDrawingMode(oldMode);
+
        // draw frame
        if ((flags & B_BLEND_FRAME) != 0) {
                drawing_mode oldDrawingMode = view->DrawingMode();


Other related posts:

  • » [haiku-commits] haiku: hrev44047 - src/kits/interface - jscipione