Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file modified src/DynamoCoreWpf/UI/Images/caret-left-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/DynamoCoreWpf/UI/Images/caret-left-disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/DynamoCoreWpf/UI/Images/caret-right-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/DynamoCoreWpf/UI/Images/caret-right-disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/DynamoCoreWpf/UI/Images/check-disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/DynamoCoreWpf/UI/Images/check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/DynamoCoreWpf/UI/Images/whiteclosetab.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 @@ -111,7 +111,10 @@ internal void AddToSidebar()
internal void ShowViewExtension()
{
AddToSidebar();
this.nodeAutocompleteMenuItem.IsChecked = true;
if (this.nodeAutocompleteMenuItem != null)
{
this.nodeAutocompleteMenuItem.IsChecked = true;
}
}

public override void Loaded(ViewLoadedParams viewLoadedParams)
Expand All @@ -125,6 +128,7 @@ public override void Loaded(ViewLoadedParams viewLoadedParams)
nodeAutoCompleteViewModel = new NodeAutoCompletePanelViewModel(viewLoadedParams.DynamoWindow, dynamoViewModel);

// Adding a button in view menu to refresh and show manually
#if DEBUG
nodeAutocompleteMenuItem = new MenuItem { Header = "Show NodeAutocomplete view extension", IsCheckable = true, IsChecked = false };
nodeAutocompleteMenuItem.Click += (sender, args) =>
{
Expand All @@ -140,6 +144,7 @@ public override void Loaded(ViewLoadedParams viewLoadedParams)
}
};
viewLoadedParams.AddExtensionMenuItem(nodeAutocompleteMenuItem);
#endif
}

WorkspaceView.RequesNodeAutoCompleteBar += OnNodeAutoCompleteBarRequested;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ internal IEnumerable<DNADropdownViewModel> DropdownResults
RaisePropertyChanged(nameof(NthofTotal));
RaisePropertyChanged(nameof(ResultsLoaded));
RaisePropertyChanged(nameof(SwitchIsEnabled));
RaisePropertyChanged(nameof(ConfirmSource));
RaisePropertyChanged(nameof(PreviousSource));
RaisePropertyChanged(nameof(NextSource));
RaisePropertyChanged(nameof(HasPrevious));
RaisePropertyChanged(nameof(HasNext));
RaisePropertyChanged(nameof(FilteredView));
}
}
Expand Down Expand Up @@ -257,8 +256,8 @@ public int SelectedIndex

RaisePropertyChanged(nameof(SelectedIndex));
RaisePropertyChanged(nameof(NthofTotal));
RaisePropertyChanged(nameof(PreviousSource));
RaisePropertyChanged(nameof(NextSource));
RaisePropertyChanged(nameof(HasPrevious));
RaisePropertyChanged(nameof(HasNext));
}
}
}
Expand Down Expand Up @@ -296,35 +295,15 @@ internal void ToggleUndoRedoLocked(bool toggle = true)
}

/// <summary>
/// Bitmap Source for left caret
/// Boolean, true if its possible to select a previous autocomplete option
/// </summary>
public string PreviousSource
{
get
{
return selectedIndex == 0 ? "/DynamoCoreWpf;component/UI/Images/caret-left-disabled.png" : "/DynamoCoreWpf;component/UI/Images/caret-left-default.png";
}
}
/// <summary>
/// Bitmap Source for right caret
/// </summary>
public string NextSource
{
get
{
return selectedIndex >= ClusterResultsCount - 1 ? "/DynamoCoreWpf;component/UI/Images/caret-right-disabled.png" : "/DynamoCoreWpf;component/UI/Images/caret-right-default.png";
}
}
public bool HasPrevious => selectedIndex > 0;

/// <summary>
/// Bitmap Source for confirmation checkmark
/// Boolean, true if its possible to select a next autocomplete option
/// </summary>
public string ConfirmSource
{
get
{
return ResultsLoaded ? "/DynamoCoreWpf;component/UI/Images/check.png" : "/DynamoCoreWpf;component/UI/Images/check-disabled.png";
}
}
public bool HasNext => selectedIndex < ClusterResultsCount - 1;

/// <summary>
/// Language agnostic way of showing current result ordinal
/// </summary>
Expand Down Expand Up @@ -966,6 +945,7 @@ internal void PopulateAutoComplete()
//this should run on the UI thread, so thread safety is not a concern
LastRequestGuid = Guid.NewGuid();
var myRequest = LastRequestGuid;
SelectedIndex = -1;

