logic: Return to last scroll position in code view on undo

* fixed scrolling on undo
* refactored autoscrolling in code view
* save scroll position of user with MessageScrollCode
This commit is contained in:
Eberhard Graether
2016-01-29 13:08:30 +01:00
parent 427c94457b
commit ead0abfba2
20 changed files with 240 additions and 91 deletions
+10 -2
View File
@@ -55,8 +55,7 @@ public:
void showActiveTokenIds();
bool scrollToFirstActiveSnippet();
void expandActiveSnippetFile();
void showFirstActiveSnippet(bool scrollTo);
void focusTokenIds(const std::vector<Id>& focusedTokenIds);
void defocusTokenIds();
@@ -66,15 +65,21 @@ public:
void setFileMaximized(const FilePath path);
void showContents();
void scrollToValue(int value);
void scrollToActiveFileIfRequested();
private slots:
void scrolled(int value);
void scrollToSnippet(QtCodeSnippet* snippet);
void setValue();
private:
QtCodeFile* getFile(const FilePath filePath);
QtCodeSnippet* getFirstActiveSnippet() const;
void updateFiles();
void expandActiveSnippetFile(bool scrollTo);
void ensureWidgetVisibleAnimated(QWidget *childWidget, QRectF rect);
std::shared_ptr<QFrame> m_frame;
@@ -83,6 +88,9 @@ private:
std::vector<Id> m_activeTokenIds;
std::vector<Id> m_focusedTokenIds;
std::vector<std::string> m_errorMessages;
QtCodeFile* m_scrollToFile;
int m_value;
};
#endif // QT_CODE_FILE_LIST