Skip to content

Commit

Permalink
feat(Library):adding-tooltip-for-node-category (#13857)
Browse files Browse the repository at this point in the history
* feat(Library):adding-tooltip-for-node-category

* Update AssemblySharedInfo.cs

---------

Co-authored-by: Aaron (Qilong) <[email protected]>
  • Loading branch information
Enzo707 and QilongTang authored Mar 30, 2023
1 parent 1167f83 commit 4528ddf
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
Expand Down
29 changes: 28 additions & 1 deletion src/Libraries/CoreNodeModels/Properties/Resources.Designer.cs

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

11 changes: 10 additions & 1 deletion src/Libraries/CoreNodeModels/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,13 @@ Default value: {0}</value>
<data name="CustomSelectionOutputDescription" xml:space="preserve">
<value>Selected value</value>
</data>
</root>
<data name="TooltipTextAction" xml:space="preserve">
<value>Nodes that execute an action</value>
</data>
<data name="TooltipTextCreate" xml:space="preserve">
<value>Nodes that create data</value>
</data>
<data name="TooltipTextQuery" xml:space="preserve">
<value>Nodes that query data</value>
</data>
</root>
11 changes: 10 additions & 1 deletion src/Libraries/CoreNodeModels/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,13 @@ Default value: {0}</value>
<data name="CustomSelectionOutputDescription" xml:space="preserve">
<value>Selected value</value>
</data>
</root>
<data name="TooltipTextAction" xml:space="preserve">
<value>Nodes that execute an action</value>
</data>
<data name="TooltipTextCreate" xml:space="preserve">
<value>Nodes that create data</value>
</data>
<data name="TooltipTextQuery" xml:space="preserve">
<value>Nodes that query data</value>
</data>
</root>
9 changes: 9 additions & 0 deletions src/LibraryViewExtensionWebView2/LibraryViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using CoreNodeModels.Properties;
using Dynamo.Controls;
using Dynamo.Extensions;
using Dynamo.LibraryViewExtensionWebView2.Handlers;
Expand Down Expand Up @@ -339,6 +340,7 @@ private void Browser_CoreWebView2InitializationCompleted(object sender, CoreWebV
}

SetLibraryFontSize();
SetTooltipText();
//The default value of the zoom factor is 1.0. The value that comes from the slider is in percentage, so we divide by 100 to be equivalent
double zoomFactor = ((double)dynamoViewModel.Model.PreferenceSettings.LibraryZoomScale / 100d);

Expand Down Expand Up @@ -382,6 +384,13 @@ private async void SetLibraryFontSize()
}
}

private async void SetTooltipText()
{
var jsonTooltipText = new { create = Resources.TooltipTextCreate, action = Resources.TooltipTextAction, query = Resources.TooltipTextQuery };
var jsonString = JsonConvert.SerializeObject(jsonTooltipText);
var result = await ExecuteScriptFunctionAsync(browser, "setTooltipText", jsonString);
}

#region Tooltip

/// <summary>
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/LibraryViewExtensionWebView2/web/library/library.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

// Disable the context menu
document.oncontextmenu = function () {
return false;
return false;
}

// Disable zoom by keyboard
Expand Down

0 comments on commit 4528ddf

Please sign in to comment.