ui: scroll to code snippet containing clicked edge

This change scrolls animated to the snippet representing the clicked edge instead of showing only this code snippet.
This commit is contained in:
Eberhard Graether
2015-05-31 22:52:16 +02:00
parent 3e419bb41f
commit 20ce168712
12 changed files with 187 additions and 16 deletions
+10
View File
@@ -17,6 +17,9 @@ class QtCodeFileList
{
Q_OBJECT
signals:
void shouldScrollToSnippet(QWidget* widget);
public:
QtCodeFileList(QWidget* parent = 0);
virtual ~QtCodeFileList();
@@ -40,12 +43,19 @@ public:
const std::vector<std::string>& getErrorMessages() const;
void setErrorMessages(const std::vector<std::string>& errorMessages);
void scrollToFirstActiveSnippet();
void focusToken(Id tokenId);
void defocusToken();
private slots:
void scrollToSnippet(QWidget* widget);
private:
void updateFiles();
void ensureWidgetVisibleAnimated(QWidget *childWidget, int xmargin = 50, int ymargin = 50);
std::shared_ptr<QFrame> m_frame;
std::vector<std::shared_ptr<QtCodeFile>> m_files;