Skip to content

Commit

Permalink
Track property editor: enforce I cursor, hide while typing
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Jan 31, 2025
1 parent 531ad2d commit ee8313d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/widget/wtrackproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@ bool WTrackPropertyEditor::eventFilter(QObject* pObj, QEvent* pEvent) {
ControlObject::set(ConfigKey("[Library]", "refocus_prev_widget"), 1);
return true;
default:
// Hide mouse cursor while typing
// TODO Test if this now works on Windows, see comment in
// widget/knobeventhandler.h
setCursor(Qt::BlankCursor);
break;
}
} else if (pEvent->type() == QEvent::FocusOut) {
Expand All @@ -375,6 +379,16 @@ bool WTrackPropertyEditor::eventFilter(QObject* pObj, QEvent* pEvent) {
emit commitEditorData(text());
}
}
} else if (pEvent->type() == QEvent::MouseMove ||
pEvent->type() == QEvent::MouseButtonPress ||
pEvent->type() == QEvent::Show ||
pEvent->type() == QEvent::Enter) {
// Some desktop environments show the I cursor initially
// but fall back to regular pointer on mouse move.
// Enforce I cursor while editing.
setCursor(Qt::IBeamCursor);
} else if (pEvent->type() == QEvent::Leave) {
unsetCursor();
}
return QLineEdit::eventFilter(pObj, pEvent);
}

0 comments on commit ee8313d

Please sign in to comment.