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

Footer #12774

Merged
merged 23 commits into from
Apr 21, 2022
Merged

Footer #12774

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
140 changes: 107 additions & 33 deletions src/DynamoCoreWpf/Controls/NotificationsControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,127 @@
xmlns:core="clr-namespace:Dynamo.Wpf.ViewModels.Core"
xmlns:viewmodels="clr-namespace:Dynamo.ViewModels"
xmlns:converters="clr-namespace:Dynamo.Controls"
xmlns:ui="clr-namespace:Dynamo.UI"
xmlns:p="clr-namespace:Dynamo.Wpf.Properties;assembly=DynamoCoreWpf"
d:DataContext="{d:DesignInstance Type=viewmodels:DynamoViewModel}"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300">

<UserControl.Resources>
<core:NotificationLevelToColorConverter x:Key="NotificationLevelToColorConverter"></core:NotificationLevelToColorConverter>
<converters:LinterIssueCountToVisibilityConverter x:Key="LinterIssueCountToVisibilityConverter" />
<ResourceDictionary>
<Style TargetType="{x:Type Border}" x:Key="FooterNotificationItemStyle">
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Margin" Value="5 10 0 10"/>
<Setter Property="Padding" Value="5 0"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="Height" Value="26"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Background" Value="{StaticResource DarkMidGreyBrush}"/>
<Setter Property="BorderBrush" Value="{StaticResource LightGreyBrush}"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{StaticResource MidGreyBrush}"></Setter>
</Trigger>
</Style.Triggers>
</Style>
<core:NotificationLevelToColorConverter x:Key="NotificationLevelToColorConverter"></core:NotificationLevelToColorConverter>
<core:ZeroToVisibilityCollapsedConverter x:Key="ZeroToVisibilityCollapsedConverter" />
<converters:LinterIssueCountToVisibilityConverter x:Key="LinterIssueCountToVisibilityConverter" />
<ResourceDictionary.MergedDictionaries>
<ui:SharedResourceDictionary Source="{x:Static ui:SharedDictionaryManager.DynamoConvertersDictionaryUri}" />
<ui:SharedResourceDictionary Source="{x:Static ui:SharedDictionaryManager.DynamoModernDictionaryUri}" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>

<Grid HorizontalAlignment="Stretch">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Path=HomeSpaceViewModel.CurrentNotificationMessage}"
FontStyle="Italic"
FontSize="12"
VerticalAlignment="Center"
HorizontalAlignment="Stretch"
TextAlignment="Right"
TextTrimming="WordEllipsis"
Margin="10"
Foreground="{Binding Path=HomeSpaceViewModel.CurrentNotificationLevel,
Converter={StaticResource NotificationLevelToColorConverter}}">
<TextBlock.Triggers>
<EventTrigger RoutedEvent="Binding.TargetUpdated">
<BeginStoryboard>
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.Opacity)">
<LinearDoubleKeyFrame Value="0"
KeyTime="0:0:0" />
<LinearDoubleKeyFrame Value="1"
KeyTime="0:0:0.35" />
<LinearDoubleKeyFrame Value="1"
KeyTime="0:0:5" />
<LinearDoubleKeyFrame Value="0"
KeyTime="0:0:5.35" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBlock.Triggers>
</TextBlock>

<!-- "Run completed with .." UI element -->
<Border Style="{StaticResource FooterNotificationItemStyle}"
Grid.Column="0"
BorderBrush="{Binding Path=HomeSpaceViewModel.CurrentNotificationLevel,
Converter={StaticResource NotificationLevelToColorConverter}}">
<TextBlock x:Name="runNotificationTextBlock"
Text="{Binding Path=HomeSpaceViewModel.CurrentNotificationMessage}"
FontStyle="Italic"
FontSize="12"
VerticalAlignment="Center"
HorizontalAlignment="Stretch"
TextAlignment="Left"
TextTrimming="WordEllipsis"
Foreground="{StaticResource PrimaryCharcoal200Brush}">
</TextBlock>
</Border>

<!-- The footer notification icon
Shows the number of Error/Warning/Info Nodes
Interactions - clicking will zoom around affected nodes -->
<ItemsControl x:Name="footerIconItemsControl"
VerticalAlignment="Center"
Grid.Column="1"
ItemsSource="{Binding Path=HomeSpaceViewModel.FooterNotificationItems, UpdateSourceTrigger=PropertyChanged}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Style="{StaticResource FooterNotificationItemStyle}"
Visibility="{Binding NotificationCount, Converter={StaticResource ZeroToVisibilityCollapsedConverter}}">
<Border.InputBindings>
<MouseBinding MouseAction="LeftClick"
Command="{Binding ElementName=footerIconItemsControl, Path=DataContext.HomeSpaceViewModel.SelectIssuesCommand}"
CommandParameter="{Binding NotificationType}"/>
</Border.InputBindings>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<!-- Create a duplicate of the image in greyscale.
"Property changes can only occur during object initialization", which prevents us to use a converter.
Source: https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.imaging.formatconvertedbitmap?view=windowsdesktop-6.0 -->
<Image x:Name="footerIconImage"
Width="12"
Source="{Binding NotificationImage, UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding NotificationCount,
UpdateSourceTrigger=PropertyChanged,
Converter={StaticResource ZeroToVisibilityCollapsedConverter}}">
</Image>
<Image x:Name="footerIconImageGrayScale"
Width="12"
Visibility="{Binding NotificationCount,
UpdateSourceTrigger=PropertyChanged,
Converter={StaticResource ZeroToVisibilityCollapsedConverter},
ConverterParameter=Inverse}">
<Image.Source>
<FormatConvertedBitmap Source="{Binding NotificationImage, UpdateSourceTrigger=PropertyChanged}"
DestinationFormat="Gray8"/>
</Image.Source>
<Image.OpacityMask>
<ImageBrush ImageSource="{Binding NotificationImage, UpdateSourceTrigger=PropertyChanged}"/>
</Image.OpacityMask>
</Image>
<Label x:Name="footerIconText"
Content="{Binding NotificationCount}"
FontSize="12" Padding="2 3 2 2"
Foreground="{StaticResource PrimaryCharcoal200Brush}"/>
</StackPanel>
<Border.ToolTip>
<ToolTip Content="{Binding Path=NotificationToolTip, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource GenericToolTipLight}"/>
</Border.ToolTip>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>

