21 #ifdef QTOX_PLATFORM_EXT
24 #include <QCoreApplication>
27 #if defined(QTOX_PLATFORM_EXT) && !defined(Q_OS_OSX)
28 #define ENABLE_CAPSLOCK_INDICATOR
35 , action(new QAction(this))
37 setEchoMode(QLineEdit::Password);
39 #ifdef ENABLE_CAPSLOCK_INDICATOR
40 action->setIcon(QIcon(
":img/caps_lock.svg"));
41 action->setToolTip(tr(
"CAPS-LOCK ENABLED"));
42 addAction(
action, QLineEdit::TrailingPosition);
53 #ifdef ENABLE_CAPSLOCK_INDICATOR
63 #ifdef ENABLE_CAPSLOCK_INDICATOR
78 #ifdef ENABLE_CAPSLOCK_INDICATOR
79 action->setVisible(Platform::capsLockEnabled());
89 #ifdef ENABLE_CAPSLOCK_INDICATOR
92 QCoreApplication::instance()->installEventFilter(
this);
97 QCoreApplication::instance()->removeEventFilter(
this);
102 bool caps = Platform::capsLockEnabled();
104 for (QAction*
action : actions)
110 switch (event->type()) {
111 case QEvent::WindowActivate:
112 case QEvent::KeyRelease:
119 return QObject::eventFilter(obj, event);
121 #endif // ENABLE_CAPSLOCK_INDICATOR