ui/data: cleaned up UI and parsing
* HOT FIX: typename not always correctly split to name hierarchy * show node main if available as first active token after parsing * show all contents of namespaces if searched for * added missing enum type and enum value usages * added inheritance for structs * removed MessageActivateToken and replaced it with MessageActivateTokens * activating correct nodes for clicks in GraphView and CodeView * no graph change when clicking an edge, but highlighting the edge instead * only show active nodes without connections when multiple are activated * fixed snippet sorting to put file that contains declarations on top * set sizeHints on CodeView and SearchView to increase their initial size fortune cookie message = Das Leben wird eine positive Wendung nehmen.
This commit is contained in:
@@ -13,23 +13,20 @@ CodeView::CodeSnippetParams::CodeSnippetParams()
|
||||
{
|
||||
}
|
||||
|
||||
bool CodeView::CodeSnippetParams::sort( CodeSnippetParams a, CodeSnippetParams b )
|
||||
bool CodeView::CodeSnippetParams::sort(const CodeSnippetParams& a, const CodeSnippetParams& b)
|
||||
{
|
||||
if(a.isActive && b.isActive)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// sort active snippet first
|
||||
if(a.isActive)
|
||||
if (a.isActive && !b.isActive)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(b.isActive)
|
||||
else if (!a.isActive && b.isActive)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// sort declarations
|
||||
if(a.isDeclaration && !b.isDeclaration)
|
||||
if (a.isDeclaration && !b.isDeclaration)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -37,14 +34,16 @@ bool CodeView::CodeSnippetParams::sort( CodeSnippetParams a, CodeSnippetParams b
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
||||
// different files
|
||||
if (a.locationFile.getFilePath() != b.locationFile.getFilePath())
|
||||
{
|
||||
// first header
|
||||
if( FileSystem::filePathWithoutExtension(a.locationFile.getFilePath())
|
||||
== FileSystem::filePathWithoutExtension(b.locationFile.getFilePath()) )
|
||||
if (FileSystem::filePathWithoutExtension(a.locationFile.getFilePath()) ==
|
||||
FileSystem::filePathWithoutExtension(b.locationFile.getFilePath()))
|
||||
{
|
||||
return FileSystem::extension(a.locationFile.getFilePath())
|
||||
> FileSystem::extension(b.locationFile.getFilePath());
|
||||
return FileSystem::extension(a.locationFile.getFilePath()) >
|
||||
FileSystem::extension(b.locationFile.getFilePath());
|
||||
}
|
||||
// alphabetical filepath without extension
|
||||
else
|
||||
@@ -53,6 +52,8 @@ bool CodeView::CodeSnippetParams::sort( CodeSnippetParams a, CodeSnippetParams b
|
||||
< FileSystem::filePathWithoutExtension(b.locationFile.getFilePath());
|
||||
}
|
||||
}
|
||||
|
||||
return a.startLineNumber < b.startLineNumber;
|
||||
}
|
||||
|
||||
CodeView::CodeView(ViewLayout* viewLayout)
|
||||
|
||||
@@ -14,19 +14,19 @@ public:
|
||||
{
|
||||
CodeSnippetParams();
|
||||
|
||||
// comparefunction for snippetsorting
|
||||
static bool sort(const CodeSnippetParams& a, const CodeSnippetParams& b);
|
||||
|
||||
uint startLineNumber;
|
||||
uint endLineNumber;
|
||||
uint lineCount;
|
||||
|
||||
std::string code;
|
||||
|
||||
TokenLocationFile locationFile;
|
||||
TokenLocationFile locationFile;
|
||||
|
||||
bool isActive;
|
||||
bool isDeclaration;
|
||||
|
||||
//comparefunctions for snippetsorting
|
||||
static bool sort(CodeSnippetParams a, CodeSnippetParams b);
|
||||
};
|
||||
|
||||
CodeView(ViewLayout* viewLayout);
|
||||
@@ -34,10 +34,10 @@ public:
|
||||
|
||||
virtual std::string getName() const;
|
||||
|
||||
virtual void showCodeFile(const CodeSnippetParams& params) = 0;
|
||||
virtual void addCodeSnippet(const CodeSnippetParams& params) = 0;
|
||||
virtual void clearCodeSnippets() = 0;
|
||||
virtual void setActiveTokenIds(std::vector<Id> ids) = 0;
|
||||
virtual void setActiveTokenIds(const std::vector<Id>& activeTokenIds) = 0;
|
||||
virtual void showCodeSnippets(const std::vector<CodeSnippetParams>& snippets) = 0;
|
||||
virtual void showCodeFile(const CodeSnippetParams& params) = 0;
|
||||
|
||||
private:
|
||||
CodeController* getController();
|
||||
|
||||
Reference in New Issue
Block a user