Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/DynamoDS/Dynamo into dial…
Browse files Browse the repository at this point in the history
…og-upd
  • Loading branch information
zeusongit committed Jan 17, 2024
2 parents cfccbc5 + 61a4f7d commit 481a301
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 30 deletions.
10 changes: 0 additions & 10 deletions src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,22 +262,13 @@ internal void ExitTour()

dynamoViewModel.OnEnableShortcutBarItems(true);

EnableDynamoUI();

//Hide guide background overlay
guideBackgroundElement.Visibility = Visibility.Hidden;
GuidesValidationMethods.CurrentExecutingGuide = null;
tourStarted = false;
}
}

private void EnableDynamoUI()
{
var dynamoView = mainRootElement as DynamoView;
if (dynamoView != null)
dynamoView.EnableEnvironment(true);
}

/// <summary>
/// Creates the exit modal when close button is pressed
/// </summary>
Expand Down Expand Up @@ -306,7 +297,6 @@ private void ContinueTourButton_Click(object sender, RoutedEventArgs e)
private void ExitTourButton_Click(object sender, RoutedEventArgs e)
{
exitGuideWindow.IsOpen = false;
EnableDynamoUI();
GuideFlowEvents.OnGuidedTourExited(currentGuide.Name);
ExitTour();
}
Expand Down
7 changes: 0 additions & 7 deletions src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,6 @@ private static void ClosePackageManager(PackageManagerView packageManager)
packageManager.PackageManagerViewModel.Width = PMDefaultWidth;
packageManager.PackageManagerViewModel.Height = PMDefaultHeight;
packageManagerViewModel.PropertyChanged -= searchPackagesPropertyChanged.Invoke;

//Enable the DynamoView.mainGrid so the user will be able to interact with Dynamo
var dynamoView = packageManager.Owner as DynamoView;
if (dynamoView != null)
{
dynamoView.EnableEnvironment(true);
}
packageManager.Close();

}
Expand Down
10 changes: 3 additions & 7 deletions src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2316,11 +2316,6 @@ private void HandlePackageManagerWindowClosed(object sender, EventArgs e)
cmd.Dispose();
}

internal void EnableEnvironment(bool isEnabled)
{
this.mainGrid.IsEnabled = isEnabled;
}

/// <summary>
/// Adds/Removes an overlay so the user won't be able to interact with the background (this behavior was implemented for Dynamo and for Library)
/// </summary>
Expand All @@ -2329,14 +2324,15 @@ internal void EnableOverlayBlocker(bool isEnabled)
{
object[] parametersInvokeScript = new object[] { "fullOverlayVisible", new object[] { isEnabled } };
ResourceUtilities.ExecuteJSFunction(this, parametersInvokeScript);
var backgroundName = "BackgroundBlocker";

if (isEnabled)
{
//By default the shortcutsBarGrid has a ZIndex = 1 then will be shown over the overlay that's why we need to change the ZIndex
Panel.SetZIndex(shortcutsBarGrid, 0);
var backgroundElement = new GuideBackground(this)
{
Name = "BackgroundBlocker",
Name = backgroundName,
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
Visibility = Visibility.Visible
Expand All @@ -2351,7 +2347,7 @@ internal void EnableOverlayBlocker(bool isEnabled)
{
//Restoring the ZIndex value to the default one.
Panel.SetZIndex(shortcutsBarGrid, 1);
var backgroundElement = mainGrid.Children.OfType<GuideBackground>().FirstOrDefault();
var backgroundElement = mainGrid.Children.OfType<GuideBackground>().Where(element => element.Name == backgroundName).FirstOrDefault();
if (backgroundElement != null)
{
mainGrid.Children.Remove(backgroundElement);
Expand Down
14 changes: 9 additions & 5 deletions src/Libraries/CoreNodeModels/Selection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ protected SelectionBase(

Prefix = prefix;

State = ElementState.Warning;
Warning(Resources.SelectionNodeNothingSelected, true);

ShouldDisplayPreviewCore = true;
}

Expand All @@ -183,7 +183,7 @@ protected SelectionBase(

Prefix = prefix;

State = ElementState.Warning;
Warning(Resources.SelectionNodeNothingSelected);

ShouldDisplayPreviewCore = true;

Expand Down Expand Up @@ -220,9 +220,13 @@ public override void ClearErrorsAndWarnings()
private void SetSelectionNodeState()
{
if (null == selectionResults || selectionResults.Count == 0)
{
State = ElementState.Warning;
else if (State == ElementState.Warning)
State = ElementState.Active;
}
else if (State == ElementState.Warning || State == ElementState.PersistentWarning)
{
base.ClearErrorsAndWarnings();
}
}

public bool CanBeginSelect()
Expand Down

Large diffs are not rendered by default.

0 comments on commit 481a301

Please sign in to comment.