ui: Improved scrolling and layouting in QtCodeView and colored locations of active TokenId differently
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
|
||||
#include "component/controller/CodeController.h"
|
||||
|
||||
CodeView::CodeSnippetParams::CodeSnippetParams()
|
||||
: locationFile("")
|
||||
{
|
||||
}
|
||||
|
||||
CodeView::CodeView(ViewLayout* viewLayout)
|
||||
: View(viewLayout, Vec2i(100, 100))
|
||||
{
|
||||
|
||||
@@ -2,19 +2,30 @@
|
||||
#define CODE_VIEW_H
|
||||
|
||||
#include "component/view/View.h"
|
||||
#include "data/location/TokenLocationFile.h"
|
||||
#include "utility/types.h"
|
||||
|
||||
class CodeController;
|
||||
class TokenLocationFile;
|
||||
|
||||
class CodeView: public View
|
||||
{
|
||||
public:
|
||||
struct CodeSnippetParams
|
||||
{
|
||||
CodeSnippetParams();
|
||||
|
||||
std::string code;
|
||||
TokenLocationFile locationFile;
|
||||
int startLineNumber;
|
||||
Id activeTokenId;
|
||||
};
|
||||
|
||||
CodeView(ViewLayout* viewLayout);
|
||||
virtual ~CodeView();
|
||||
|
||||
virtual std::string getName() const;
|
||||
|
||||
virtual void addCodeSnippet(const std::string& str, const TokenLocationFile& locationFile, int startLineNumber) = 0;
|
||||
virtual void addCodeSnippet(const CodeSnippetParams params) = 0;
|
||||
virtual void clearCodeSnippets() = 0;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user