ui: extended color scheme and added new color scheme bad_rainbow
* added color scheme template * define fill, border, text, icon and hatching colors for each node with states normal and focus * define colors for each edge with states normal and focus * use default node and edge colors when no type specific ones are defined * use normal colors for nodes and edges when no focused are defined * allow nodes and edges to imitate look of others with "like" tag * added style for bundle * added style for count circle
This commit is contained in:
@@ -35,19 +35,24 @@ public:
|
||||
int iconWidth;
|
||||
};
|
||||
|
||||
struct NodeColor
|
||||
{
|
||||
std::string fill;
|
||||
std::string border;
|
||||
std::string text;
|
||||
std::string icon;
|
||||
std::string hatching;
|
||||
};
|
||||
|
||||
struct NodeStyle
|
||||
{
|
||||
NodeStyle();
|
||||
|
||||
std::string color;
|
||||
std::string textColor;
|
||||
std::string iconColor;
|
||||
std::string hatchingColor;
|
||||
NodeColor color;
|
||||
|
||||
int cornerRadius;
|
||||
|
||||
int borderWidth;
|
||||
std::string borderColor;
|
||||
bool borderDashed;
|
||||
|
||||
std::string fontName;
|
||||
@@ -59,6 +64,8 @@ public:
|
||||
std::string iconPath;
|
||||
Vec2i iconOffset;
|
||||
size_t iconSize;
|
||||
|
||||
bool hasHatching;
|
||||
};
|
||||
|
||||
struct EdgeStyle
|
||||
@@ -108,6 +115,7 @@ public:
|
||||
static NodeStyle getStyleForNodeType(Node::NodeType type, bool defined, bool isActive, bool isFocused, bool hasChildren);
|
||||
static NodeStyle getStyleOfAccessNode();
|
||||
static NodeStyle getStyleOfExpandToggleNode();
|
||||
static NodeStyle getStyleOfCountCircle();
|
||||
static NodeStyle getStyleOfBundleNode(bool isFocused);
|
||||
|
||||
static EdgeStyle getStyleForEdgeType(Edge::EdgeType type, bool isActive, bool isFocused);
|
||||
@@ -118,6 +126,9 @@ public:
|
||||
|
||||
static float getZoomFactor();
|
||||
|
||||
static const NodeColor& getNodeColor(const std::string& typeStr, bool focus);
|
||||
static const std::string& getEdgeColor(const std::string& typeStr, bool focus);
|
||||
|
||||
static int s_gridCellSize;
|
||||
static int s_gridCellPadding;
|
||||
|
||||
@@ -132,6 +143,9 @@ private:
|
||||
static int s_fontSize;
|
||||
static std::string s_fontName;
|
||||
static float s_zoomFactor;
|
||||
|
||||
static std::map<std::string, NodeColor> s_nodeColors;
|
||||
static std::map<std::string, std::string> s_edgeColors;
|
||||
};
|
||||
|
||||
#endif // GRAPH_VIEW_STYLE_H
|
||||
|
||||
Reference in New Issue
Block a user