1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-23 08:20:01 +01:00

Don't give focus to search box when setting the reseting the text to empty string on OS X, otherwise it will get focus when it doesn't need to

This commit is contained in:
Arnaud Bienner 2015-09-21 00:21:39 +02:00
parent e83848edd1
commit bfe5042132

View File

@ -166,8 +166,10 @@ void QSearchField::setText(const QString &text)
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[pimpl->nsSearchField setStringValue:fromQString(text)]; [pimpl->nsSearchField setStringValue:fromQString(text)];
[pimpl->nsSearchField selectText:pimpl->nsSearchField]; if (!text.isEmpty()) {
[[pimpl->nsSearchField currentEditor] setSelectedRange:NSMakeRange([[pimpl->nsSearchField stringValue] length], 0)]; [pimpl->nsSearchField selectText:pimpl->nsSearchField];
[[pimpl->nsSearchField currentEditor] setSelectedRange:NSMakeRange([[pimpl->nsSearchField stringValue] length], 0)];
}
[pool drain]; [pool drain];
} }