ui: Improved graph layouting to properly place and resize subnodes

This change moves the toplevel node resizing from the QtPostProcessor to the GraphController to place and resize their
subnodes accordingly as well.
This commit is contained in:
Eberhard Graether
2015-04-30 16:25:24 +02:00
parent 749b1647e4
commit aa0c40b213
6 changed files with 102 additions and 37 deletions
+7 -1
View File
@@ -7,6 +7,7 @@
#include "component/view/graphElements/GraphNode.h"
#include "component/view/GraphViewStyleImpl.h"
#include "data/graph/Node.h"
#include "data/graph/token_component/TokenComponentAccess.h"
class GraphViewStyle
{
@@ -88,7 +89,7 @@ public:
static std::string getFontNameOfExpandToggleNode();
static NodeMargins getMarginsForNodeType(Node::NodeType type, bool hasChildren);
static NodeMargins getMarginsOfAccessNode();
static NodeMargins getMarginsOfAccessNode(TokenComponentAccess::AccessType type);
static NodeMargins getMarginsOfExpandToggleNode();
static NodeStyle getStyleForNodeType(Node::NodeType type, bool isActive, bool isFocused, bool hasChildren);
@@ -97,6 +98,11 @@ public:
static EdgeStyle getStyleForEdgeType(Edge::EdgeType type, bool isActive, bool isFocused);
static size_t toGridSize(size_t x);
static size_t s_gridCellSize;
static size_t s_gridCellPadding;
private:
static std::map<Node::NodeType, float> s_charWidths;
static std::shared_ptr<GraphViewStyleImpl> s_impl;