ControlLook: Check IsFocus() first

Otherwise we make two unnecessary function calls for every control
in a window where only one of them is the focus control.

Thanks Stippi.
This commit is contained in:
John Scipione 2013-08-13 13:05:01 -04:00
parent 59655dcbc4
commit d38ba8f7dd

View File

@ -87,8 +87,8 @@ BControlLook::Flags(BControl* control) const
if (!control->IsEnabled())
flags |= B_DISABLED;
if (control->Window() != NULL && control->Window()->IsActive()
&& control->IsFocus()) {
if (control->IsFocus() && control->Window() != NULL
&& control->Window()->IsActive()) {
flags |= B_FOCUSED;
}