From baada68f5cb4599e0185bcae20bdb03695854968 Mon Sep 17 00:00:00 2001 From: Deyan Nenov Date: Mon, 28 Mar 2022 20:20:58 +0100 Subject: [PATCH 1/2] Dummy Node Remove Color Overlays Removed some of the styling elements fighting visually with the Dummy Node. This node is used for Unresolved or Deprecated nodes and does not require any visual candy to function. --- .../NodeViewCustomizations/DummyNode.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Libraries/CoreNodeModelsWpf/NodeViewCustomizations/DummyNode.cs b/src/Libraries/CoreNodeModelsWpf/NodeViewCustomizations/DummyNode.cs index 2157d2beaa9..eef4a2dd3db 100644 --- a/src/Libraries/CoreNodeModelsWpf/NodeViewCustomizations/DummyNode.cs +++ b/src/Libraries/CoreNodeModelsWpf/NodeViewCustomizations/DummyNode.cs @@ -1,4 +1,5 @@ using System; +using System.Windows; using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Imaging; @@ -24,12 +25,26 @@ public void CustomizeView(DummyNode model, Dynamo.Controls.NodeView nodeView) Width = 66.0, Height = 66.0, Stretch = Stretch.UniformToFill, + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, Source = new BitmapImage(new Uri(src, UriKind.Relative)) }; RenderOptions.SetBitmapScalingMode(dummyNodeImage, BitmapScalingMode.HighQuality); nodeView.inputGrid.Children.Add(dummyNodeImage); model.Warning(model.GetDescription(), true); + + UIElement child = nodeView.grid.FindName("zoomGlyphsGrid") as UIElement; + nodeView.grid.Children.Remove(child); + + child = nodeView.grid.FindName("nodeColorOverlayZoomIn") as UIElement; + nodeView.grid.Children.Remove(child); + + child = nodeView.grid.FindName("nodeBorder") as UIElement; + nodeView.grid.Children.Remove(child); + + child = nodeView.grid.FindName("GlyphStackPanel") as UIElement; + nodeView.grid.Children.Remove(child); } public void Dispose() From afc36cb73c559c47d8a65872884d5ed00712af67 Mon Sep 17 00:00:00 2001 From: Deyan Nenov Date: Wed, 30 Mar 2022 09:25:33 +0100 Subject: [PATCH 2/2] Dummy Node Recover Frozen State - reverted change where frozen overlay in zoomed-in state will be removed --- .../NodeViewCustomizations/DummyNode.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/Libraries/CoreNodeModelsWpf/NodeViewCustomizations/DummyNode.cs b/src/Libraries/CoreNodeModelsWpf/NodeViewCustomizations/DummyNode.cs index eef4a2dd3db..15a2787ada5 100644 --- a/src/Libraries/CoreNodeModelsWpf/NodeViewCustomizations/DummyNode.cs +++ b/src/Libraries/CoreNodeModelsWpf/NodeViewCustomizations/DummyNode.cs @@ -34,17 +34,10 @@ public void CustomizeView(DummyNode model, Dynamo.Controls.NodeView nodeView) nodeView.inputGrid.Children.Add(dummyNodeImage); model.Warning(model.GetDescription(), true); - UIElement child = nodeView.grid.FindName("zoomGlyphsGrid") as UIElement; - nodeView.grid.Children.Remove(child); - - child = nodeView.grid.FindName("nodeColorOverlayZoomIn") as UIElement; - nodeView.grid.Children.Remove(child); - - child = nodeView.grid.FindName("nodeBorder") as UIElement; - nodeView.grid.Children.Remove(child); - - child = nodeView.grid.FindName("GlyphStackPanel") as UIElement; - nodeView.grid.Children.Remove(child); + // Grid containing the State overlay Glyphs in Zoomed Out state + // Remove so only the 'paperclip' icon appears + UIElement child = nodeView.grid.FindName("zoomGlyphsGrid") as UIElement; + if (child != null) nodeView.grid.Children.Remove(child); } public void Dispose()