<StackPanel Orientation="Horizontal"
Grid.Column="1"
Grid.Column="2"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="30,0"
Expand Down
2 changes: 2 additions & 0 deletions src/DynamoCoreWpf/DynamoCoreWpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<None Remove="UI\Images\NodeStates\frozen-64px.png" />
<None Remove="UI\Images\NodeStates\hidden-64px.png" />
<None Remove="UI\Images\NodeStates\info-64px.png" />
<None Remove="UI\Images\warning_16px.png" />
<None Remove="Views\GuidedTour\HtmlPages\getStartedOnboarding.html" />
<None Remove="Views\GuidedTour\HtmlPages\Resources\emptyImage.png" />
</ItemGroup>
Expand Down Expand Up @@ -756,6 +757,7 @@
<Resource Include="UI\Images\NodeStates\frozen-64px.png" />
<Resource Include="UI\Images\NodeStates\hidden-64px.png" />
<Resource Include="UI\Images\NodeStates\info-64px.png" />
<Resource Include="UI\Images\warning_16px.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="UI\Images\whiteclosetab.png" />
Expand Down
29 changes: 28 additions & 1 deletion src/DynamoCoreWpf/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3084,6 +3084,15 @@ To install the latest version of a package, click Install. \n
<data name="GroupContextMenuColor" xml:space="preserve">
<value>Color</value>
</data>
<data name="RunCompletedWithErrorsMessage" xml:space="preserve">
<value>Run completed with errors.</value>
</data>
<data name="RunCompletedWithScaleChangeAndErrorsMessage" xml:space="preserve">
<value>Run completed with errors on setting new working range.</value>
</data>
<data name="RunReady" xml:space="preserve">
<value>Ready to run.</value>
</data>
<data name="PreferencesSecuritySettingsTab" xml:space="preserve">
<value>Security</value>
</data>
Expand Down
9 changes: 9 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3071,6 +3071,15 @@ To install the latest version of a package, click Install. \n
<data name="GroupContextMenuColor" xml:space="preserve">
<value>Color</value>
</data>
<data name="RunCompletedWithErrorsMessage" xml:space="preserve">
<value>Run completed with errors.</value>
</data>
<data name="RunCompletedWithScaleChangeAndErrorsMessage" xml:space="preserve">
<value>Run completed with errors on setting new working range.</value>
</data>
<data name="RunReady" xml:space="preserve">
<value>Ready to run.</value>
</data>
<data name="PreferencesSecuritySettingsTab" xml:space="preserve">
<value>Security</value>
</data>
Expand Down
Binary file added src/DynamoCoreWpf/UI/Images/warning_16px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<Color x:Key="PrimaryCharcoal100">#EEEEEE</Color>
<Color x:Key="PrimaryCharcoal200">#DCDCDC</Color>
<Color x:Key="PrimaryCharcoal300">#CCCCCC</Color>
<Color x:Key="LightGrey">#989898</Color>
<Color x:Key="MidGrey">#666666</Color>
<Color x:Key="DarkMidGrey">#535353</Color>
<Color x:Key="DarkGrey">#4A4A4A</Color>
Expand All @@ -33,6 +34,7 @@
<SolidColorBrush x:Key="PrimaryCharcoal100Brush" Color="{StaticResource PrimaryCharcoal100}" />
<SolidColorBrush x:Key="PrimaryCharcoal200Brush" Color="{StaticResource PrimaryCharcoal200}" />
<SolidColorBrush x:Key="PrimaryCharcoal300Brush" Color="{StaticResource PrimaryCharcoal300}" />
<SolidColorBrush x:Key="LightGreyBrush" Color="{StaticResource LightGrey}" />
<SolidColorBrush x:Key="MidGreyBrush" Color="{StaticResource MidGrey}" />
<SolidColorBrush x:Key="DarkMidGreyBrush" Color="{StaticResource DarkMidGrey}" />
<SolidColorBrush x:Key="DarkGreyBrush" Color="{StaticResource DarkGrey}" />
Expand Down
1 change: 1 addition & 0 deletions src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public WorkspaceViewModel HomeSpaceViewModel
get { return Workspaces.FirstOrDefault(w => w.Model is HomeWorkspaceModel); }
}


public EngineController EngineController { get { return Model.EngineController; } }

public WorkspaceModel CurrentSpace
Expand Down
Loading