D26840: Correctly set underMouse() for inline notes

Sven Brauch noreply at phabricator.kde.org
Fri Jan 24 20:56:51 GMT 2020


brauch added a comment.


  I'm sorry, updateView is the wrong function to call, you need updateDirty. I tried it out, like this it works:
  
    if (e->buttons() == Qt::NoButton) {
        auto noteData = inlineNoteAt(e->globalPos());
        if (noteData.m_position.isValid()) {
            if (!m_activeInlineNote.m_position.isValid()) {
                // no active note -- focus in
                tagLine(noteData.m_position);
                updateDirty();
                noteData.m_underMouse = true;
                noteData.m_provider->inlineNoteFocusInEvent(KTextEditor::InlineNote(noteData), e->globalPos());
                m_activeInlineNote = noteData;
            } else {
                noteData.m_provider->inlineNoteMouseMoveEvent(KTextEditor::InlineNote(noteData), e->globalPos());
            }
        } else if (m_activeInlineNote.m_position.isValid()) {
            tagLine(m_activeInlineNote.m_position);
            updateDirty();
            m_activeInlineNote.m_underMouse = false;
            m_activeInlineNote.m_provider->inlineNoteFocusOutEvent(KTextEditor::InlineNote(m_activeInlineNote));
            m_activeInlineNote = {};
        }
    }

REPOSITORY
  R39 KTextEditor

BRANCH
  underMouse (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D26840

To: davidre, #ktexteditor, cullmann
Cc: brauch, cullmann, kwrite-devel, kde-frameworks-devel, rrosch, LeGast00n, GB_2, domson, michaelh, ngraham, bruns, demsking, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20200124/0b8eff80/attachment-0001.html>


More information about the KWrite-Devel mailing list