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:
parent
e83848edd1
commit
bfe5042132
6
3rdparty/qocoa/qsearchfield_mac.mm
vendored
6
3rdparty/qocoa/qsearchfield_mac.mm
vendored
@ -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];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user