Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphNodeManager Update #13069

Merged
merged 37 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5ccedd2
Nested Empty List Not Showing
dnenov Jun 28, 2022
f272c2c
Filter Label Consistent Capitalisation
dnenov Jun 28, 2022
b0b940a
Export Tooltip
dnenov Jun 28, 2022
9978f7b
Tooltip Export and Copy Flip
dnenov Jun 28, 2022
fa1e4d2
DismissedAlerts Not Updated in Automatic Mode
dnenov Jun 28, 2022
19b0211
Merge branch 'master' of https://github.com/DynamoDS/Dynamo into dnen…
dnenov Jul 26, 2022
cc65e29
Icons to Filters
dnenov Jul 26, 2022
3090d39
Aligned Filters to Figma
dnenov Jul 26, 2022
759c6ed
Export Default Name
dnenov Jul 26, 2022
ab01d8f
Export Unfiltered Nodes Only
dnenov Jul 26, 2022
30b59aa
Renamed Node Blue Dot
dnenov Jul 26, 2022
2658095
Comments: nameof
dnenov Jul 27, 2022
9b0a73b
Comments: GetOriginalName Internal, used InternalsVisibleTo instead
dnenov Jul 27, 2022
cd5d3c1
Summary Comments Added to FilterViewModel
dnenov Jul 27, 2022
7365210
Fixed Summary Comments After Change
dnenov Jul 27, 2022
b73cf21
Comments: IEnumerable to Array Simplified
dnenov Jul 27, 2022
bbb88f3
Comments: Braces
dnenov Jul 27, 2022
bfb9187
SearchTextBox Update
dnenov Jul 27, 2022
88db85f
DataGrid Visual Changes
dnenov Jul 27, 2022
ec981e1
Export Dual Tooltip
dnenov Jul 27, 2022
2cf1df8
Select Node Behavior Change
dnenov Jul 27, 2022
954a3ea
Multiple Visual Updates
dnenov Jul 29, 2022
9b2ed4b
Warning/Error Text Contrast
dnenov Jul 29, 2022
a1ebe97
Hover State Colors, Consistent Selection Color
dnenov Jul 30, 2022
ff962a9
Dismissed Warning Italic Font
dnenov Aug 2, 2022
d2a4356
Any Empty Lists and Null
dnenov Aug 2, 2022
9622fc1
GNM EmptyList and Null Test
dnenov Aug 2, 2022
6ca914b
Remove Dismissed Icon
dnenov Aug 3, 2022
0837fe3
Naming Convention
dnenov Aug 5, 2022
4580258
Images as Resource
dnenov Aug 5, 2022
5615669
Removed/Replaced Converters
dnenov Aug 5, 2022
dcdf553
Color Resources Replaced
dnenov Aug 5, 2022
d7a8e1f
Converter Namespace Rename
dnenov Aug 9, 2022
a97c133
Merge branch 'master' of https://github.com/DynamoDS/Dynamo into dnen…
dnenov Aug 11, 2022
07125c9
Merge Fix
dnenov Aug 11, 2022
5a07586
Reverted Changes, Fix Tests Fail
dnenov Aug 15, 2022
abee353
Merge branch 'master' into dnenov-update-graphnodemanager
reddyashish Aug 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/DynamoCore/Graph/Nodes/NodeModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1081,11 +1081,34 @@ public virtual NodeOutputData OutputData
};
}
}

/// A collection of error/warning/info messages, dismissed via a sub-menu in the node Context Menu.
[JsonIgnore]
public ObservableCollection<string> DismissedAlerts { get; set; } = new ObservableCollection<string>();


private int _dismissedAlertsCount;
/// <summary>
/// Returns the number of dismissed error/warning/info messages.
/// </summary>
[JsonIgnore]
public int DismissedAlertsCount
{
get
{
return _dismissedAlertsCount;
dnenov marked this conversation as resolved.
Show resolved Hide resolved
}

internal set // Private setter, see "ArgumentLacing" for details.
{
if (_dismissedAlertsCount != value)
{
_dismissedAlertsCount = value;
RaisePropertyChanged(nameof(DismissedAlertsCount));
}
}
}

