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

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 12 Aug 2013 22:01:29 +0200 (CEST)

hrev45963 adds 1 changeset to branch 'master'
old head: 90b145cc39262ca905546c6277040cd059371352
new head: 59655dcbc40dabc1a197275241ac7d3b9ccd92dd
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=59655dc+%5E90b145c

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

59655dc: Update control focus flag. Fixes #9915
  
  Parent window must be active for control to draw as focused. This
  affects all controls that draw their focus ring using ControlLook
  including but not limited to BButton, BCheckBox, and BRadioButton.
  
  I won't pretend to know what is "right" but the behavior now matches
  BeOS R5.

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

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

Revision:    hrev45963
Commit:      59655dcbc40dabc1a197275241ac7d3b9ccd92dd
URL:         http://cgit.haiku-os.org/haiku/commit/?id=59655dc
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Mon Aug 12 19:56:39 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/9915

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

1 file changed, 3 insertions(+), 1 deletion(-)
src/kits/interface/ControlLook.cpp | 4 +++-

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

diff --git a/src/kits/interface/ControlLook.cpp 
b/src/kits/interface/ControlLook.cpp
index bd44d4f..3642300 100644
--- a/src/kits/interface/ControlLook.cpp
+++ b/src/kits/interface/ControlLook.cpp
@@ -87,8 +87,10 @@ BControlLook::Flags(BControl* control) const
        if (!control->IsEnabled())
                flags |= B_DISABLED;
 
-       if (control->IsFocus())
+       if (control->Window() != NULL && control->Window()->IsActive()
+               && control->IsFocus()) {
                flags |= B_FOCUSED;
+       }
 
        if (control->Value() == B_CONTROL_ON)
                flags |= B_ACTIVATED;


Other related posts: