Fix wxSearchCtrl appearance under OS X 10.10 Yosemite.
Avoid centered look which renders the control unusable under this version. See #16871.
This commit is contained in:
parent
4f69410cd8
commit
563329f89f
@ -165,7 +165,25 @@ public :
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
virtual void SetCentredLook( bool centre )
|
||||
{
|
||||
SEL sel = @selector(setCenteredLook:);
|
||||
if ( [m_searchFieldCell respondsToSelector: sel] )
|
||||
{
|
||||
// all this avoids xcode parsing warnings when using
|
||||
// [m_searchFieldCell setCenteredLook:NO];
|
||||
NSMethodSignature* signature =
|
||||
[NSSearchFieldCell instanceMethodSignatureForSelector:sel];
|
||||
NSInvocation* invocation =
|
||||
[NSInvocation invocationWithMethodSignature: signature];
|
||||
[invocation setTarget: m_searchFieldCell];
|
||||
[invocation setSelector:sel];
|
||||
[invocation setArgument:¢re atIndex:2];
|
||||
[invocation invoke];
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
wxNSSearchField* m_searchField;
|
||||
NSSearchFieldCell* m_searchFieldCell;
|
||||
@ -192,6 +210,7 @@ wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxSearchCtrl* wxpeer,
|
||||
|
||||
wxNSSearchFieldControl* c = new wxNSSearchFieldControl( wxpeer, v );
|
||||
c->SetNeedsFrame( false );
|
||||
c->SetCentredLook( false );
|
||||
c->SetStringValue( str );
|
||||
return c;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user