#endregion

#region freeze execution
Expand Down
1 change: 1 addition & 0 deletions src/DynamoCore/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@
[assembly: InternalsVisibleTo("DynamoManipulation")]
[assembly: InternalsVisibleTo("IronPythonTests")]
[assembly: InternalsVisibleTo("DynamoPackagesWPF")]
[assembly: InternalsVisibleTo("GraphNodeManagerViewExtension")]

[assembly: TypeForwardedTo(typeof(Dynamo.Scheduler.Disposable))]
15 changes: 14 additions & 1 deletion src/DynamoCoreWpf/ViewModels/Core/NodeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,21 @@ private void DismissedNodeMessages_CollectionChanged(object sender, NotifyCollec

RaisePropertyChanged(nameof(DismissedAlerts));
RaisePropertyChanged(nameof(NumberOfDismissedAlerts));

UpdateModelDismissedAlertsCount();
}


/// <summary>
/// Calls an update for the DismissedAlertCount inside the NodeModel to push PropertyChanged fire
/// </summary>
private void UpdateModelDismissedAlertsCount()
{
if (DismissedAlerts != null)
{
nodeLogic.DismissedAlertsCount = DismissedAlerts.Count;
}
}

/// <summary>
/// Dispose function
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<!-- Colors -->
<Color x:Key="MidGray">#999999</Color>
<Color x:Key="LightGray">#CCCCCC</Color>
<Color x:Key="Blue">#38abdf</Color>
<Color x:Key="MidLightBlue">#366a81</Color>
<Color x:Key="MidBlue">#365868</Color>
<Color x:Key="MidDarkBlue">#375f71</Color>
<Color x:Key="MidGrayColor">#999999</Color>
<Color x:Key="LightGrayColor">#CCCCCC</Color>
<Color x:Key="BlueColor">#38abdf</Color>
dnenov marked this conversation as resolved.
Show resolved Hide resolved
<Color x:Key="MidLightBlueColor">#366a81</Color>
<Color x:Key="MidBlueColor">#365868</Color>
<Color x:Key="MidDarkBlueColor">#375f71</Color>
<Color x:Key="TextColor">#F5F5F5</Color>
<Color x:Key="GrayOpacity">#5C5C5C5C</Color>
<Color x:Key="GrayOpacityColor">#5C5C5C5C</Color>
<Color x:Key="MainBackgroundColor">#353535</Color>
<Color x:Key="SecondaryBackgroundColor">#3c3c3c</Color>
<Color x:Key="BorderColor">#555</Color>

<!-- Brushes -->
<SolidColorBrush x:Key="MidGrayBrush" Color="{StaticResource MidGray}" />
<SolidColorBrush x:Key="LightGrayBrush" Color="{StaticResource LightGray}" />
<SolidColorBrush x:Key="BlueBrush" Color="{StaticResource Blue}" />
<SolidColorBrush x:Key="MidLightBlueBrush" Color="{StaticResource MidLightBlue}" />
<SolidColorBrush x:Key="MidBlueBrush" Color="{StaticResource MidBlue}" />
<SolidColorBrush x:Key="MidDarkBlueBrush" Color="{StaticResource MidDarkBlue}" />
<SolidColorBrush x:Key="MidGrayBrush" Color="{StaticResource MidGrayColor}" />
<SolidColorBrush x:Key="LightGrayBrush" Color="{StaticResource LightGrayColor}" />
<SolidColorBrush x:Key="BlueBrush" Color="{StaticResource BlueColor}" />
<SolidColorBrush x:Key="MidLightBlueBrush" Color="{StaticResource MidLightBlueColor}" />
<SolidColorBrush x:Key="MidBlueBrush" Color="{StaticResource MidBlueColor}" />
<SolidColorBrush x:Key="MidDarkBlueBrush" Color="{StaticResource MidDarkBlueColor}" />
<SolidColorBrush x:Key="TextColorBrush" Color="{StaticResource TextColor}" />
<SolidColorBrush x:Key="GrayOpacityBrush" Color="{StaticResource GrayOpacity}" />
<SolidColorBrush x:Key="GrayOpacityBrush" Color="{StaticResource GrayOpacityColor}" />
<SolidColorBrush x:Key="MainBackgroundColorBrush" Color="{StaticResource MainBackgroundColor}" />
<SolidColorBrush x:Key="SecondaryBackgroundColorBrush" Color="{StaticResource SecondaryBackgroundColor}" />
<SolidColorBrush x:Key="BorderColorBrush" Color="{StaticResource BorderColor}" />

