void PrettyImageView::AddImage(const QUrl& url) { PrettyImage* image = new PrettyImage(url, network_, container_); connect(image, SIGNAL(destroyed()), SLOT(ScrollToCurrent())); connect(image, SIGNAL(Loaded()), SLOT(ScrollToCurrent())); layout_->insertWidget(layout_->count() - 1, image); if (current_index_ == -1) ScrollTo(0); }
// back-end, now that a wrapper is provided for the front-end code to do the actual scrolling void MemoContentUpdated () { int caretPos; if(lastCurrent <= currLast) DoHighlight( lastCurrent, FALSE ); lastFirst = currFirst; lastLast = currLast; lastCurrent = currCurrent; lastGames = storedGames; lastLastMove[0] = '\0'; if( lastLast > 0 ) { safeStrCpy( lastLastMove, SavePart( currMovelist[lastLast-1] ) , sizeof( lastLastMove)/sizeof( lastLastMove[0]) ); } /* Deselect any text, move caret to end of memo */ if( currCurrent >= 0 ) { caretPos = histMoves[currCurrent].memoOffset + histMoves[currCurrent].memoLength; } else { caretPos = -1; } ScrollToCurrent(caretPos); DoHighlight( currCurrent, TRUE ); // [HGM] moved last, because in X some scrolling methods spoil highlighting }
// back-end, now that a wrapper is provided for the front-end code to do the actual scrolling void MemoContentUpdated() { int caretPos; DoHighlight( lastCurrent, FALSE ); DoHighlight( currCurrent, TRUE ); lastFirst = currFirst; lastLast = currLast; lastCurrent = currCurrent; lastLastMove[0] = '\0'; if( lastLast > 0 ) { safeStrCpy( lastLastMove, SavePart( currMovelist[lastLast-1] ) , sizeof( lastLastMove)/sizeof( lastLastMove[0]) ); } /* Deselect any text, move caret to end of memo */ if( currCurrent >= 0 ) { caretPos = histMoves[currCurrent].memoOffset + histMoves[currCurrent].memoLength; } else { caretPos = -1; } ScrollToCurrent(caretPos); }