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:
@@ -87,8 +87,8 @@ BControlLook::Flags(BControl* control) const
|
|||||||
if (!control->IsEnabled())
|
if (!control->IsEnabled())
|
||||||
flags |= B_DISABLED;
|
flags |= B_DISABLED;
|
||||||
|
|
||||||
if (control->Window() != NULL && control->Window()->IsActive()
|
if (control->IsFocus() && control->Window() != NULL
|
||||||
&& control->IsFocus()) {
|
&& control->Window()->IsActive()) {
|
||||||
flags |= B_FOCUSED;
|
flags |= B_FOCUSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user