<!-- DataGrid style -->
<Style x:Key="DataGridStyle1" TargetType="{x:Type DataGrid}">
Expand All @@ -27,59 +33,69 @@
<Setter Property="CellStyle" Value="{DynamicResource CellStyle1}"/>
<Setter Property="RowHeaderWidth" Value="0"/>
<Setter Property="BorderThickness" Value="0.5" />
<Setter Property="BorderBrush" Value="#555555"/>
<Setter Property="BorderBrush" Value="{StaticResource BorderColorBrush}"/>
<Setter Property="ColumnWidth" Value="Auto"/>
<Setter Property="GridLinesVisibility" Value="Vertical"/>
<Setter Property="VerticalGridLinesBrush" Value="#555555"/>
<Setter Property="VerticalGridLinesBrush" Value="{StaticResource BorderColorBrush}"/>
<Setter Property="UseLayoutRounding" Value="True"></Setter>
<Setter Property="SnapsToDevicePixels" Value="True"></Setter>
</Style>

<!-- DataGridColumnHeader style -->
<Style x:Key="ColumnHeaderStyle1" TargetType="DataGridColumnHeader">
<Setter Property="Height" Value="20"/>
<Setter Property="Background" Value="#333333"/>
<Setter Property="Foreground" Value="#999999"/>
<Setter Property="Height" Value="24"/>
<Setter Property="Background" Value="{StaticResource MainBackgroundColorBrush}"/>
<Setter Property="Foreground" Value="#bbbbbb"/>
<Setter Property="BorderThickness" Value="0 0 0 1"></Setter>
<Setter Property="BorderBrush" Value="{StaticResource BorderColorBrush}"></Setter>
<Setter Property="FontSize" Value="10" />
<Setter Property="BorderThickness" Value="0 0 1 0" />
<Setter Property="BorderBrush" Value="#555555"/>
<Setter Property="Margin" Value="0 0 1 0"/>
<Setter Property="Padding" Value="10 0"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="6 0"/>
<Setter Property="UseLayoutRounding" Value="True"></Setter>
<Setter Property="SnapsToDevicePixels" Value="True"></Setter>
</Style>

<!-- DataGridRow style -->
<Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
<Setter Property="Background" Value="#333333"/>
<Setter Property="Background" Value="{StaticResource MainBackgroundColor}"/>
<Setter Property="BorderThickness" Value="0" />
<Setter Property="MinHeight" Value="24"></Setter>
<Setter Property="VerticalContentAlignment" Value="Center"></Setter>
<Setter Property="BorderBrush" Value="#555555"/>
<Setter Property="BorderBrush" Value="{StaticResource BorderColorBrush}"/>
<Setter Property="UseLayoutRounding" Value="True"></Setter>
<Setter Property="SnapsToDevicePixels" Value="True"></Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#555555" />
<Trigger Property="AlternationIndex" Value="1">
<Setter Property="Background" Value="{StaticResource SecondaryBackgroundColorBrush}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#555555" />
<Setter Property="Background" Value="#434343"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4a4a4a" />
</Trigger>
</Style.Triggers>
</Style>

