macOS: Simplify validAttributesForMarkedText

We don't need to condition this on IM enablement. The attributes are
only used if we are actually marking text, which only happens for IM
enabled views.

Pick-to: 6.2
Change-Id: I47377cf53cf2bf44a1d9513d317f82c73f083fa3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Tor Arne Vestbø 2021-08-19 16:57:54 +02:00
parent 70df6052d8
commit 993d8025dc

View File

@ -183,16 +183,7 @@
- (NSArray<NSString *> *)validAttributesForMarkedText
{
if (!m_platformWindow)
return nil;
if (m_platformWindow->window() != QGuiApplication::focusWindow())
return nil;
if (queryInputMethod(m_platformWindow->window()->focusObject()))
return @[NSUnderlineColorAttributeName, NSUnderlineStyleAttributeName];
else
return nil;
return @[NSUnderlineColorAttributeName, NSUnderlineStyleAttributeName];
}
- (BOOL)hasMarkedText