Skip to content

Commit 30e653d

Browse files
committed
Mark hidden connections with filled marker.
1 parent 7ca9e37 commit 30e653d

10 files changed

Lines changed: 33 additions & 13 deletions

File tree

Sources/BuiltInNodes/BI_UINodePanels.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,9 @@ void NodeUISlotPanel::Draw (NUIE::NodeUIDrawingEnvironment& env, const NUIE::Rec
286286
NUIE::Rect markerRect = NUIE::Rect::FromCenterAndSize (slotRect.GetLeftCenter (), skinParams.GetSlotMarkerSize ());
287287
drawingImage.AddItem (NUIE::DrawingItemConstPtr (new NUIE::DrawingFillEllipse (markerRect, skinParams.GetSlotTextBackgroundColor ())), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
288288
drawingImage.AddItem (NUIE::DrawingItemConstPtr (new NUIE::DrawingEllipse (markerRect, skinParams.GetConnectionLinePen ())), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
289-
} else if (slotMarker == NUIE::SkinParams::SlotMarker::Rectangle) {
289+
} else if (slotMarker == NUIE::SkinParams::SlotMarker::FilledCircle) {
290290
NUIE::Rect markerRect = NUIE::Rect::FromCenterAndSize (slotRect.GetLeftCenter (), skinParams.GetSlotMarkerSize ());
291-
drawingImage.AddItem (NUIE::DrawingItemConstPtr (new NUIE::DrawingFillRect (markerRect, skinParams.GetSlotTextBackgroundColor ())), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
292-
drawingImage.AddItem (NUIE::DrawingItemConstPtr (new NUIE::DrawingRect (markerRect, skinParams.GetConnectionLinePen ())), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
291+
drawingImage.AddItem (NUIE::DrawingItemConstPtr (new NUIE::DrawingFillEllipse (markerRect, skinParams.GetConnectionLinePen ().GetColor ())), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
293292
}
294293

295294
drawingImage.AddItem (NUIE::DrawingItemConstPtr (new NUIE::DrawingFillRect (slotRect, skinParams.GetSlotTextBackgroundColor ())));

Sources/MacOSEmbeddingDemo/Application.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ - (void) windowDidResize : (NSNotification *) notification
127127
/*slotTextColor*/ NUIE::Color (0, 0, 0),
128128
/*slotTextBackgroundColor*/ NUIE::Color (246, 246, 246),
129129
/*slotMarker*/ NUIE::SkinParams::SlotMarker::Circle,
130-
/*hiddenSlotMarker*/ NUIE::SkinParams::SlotMarker::Rectangle,
130+
/*hiddenSlotMarker*/ NUIE::SkinParams::SlotMarker::FilledCircle,
131131
/*slotMarkerSize*/ NUIE::Size (8.0, 8.0),
132132
/*selectionBlendColor*/ NUIE::BlendColor (NUIE::Color (41, 127, 255), 0.25),
133133
/*disabledBlendColor*/ NUIE::BlendColor (NUIE::Color (0, 138, 184), 0.2),

Sources/NodeEngineTest/NodeEditorVisualTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "SimpleTest.hpp"
22
#include "NUIE_NodeEditor.hpp"
33
#include "NUIE_NodeCommonMenuCommands.hpp"
4+
#include "NUIE_FeatureSet.hpp"
45
#include "BI_InputUINodes.hpp"
56
#include "BI_ViewerUINodes.hpp"
67
#include "VisualTestFramework.hpp"
@@ -32,7 +33,7 @@ const BasicSkinParams& GetSkinParamsWithMarkers ()
3233
/*slotTextColor*/ NUIE::Color (0, 0, 0),
3334
/*slotTextBackgroundColor*/ NUIE::Color (246, 246, 246),
3435
/*slotMarker*/ SkinParams::SlotMarker::Circle,
35-
/*hiddenSlotMarker*/ NUIE::SkinParams::SlotMarker::Rectangle,
36+
/*hiddenSlotMarker*/ NUIE::SkinParams::SlotMarker::FilledCircle,
3637
/*slotMarkerSize*/ NUIE::Size (8.0, 8.0),
3738
/*selectionBlendColor*/ NUIE::BlendColor (NUIE::Color (41, 127, 255), 0.25),
3839
/*disabledBlendColor*/ NUIE::BlendColor (NUIE::Color (0, 138, 184), 0.2),
@@ -638,6 +639,7 @@ TEST (AlignNodesTest)
638639

639640
TEST (HideConnectionsTest)
640641
{
642+
FeatureEnableGuard featureGuard ("HideConnections", true);
641643
SimpleNodeEditorTestEnvWithConnections env (GetSkinParamsWithMarkers ());
642644

643645
ASSERT (env.CheckReference (L"HideConnectionsTest_Initial.svg"));

Sources/NodeEngineTest/VisualTestFiles/HideConnectionsTest_ConnectionHidden.svg

Lines changed: 1 addition & 2 deletions
Loading

Sources/NodeEngineTest/VisualTestFiles/HideConnectionsTest_Viewer2Selected.svg

Lines changed: 1 addition & 2 deletions
Loading

Sources/NodeEngineTest/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
#include "SimpleTest.hpp"
44
#include "NE_Debug.hpp"
5-
#include "NUIE_FeatureSet.hpp"
65

76
int main (int, char* argv[])
87
{
98
EnableLeakDetection ();
10-
NUIE::EnableFeature ("HideConnections", true);
119

1210
std::string executablePath (argv[0]);
1311
std::wstring wExecutablePath (executablePath.begin (), executablePath.end ());

Sources/NodeUIEngine/NUIE_FeatureSet.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55
namespace NUIE
66
{
77

8+
FeatureEnableGuard::FeatureEnableGuard (const std::string& featureId, bool enabled) :
9+
featureId (featureId),
10+
oldEnabled (IsFeatureEnabled (featureId))
11+
{
12+
EnableFeature (featureId, enabled);
13+
}
14+
15+
FeatureEnableGuard::~FeatureEnableGuard ()
16+
{
17+
EnableFeature (featureId, oldEnabled);
18+
}
19+
820
static std::unordered_map<std::string, bool> features;
921

1022
void EnableFeature (const std::string& featureId, bool enabled)

Sources/NodeUIEngine/NUIE_FeatureSet.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
namespace NUIE
77
{
88

9+
class FeatureEnableGuard
10+
{
11+
public:
12+
FeatureEnableGuard (const std::string& featureId, bool enabled);
13+
~FeatureEnableGuard ();
14+
15+
private:
16+
std::string featureId;
17+
bool oldEnabled;
18+
};
19+
920
void EnableFeature (const std::string& featureId, bool enabled);
1021
bool IsFeatureEnabled (const std::string& featureId);
1122

Sources/NodeUIEngine/NUIE_SkinParams.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class SkinParams
3939
{
4040
None,
4141
Circle,
42-
Rectangle
42+
FilledCircle
4343
};
4444

4545
SkinParams ();

Sources/WindowsReferenceApp/AppUIEnvironment.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static const NUIE::BasicSkinParams& GetAppSkinParams ()
3232
/*slotTextColor*/ NUIE::Color (0, 0, 0),
3333
/*slotTextBackgroundColor*/ NUIE::Color (246, 246, 246),
3434
/*slotMarker*/ NUIE::SkinParams::SlotMarker::Circle,
35-
/*hiddenSlotMarker*/ NUIE::SkinParams::SlotMarker::Rectangle,
35+
/*hiddenSlotMarker*/ NUIE::SkinParams::SlotMarker::FilledCircle,
3636
/*slotMarkerSize*/ NUIE::Size (8.0, 8.0),
3737
/*selectionBlendColor*/ NUIE::BlendColor (NUIE::Color (41, 127, 255), 0.25),
3838
/*disabledBlendColor*/ NUIE::BlendColor (NUIE::Color (0, 138, 184), 0.2),

0 commit comments

Comments
 (0)