[haiku-commits] Change in haiku[master]: Pass B_ACTIVATED flag from BScrollBar to control look on down button

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 4 May 2020 21:45:20 +0000

From John Scipione <jscipione@xxxxxxxxx>:

John Scipione has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2577 ;)


Change subject: Pass B_ACTIVATED flag from BScrollBar to control look on down 
button
......................................................................

Pass B_ACTIVATED flag from BScrollBar to control look on down button

DrawScrollBarButton passes B_ACTIVATED flag to HaikuControlLook which
draws the button as down.

This regression was introduced in hrev54032.

Fixes #15960
---
M src/kits/interface/ScrollBar.cpp
1 file changed, 30 insertions(+), 14 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/77/2577/1

diff --git a/src/kits/interface/ScrollBar.cpp b/src/kits/interface/ScrollBar.cpp
index 963d7be..2ad9d65 100644
--- a/src/kits/interface/ScrollBar.cpp
+++ b/src/kits/interface/ScrollBar.cpp
@@ -411,20 +411,26 @@
                        rect.left + rect.Height(), rect.bottom);

                be_control_look->DrawScrollBarButton(this, buttonFrame, 
updateRect,
-                       base, flags, BControlLook::B_LEFT_ARROW, fOrientation,
+                       base, flags | (fPrivateData->fButtonDown == ARROW1
+                               ? BControlLook::B_ACTIVATED : 0),
+                       BControlLook::B_LEFT_ARROW, fOrientation,
                        fPrivateData->fButtonDown == ARROW1);

                if (doubleArrows) {
                        buttonFrame.OffsetBy(rect.Height() + 1, 0.0f);
-                       be_control_look->DrawScrollBarButton(this, buttonFrame,
-                               updateRect, base, flags, 
BControlLook::B_RIGHT_ARROW,
-                               fOrientation, fPrivateData->fButtonDown == 
ARROW2);
+                       be_control_look->DrawScrollBarButton(this, buttonFrame, 
updateRect,
+                               base, flags | (fPrivateData->fButtonDown == 
ARROW2
+                                       ? BControlLook::B_ACTIVATED : 0),
+                               BControlLook::B_RIGHT_ARROW, fOrientation,
+                               fPrivateData->fButtonDown == ARROW2);

                        buttonFrame.OffsetTo(rect.right - ((rect.Height() * 2) 
+ 1),
                                rect.top);
-                       be_control_look->DrawScrollBarButton(this, buttonFrame,
-                               updateRect, base, flags, 
BControlLook::B_LEFT_ARROW,
-                               fOrientation, fPrivateData->fButtonDown == 
ARROW3);
+                       be_control_look->DrawScrollBarButton(this, buttonFrame, 
updateRect,
+                               base, flags | (fPrivateData->fButtonDown == 
ARROW3
+                                       ? BControlLook::B_ACTIVATED : 0),
+                               BControlLook::B_LEFT_ARROW, fOrientation,
+                               fPrivateData->fButtonDown == ARROW3);

                        thumbBG.left += rect.Height() * 2 + 2;
                        thumbBG.right -= rect.Height() * 2 + 2;
@@ -435,27 +441,35 @@

                buttonFrame.OffsetTo(rect.right - rect.Height(), rect.top);
                be_control_look->DrawScrollBarButton(this, buttonFrame, 
updateRect,
-                       base, flags, BControlLook::B_RIGHT_ARROW, fOrientation,
+                       base, flags | (fPrivateData->fButtonDown == ARROW4
+                               ? BControlLook::B_ACTIVATED : 0),
+                       BControlLook::B_RIGHT_ARROW, fOrientation,
                        fPrivateData->fButtonDown == ARROW4);
        } else {
                BRect buttonFrame(rect.left, rect.top, rect.right,
                        rect.top + rect.Width());

                be_control_look->DrawScrollBarButton(this, buttonFrame, 
updateRect,
-                       base, flags, BControlLook::B_UP_ARROW, fOrientation,
+                       base, flags | (fPrivateData->fButtonDown == ARROW1
+                               ? BControlLook::B_ACTIVATED : 0),
+                       BControlLook::B_UP_ARROW, fOrientation,
                        fPrivateData->fButtonDown == ARROW1);
 
                if (doubleArrows) {
                        buttonFrame.OffsetBy(0, rect.Width() + 1);
                        be_control_look->DrawScrollBarButton(this, buttonFrame,
-                               updateRect, base, flags, 
BControlLook::B_DOWN_ARROW,
-                               fOrientation, fPrivateData->fButtonDown == 
ARROW2);
+                               updateRect, base, flags | 
(fPrivateData->fButtonDown == ARROW2
+                                       ? BControlLook::B_ACTIVATED : 0),
+                               BControlLook::B_DOWN_ARROW, fOrientation,
+                               fPrivateData->fButtonDown == ARROW2);

                        buttonFrame.OffsetTo(rect.left, rect.bottom
                                - ((rect.Width() * 2) + 1));
                        be_control_look->DrawScrollBarButton(this, buttonFrame,
-                               updateRect, base, flags, 
BControlLook::B_UP_ARROW,
-                               fOrientation, fPrivateData->fButtonDown == 
ARROW3);
+                               updateRect, base, flags | 
(fPrivateData->fButtonDown == ARROW3
+                                       ? BControlLook::B_ACTIVATED : 0),
+                               BControlLook::B_UP_ARROW, fOrientation,
+                               fPrivateData->fButtonDown == ARROW3);

                        thumbBG.top += rect.Width() * 2 + 2;
                        thumbBG.bottom -= rect.Width() * 2 + 2;
@@ -466,7 +480,9 @@

                buttonFrame.OffsetTo(rect.left, rect.bottom - rect.Width());
                be_control_look->DrawScrollBarButton(this, buttonFrame, 
updateRect,
-                       base, flags, BControlLook::B_DOWN_ARROW, fOrientation,
+                       base, flags | (fPrivateData->fButtonDown == ARROW4
+                               ? BControlLook::B_ACTIVATED : 0),
+                       BControlLook::B_DOWN_ARROW, fOrientation,
                        fPrivateData->fButtonDown == ARROW4);
        }


--
To view, visit https://review.haiku-os.org/c/haiku/+/2577
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I87dbaa9e8c9169c67dd7cb463d3604d9727ae28f
Gerrit-Change-Number: 2577
Gerrit-PatchSet: 1
Gerrit-Owner: John Scipione <jscipione@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: Pass B_ACTIVATED flag from BScrollBar to control look on down button - Gerrit