mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
UniversalEntry: fix input method issue on macOS
This commit is contained in:
parent
c302cd3bfc
commit
b63e5def85
@ -3093,9 +3093,18 @@ void VMainWindow::initUniversalEntry()
|
|||||||
{
|
{
|
||||||
m_ue = new VUniversalEntry(this);
|
m_ue = new VUniversalEntry(this);
|
||||||
m_ue->hide();
|
m_ue->hide();
|
||||||
|
|
||||||
|
#if defined(Q_OS_MACOS) || defined(Q_OS_MAC)
|
||||||
|
// Qt::Popup on macOS does not work well with input method.
|
||||||
|
m_ue->setWindowFlags(Qt::Tool
|
||||||
|
| Qt::NoDropShadowWindowHint);
|
||||||
|
m_ue->setWindowModality(Qt::ApplicationModal);
|
||||||
|
#else
|
||||||
m_ue->setWindowFlags(Qt::Popup
|
m_ue->setWindowFlags(Qt::Popup
|
||||||
| Qt::FramelessWindowHint
|
| Qt::FramelessWindowHint
|
||||||
| Qt::NoDropShadowWindowHint);
|
| Qt::NoDropShadowWindowHint);
|
||||||
|
#endif
|
||||||
|
|
||||||
connect(m_ue, &VUniversalEntry::exited,
|
connect(m_ue, &VUniversalEntry::exited,
|
||||||
this, [this]() {
|
this, [this]() {
|
||||||
m_captain->setCaptainModeEnabled(true);
|
m_captain->setCaptainModeEnabled(true);
|
||||||
|
@ -274,6 +274,10 @@ void VUniversalEntry::keyPressEvent(QKeyEvent *p_event)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Qt::Key_Escape:
|
||||||
|
hide();
|
||||||
|
return;
|
||||||
|
|
||||||
// Up/Down Ctrl+K/J to navigate to next item.
|
// Up/Down Ctrl+K/J to navigate to next item.
|
||||||
case Qt::Key_Up:
|
case Qt::Key_Up:
|
||||||
forward = false;
|
forward = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user