ui: Display scope name at bottom of snippet if available

* Show scope name at bottom looking like top one
* Refactored CodeSnippetParams out of CodeView and use them everywhere
* Fixed border radius clipping problem at bottom of file by defining a small padding
* Scroll to line number when inserting a scope
This commit is contained in:
Eberhard Graether
2016-02-03 13:54:46 +01:00
parent e7224e0c46
commit b40e49b633
17 changed files with 296 additions and 294 deletions
+5 -13
View File
@@ -11,6 +11,8 @@
#include "utility/TimePoint.h"
#include "utility/types.h"
#include "component/view/helper/CodeSnippetParams.h"
class QtCodeFile;
class QtCodeSnippet;
class TokenLocationFile;
@@ -21,7 +23,7 @@ class QtCodeFileList
Q_OBJECT
signals:
void shouldScrollToSnippet(QtCodeSnippet* widget);
void shouldScrollToSnippet(QtCodeSnippet* widget, uint lineNumber);
public:
QtCodeFileList(QWidget* parent = 0);
@@ -29,17 +31,7 @@ public:
virtual QSize sizeHint() const;
void addCodeSnippet(
uint startLineNumber,
const std::string& title,
Id titleId,
const std::string& code,
std::shared_ptr<TokenLocationFile> locationFile,
int refCount,
TimePoint modificationTime,
bool insert = false
);
void addCodeSnippet(const CodeSnippetParams& params, bool insert = false);
void addFile(std::shared_ptr<TokenLocationFile> locationFile, int refCount, TimePoint modificationTime);
void clearCodeSnippets();
@@ -70,7 +62,7 @@ public:
private slots:
void scrolled(int value);
void scrollToSnippet(QtCodeSnippet* snippet);
void scrollToSnippet(QtCodeSnippet* snippet, uint lineNumber);
void setValue();
private: