mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
Type picker: skip I-beam cursor, set arrow on popup
This commit is contained in:
@@ -993,12 +993,14 @@ bool RcxEditor::beginInlineEdit(EditTarget target, int line) {
|
|||||||
m_sci->SendScintilla(QsciScintillaBase::SCI_SETUNDOCOLLECTION, (long)0);
|
m_sci->SendScintilla(QsciScintillaBase::SCI_SETUNDOCOLLECTION, (long)0);
|
||||||
m_sci->SendScintilla(QsciScintillaBase::SCI_SETCARETWIDTH, 1);
|
m_sci->SendScintilla(QsciScintillaBase::SCI_SETCARETWIDTH, 1);
|
||||||
m_sci->setReadOnly(false);
|
m_sci->setReadOnly(false);
|
||||||
// Switch to I-beam for editing
|
// Switch to I-beam for editing (skip for Type which uses dropdown picker)
|
||||||
if (m_cursorOverridden) {
|
if (target != EditTarget::Type) {
|
||||||
QApplication::changeOverrideCursor(Qt::IBeamCursor);
|
if (m_cursorOverridden) {
|
||||||
} else {
|
QApplication::changeOverrideCursor(Qt::IBeamCursor);
|
||||||
QApplication::setOverrideCursor(Qt::IBeamCursor);
|
} else {
|
||||||
m_cursorOverridden = true;
|
QApplication::setOverrideCursor(Qt::IBeamCursor);
|
||||||
|
m_cursorOverridden = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-enable selection rendering for inline edit
|
// Re-enable selection rendering for inline edit
|
||||||
@@ -1141,6 +1143,16 @@ void RcxEditor::showTypeListFiltered(const QString& filter) {
|
|||||||
m_sci->SendScintilla(QsciScintillaBase::SCI_AUTOCSETSEPARATOR, (long)' ');
|
m_sci->SendScintilla(QsciScintillaBase::SCI_AUTOCSETSEPARATOR, (long)' ');
|
||||||
m_sci->SendScintilla(QsciScintillaBase::SCI_USERLISTSHOW,
|
m_sci->SendScintilla(QsciScintillaBase::SCI_USERLISTSHOW,
|
||||||
(uintptr_t)1, list.constData());
|
(uintptr_t)1, list.constData());
|
||||||
|
|
||||||
|
// Set arrow cursor on the autocomplete popup (it defaults to pointing hand)
|
||||||
|
for (QObject* child : m_sci->children()) {
|
||||||
|
if (auto* w = qobject_cast<QWidget*>(child)) {
|
||||||
|
if (w->isVisible() && w->windowFlags() & Qt::Popup) {
|
||||||
|
w->setCursor(Qt::ArrowCursor);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RcxEditor::updateTypeListFilter() {
|
void RcxEditor::updateTypeListFilter() {
|
||||||
|
|||||||
Reference in New Issue
Block a user