forked from paceholder/nodeeditor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodeStyle.hpp
More file actions
90 lines (68 loc) · 2.09 KB
/
NodeStyle.hpp
File metadata and controls
90 lines (68 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#pragma once
#include <QIcon>
#include <QtGui/QColor>
#include "Export.hpp"
#include "Style.hpp"
namespace QtNodes {
/**
* Describes the position of the processing icon on the node ui
*/
enum class ProcessingIconPos {
BottomLeft = 0, /// icon on the bottom left position
BottomRight = 1, /// icon on the bottom right position
};
/**
* Defines the processing icon style;
*/
struct ProcessingIconStyle
{
ProcessingIconPos _pos{ProcessingIconPos::BottomRight};
double _size{20.0};
double _margin{8.0};
int _resolution{64};
};
class NODE_EDITOR_PUBLIC NodeStyle : public Style
{
public:
NodeStyle();
NodeStyle(QString jsonText);
NodeStyle(QJsonObject const &json);
virtual ~NodeStyle() = default;
public:
static void setNodeStyle(QString jsonText);
public:
void loadJson(QJsonObject const &json) override;
QJsonObject toJson() const override;
/// Set uniform background color for the node.
void setBackgroundColor(QColor const &color);
/// Current uniform background color.
QColor backgroundColor() const;
public:
QColor NormalBoundaryColor;
QColor SelectedBoundaryColor;
QColor GradientColor0;
QColor GradientColor1;
QColor GradientColor2;
QColor GradientColor3;
QColor ShadowColor;
bool ShadowEnabled;
QColor FontColor;
QColor FontColorFaded;
QColor ConnectionPointColor;
QColor FilledConnectionPointColor;
QColor WarningColor;
QColor ErrorColor;
QColor ToolTipIconColor;
float PenWidth;
float HoveredPenWidth;
float ConnectionPointDiameter;
float Opacity;
QIcon statusUpdated{QStringLiteral("://status_icons/updated.svg")};
QIcon statusProcessing{QStringLiteral("://status_icons/processing.svg")};
QIcon statusPending{QStringLiteral("://status_icons/pending.svg")};
QIcon statusInvalid{QStringLiteral("://status_icons/failed.svg")};
QIcon statusEmpty{QStringLiteral("://status_icons/empty.svg")};
QIcon statusPartial{QStringLiteral("://status_icons/partial.svg")};
ProcessingIconStyle processingIconStyle{};
};
} // namespace QtNodes