<!-- Cell style -->
<Style x:Key="CellStyle1" TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Margin" Value="1" />
<Setter Property="Margin" Value="1 0 0 0" />
<Setter Property="MinHeight" Value="24"></Setter>
<Setter Property="UseLayoutRounding" Value="True"></Setter>
<Setter Property="SnapsToDevicePixels" Value="True"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="Center" />
<ContentPresenter VerticalAlignment="Center" Margin="2 0" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#555555" />
<Setter Property="Background" Value="{StaticResource BorderColorBrush}" />
</Trigger>
</Style.Triggers>
</Style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,16 @@
Converter={StaticResource BooleanToColorConverter},
ConverterParameter=Default,
UpdateSourceTrigger=PropertyChanged}">
<ContentPresenter />
<StackPanel Orientation="Horizontal">
<Image Source="{Binding FilterImage}"
Width="12"
Height="12"
SnapsToDevicePixels="True"
UseLayoutRounding="True"
VerticalAlignment="Stretch"
Margin="2 0 0 0"/>
<ContentPresenter />
</StackPanel>
</Border>

<ControlTemplate.Triggers>
Expand Down
11 changes: 4 additions & 7 deletions src/GraphNodeManagerViewExtension/Controls/SearchBoxControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,9 @@
Margin="2 0 0 0"
Opacity="0.5"
VerticalAlignment="Center"
Text="{Binding SearchBoxPrompt}">
<TextBlock.Visibility>
<MultiBinding Converter="{StaticResource MultiBooleanToVisibilityConverter}">
<Binding Path="SearchText"></Binding>
<Binding ElementName="SearchTextBox" Path="IsFocused"></Binding>
</MultiBinding>
</TextBlock.Visibility>
Visibility="Visible"
IsHitTestVisible="False"
Text="{x:Static p:Resources.SearchBoxWatermarkText}">
</TextBlock>

<!-- Search Box -->
Expand All @@ -112,6 +108,7 @@
Cursor="IBeam"
HorizontalAlignment="Stretch"
TextChanged="SearchTextBox_OnTextChanged"
IsKeyboardFocusWithinChanged="SearchTextBox_OnKeyboardFocusWithinChanged"
Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}"></TextBox>

<!-- Clear Search -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ private void OnSearchClearButtonClicked(object sender, System.Windows.Input.Mous
{
this.SearchTextBox.Clear();
}

private void SearchTextBox_OnKeyboardFocusWithinChanged(object sender, DependencyPropertyChangedEventArgs e)
{
var textBox = sender as TextBox;
if (textBox == null) return;

if (string.IsNullOrEmpty(textBox.Text) && !textBox.IsKeyboardFocusWithin)
{
SearchTextBoxWatermark.Visibility = Visibility.Visible;
}
else
{
SearchTextBoxWatermark.Visibility = Visibility.Collapsed;
}
}
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using System;
using System.Globalization;
using System.Web.UI.WebControls;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using Dynamo.Graph.Nodes;
using Dynamo.GraphNodeManager.Properties;
using Dynamo.UI;
using FontStyle = System.Drawing.FontStyle;

namespace Dynamo.GraphNodeManager.Converters
{
Expand All @@ -27,6 +30,24 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
}
}

internal class InverseBooleanToVisibilityConverter : IValueConverter
dnenov marked this conversation as resolved.
Show resolved Hide resolved
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if ((bool)value)
{
return Visibility.Hidden;
}

return Visibility.Visible;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}

internal class IntegerToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Expand Down Expand Up @@ -242,4 +263,62 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
throw new NotImplementedException();
}
}

internal class BooleanToToolTipTextConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if ((bool)value)
{
return Resources.ToolTip_ExportToExcelFiltered;
}

return Resources.ToolTip_ExportToExcel;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}

}

internal class BooleanToFontStyleConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if ((bool)value)
{
return System.Windows.FontStyles.Italic;
}

return System.Windows.FontStyles.Normal;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}

}


internal class BooleanToFontFamilyConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if ((bool)value)
{
return new FontFamily("Open Sans");
}

return SharedDictionaryManager.DynamoModernDictionary["ArtifaktElementRegular"] as FontFamily;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}

}
}
Loading