//start a background thread to make the http request
Task.Run(() =>
Expand Down
123 changes: 57 additions & 66 deletions src/NodeAutoCompleteViewExtension/Views/NodeAutoCompleteBarView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
Background="Transparent"
ShowInTaskbar="False"
ResizeMode="NoResize"
Width="600"
Height="45"
PreviewKeyDown="OnAutoCompleteKeyDown"
>
<Window.Style>
<Style TargetType="Window">
<Setter Property="Width" Value="620" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsDNAClusterPlacementEnabled}" Value="False">
<Setter Property="Width" Value="500"/>
<Setter Property="Width" Value="510"/>
</DataTrigger>
</Style.Triggers>
</Style>
Expand Down Expand Up @@ -83,9 +83,8 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
Expand Down Expand Up @@ -267,14 +266,25 @@
<Grid>
<Border x:Name="DotsBackgroundBorder"
Background="Transparent"
CornerRadius="2" />
CornerRadius="2"
Width="36"/>
<Image x:Name="PrevImage"
Source="{Binding PreviousSource}"
Width="16px"
Height="16px"
Width="12px"
Height="12px"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="UniformToFill" />
Stretch="UniformToFill" >
<Image.Style>
Comment thread
johnpierson marked this conversation as resolved.
<Style TargetType="Image">
<Setter Property="Source" Value="/DynamoCoreWpf;component/UI/Images/caret-left-disabled.png"/>
<Style.Triggers>
<DataTrigger Binding="{Binding HasPrevious}" Value="True">
<Setter Property="Source" Value="/DynamoCoreWpf;component/UI/Images/caret-left-default.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Expand Down Expand Up @@ -319,14 +329,25 @@
<Grid>
<Border x:Name="DotsBackgroundBorder"
Background="Transparent"
CornerRadius="2" />
CornerRadius="2"
Width="36"/>
<Image x:Name="NextImage"
Source="{Binding NextSource}"
Width="16px"
Height="16px"
Width="12px"
Height="12px"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="UniformToFill" />
Stretch="UniformToFill" >
<Image.Style>
<Style TargetType="Image">
<Setter Property="Source" Value="/DynamoCoreWpf;component/UI/Images/caret-right-disabled.png"/>
<Style.Triggers>
<DataTrigger Binding="{Binding HasNext}" Value="True">
<Setter Property="Source" Value="/DynamoCoreWpf;component/UI/Images/caret-right-default.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Expand Down Expand Up @@ -360,15 +381,26 @@
<Grid>
<Border x:Name="DotsBackgroundBorder"
Background="Transparent"
CornerRadius="2" />
CornerRadius="2"
Width="36"/>
<Image x:Name="DotsImage"
Source="{Binding ConfirmSource}"
Width="16px"
Height="16px"
Margin="5"
Width="20px"
Height="20px"
Margin="3"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="UniformToFill" />
Stretch="UniformToFill" >
<Image.Style>
<Style TargetType="Image">
<Setter Property="Source" Value="/DynamoCoreWpf;component/UI/Images/check-disabled.png"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ResultsLoaded}" Value="True">
<Setter Property="Source" Value="/DynamoCoreWpf;component/UI/Images/check.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Expand Down Expand Up @@ -402,12 +434,13 @@
<Grid>
<Border x:Name="DotsBackgroundBorder"
Background="Transparent"
CornerRadius="2" />
CornerRadius="2"
Width="36"/>
<Image x:Name="DotsImage"
Source="/DynamoCoreWpf;component/UI/Images/whiteclosetab.png"
Width="16px"
Height="16px"
Margin="5"
Width="20px"
Height="20px"
Margin="3"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="UniformToFill" />
Expand Down Expand Up @@ -463,48 +496,6 @@
</ToggleButton.Template>
</ToggleButton>
</Grid>
<Button x:Name="btnDock"
Click="DockButton_OnClick"
Grid.Column="9"
TabIndex="6">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid>
<Border x:Name="DotsBackgroundBorder"
Background="Transparent"
CornerRadius="0,8,8,0" />
<Image x:Name="DotsImage"
Source="/DynamoCoreWpf;component/UI/Images/Dock_32px_default.png"
Width="16px"
Height="16px"
Margin="8"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="UniformToFill" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter TargetName="DotsBackgroundBorder"
Property="Background"
Value="{StaticResource DarkGreyBrush}" />
</Trigger>
<Trigger Property="IsMouseOver"
Value="False">
<Setter TargetName="DotsBackgroundBorder"
Property="Background"
Value="Transparent" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Button.Style>
</Button>
</Grid>
</Grid>
</Grid>
Expand Down
Loading