-
Notifications
You must be signed in to change notification settings - Fork 638
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
Add option to preview or hide preview of all geometry in a group and Fix top menu pixel difference #13702
Add option to preview or hide preview of all geometry in a group and Fix top menu pixel difference #13702
Changes from all commits
2053dde
6687996
fbad48a
b0202b6
2f8dc9e
3888e53
8dfa6f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -614,6 +614,26 @@ private bool CanChangeFontSize(object obj) | |
{ | ||
return true; | ||
} | ||
|
||
private DelegateCommand toggleIsVisibleGroupCommand; | ||
|
||
/// <summary> | ||
/// Command to toggle this group's node preview visibility. | ||
/// belongs to. | ||
/// </summary> | ||
[JsonIgnore] | ||
public DelegateCommand ToggleIsVisibleGroupCommand | ||
{ | ||
get | ||
{ | ||
if (toggleIsVisibleGroupCommand == null) | ||
toggleIsVisibleGroupCommand = | ||
new DelegateCommand(ToggleIsVisibleGroup, CanToggleIsVisibleGroup); | ||
new DelegateCommand(RemoveGroupFromGroup, CanUngroupGroup); | ||
|
||
return toggleIsVisibleGroupCommand; | ||
} | ||
} | ||
#endregion | ||
|
||
public AnnotationViewModel(WorkspaceViewModel workspaceViewModel, AnnotationModel model) | ||
|
@@ -795,13 +815,6 @@ internal IEnumerable<PortModel> GetGroupOutPorts(IEnumerable<NodeModel> ownerNod | |
); | ||
} | ||
|
||
private double GetPortVerticalOffset(PortModel portModel, int proxyPortIndex) | ||
{ | ||
// calculate the vertical offset based on the port index. | ||
double portHeight = portModel.Height; | ||
return verticalOffset + (proxyPortIndex * portHeight) + portVerticalMidPoint; | ||
} | ||
|
||
private Point2D CalculatePortPosition(PortModel portModel, double verticalPosition) | ||
{ | ||
double groupHeaderHeight = Height - ModelAreaRect.Height; | ||
|
@@ -1348,6 +1361,27 @@ private bool BelongsToGroup() | |
return WorkspaceViewModel.Model.Annotations.ContainsModel(this.annotationModel); | ||
} | ||
|
||
internal void ToggleIsVisibleGroup(object parameters) | ||
{ | ||
DynamoSelection.Instance.ClearSelection(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is it necessary to clear the selection? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to clear any other groups/notes/nodes that may be present in the selection, as we only want to target the current group and its contents. |
||
var nodesInGroup = this.AnnotationModel.Nodes.Select(n => n.GUID).ToList(); | ||
|
||
var command = new DynamoModel.UpdateModelValueCommand(Guid.Empty, | ||
nodesInGroup, "IsVisible", (!this.AnnotationModel.IsVisible).ToString()); | ||
|
||
this.AnnotationModel.IsVisible = !this.AnnotationModel.IsVisible; | ||
WorkspaceViewModel.DynamoViewModel.Model.ExecuteCommand(command); | ||
WorkspaceViewModel.DynamoViewModel.RaiseCanExecuteUndoRedo(); | ||
WorkspaceViewModel.HasUnsavedChanges = true; | ||
|
||
Analytics.TrackEvent(Actions.Preview, Categories.GroupOperations, this.AnnotationModel.IsVisible.ToString()); | ||
} | ||
|
||
internal bool CanToggleIsVisibleGroup(object parameters) | ||
{ | ||
return true; | ||
} | ||
|
||
public override void Dispose() | ||
{ | ||
annotationModel.PropertyChanged -= model_PropertyChanged; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed because unused method