Changeset View
Changeset View
Standalone View
Standalone View
src/view/kateviewinternal.cpp
Show First 20 Lines • Show All 2841 Lines • ▼ Show 20 Line(s) | |||||
2842 | { | 2842 | { | ||
2843 | KTextEditor::Cursor newPosition = coordinatesToCursor(e->pos(), false); | 2843 | KTextEditor::Cursor newPosition = coordinatesToCursor(e->pos(), false); | ||
2844 | if (newPosition != m_mouse) { | 2844 | if (newPosition != m_mouse) { | ||
2845 | m_mouse = newPosition; | 2845 | m_mouse = newPosition; | ||
2846 | mouseMoved(); | 2846 | mouseMoved(); | ||
2847 | } | 2847 | } | ||
2848 | 2848 | | |||
2849 | if (e->buttons() == Qt::NoButton) { | 2849 | if (e->buttons() == Qt::NoButton) { | ||
2850 | const auto noteData = inlineNoteAt(e->globalPos()); | 2850 | auto noteData = inlineNoteAt(e->globalPos()); | ||
2851 | const KTextEditor::InlineNote note(noteData); | 2851 | if (noteData.m_position.isValid()) { | ||
2852 | const KTextEditor::InlineNote activeNote(m_activeInlineNote); | 2852 | if (!m_activeInlineNote.m_position.isValid()) { | ||
2853 | if (note.position().isValid()) { | | |||
2854 | if (!activeNote.position().isValid()) { | | |||
2855 | // no active note -- focus in | 2853 | // no active note -- focus in | ||
2856 | note.provider()->inlineNoteFocusInEvent(note, e->globalPos()); | 2854 | noteData.m_underMouse = true; | ||
2855 | noteData.m_provider->inlineNoteFocusInEvent(KTextEditor::InlineNote(noteData), e->globalPos()); | ||||
2857 | m_activeInlineNote = noteData; | 2856 | m_activeInlineNote = noteData; | ||
2858 | } else { | 2857 | } else { | ||
2859 | note.provider()->inlineNoteMouseMoveEvent(note, e->globalPos()); | 2858 | noteData.m_provider->inlineNoteMouseMoveEvent(KTextEditor::InlineNote(noteData), e->globalPos()); | ||
2860 | } | 2859 | } | ||
2861 | // the note might change its appearance in result to the event | 2860 | // the note might change its appearance in result to the event | ||
2862 | tagLines(note.position(), note.position(), true); | 2861 | tagLines(noteData.m_position, noteData.m_position, true); | ||
2863 | } else if (activeNote.position().isValid()) { | 2862 | } else if (m_activeInlineNote.m_position.isValid()) { | ||
2864 | activeNote.provider()->inlineNoteFocusOutEvent(activeNote); | 2863 | m_activeInlineNote.m_underMouse = false; | ||
2865 | tagLines(activeNote.position(), activeNote.position(), true); | 2864 | m_activeInlineNote.m_provider->inlineNoteFocusOutEvent(KTextEditor::InlineNote(m_activeInlineNote)); | ||
2865 | tagLines(m_activeInlineNote.m_position, m_activeInlineNote.m_position, true); | ||||
2866 | m_activeInlineNote = {}; | 2866 | m_activeInlineNote = {}; | ||
2867 | } | 2867 | } | ||
2868 | } | 2868 | } | ||
2869 | 2869 | | |||
2870 | if (e->buttons() & Qt::LeftButton) { | 2870 | if (e->buttons() & Qt::LeftButton) { | ||
2871 | if (m_dragInfo.state == diPending) { | 2871 | if (m_dragInfo.state == diPending) { | ||
2872 | // we had a mouse down, but haven't confirmed a drag yet | 2872 | // we had a mouse down, but haven't confirmed a drag yet | ||
2873 | // if the mouse has moved sufficiently, we will confirm | 2873 | // if the mouse has moved sufficiently, we will confirm | ||
▲ Show 20 Lines • Show All 1022 Lines • Show Last 20 Lines |