Bug #1957

RCP: 0.7.8: Corpora view not scrolled to new corpus after clipboard import

Added by Matthieu Decorde almost 7 years ago. Updated over 4 years ago.

Status:New Start date:12/08/2016
Priority:Normal Due date:
Assignee:- % Done:

80%

Category:UI Spent time: -
Target version:TXM 0.8.0

Description

FR

le viewport de la vue Corpus ne montre pas le nouveau corpus ======================

Après un import presse-papier, l'icone du nouveau corpus est bien sélectionnée dans la view Corpus mais
le viewport n'est pas mis à jour pour que l'icone du nouveau corpus soit visible (j'imagine que c'est le cas pour tous les modules d'import).

Je ne sais pas si c'est pertinent mais voici le code que j'utilise pour forcer le viewport des éditeurs de texte à montrer le curseur courant ou une ligne particulière :

// set cursor at a specific offset
static setOffset(offset = 0, editor = editor) {
assert(editor != null)
editor = tuneEditor(editor)
def textv = editor.getAdapter(ITextOperationTarget.class)
textv.getTextWidget().setSelection(offset)
textv.revealRange(offset, 1)
}

// center cursor verticaly
static centerCursor(editor = editor) {
assert(editor != null)
editor = tuneEditor(editor)
def textv = editor.getAdapter(ITextOperationTarget.class)
def vtop = textv.getTopIndex()
def vbottom = textv.getBottomIndex()
def l = currentLineNumber(editor)
textv.setTopIndex(l-(vbottom-vtop)/2 as int)
}

// display the editor content
static setFocus(editor = editor) {
assert(editor != null)
editor = tuneEditor(editor)
centerCursor(editor)
editor.setFocus()
}

History

#1 Updated by Matthieu Decorde almost 7 years ago

  • Subject changed from RCP: 0.7.8: Corpora view not well updated after clipboard import to RCP: 0.7.8: Corpora view not scrolled to new corpus after clipboard import

#2 Updated by Matthieu Decorde over 6 years ago

  • Target version changed from TXM 0.7.8 to TXM 0.8.0a (split/restructuration)

#3 Updated by Sebastien Jacquot about 5 years ago

  • Target version changed from TXM 0.8.0a (split/restructuration) to TXM 0.8.0

#4 Updated by Matthieu Decorde over 4 years ago

  • % Done changed from 0 to 80

Also available in: Atom PDF