Skip to content

Commit

Permalink
item selection and deletion
Browse files Browse the repository at this point in the history
- UI added to allow users to add/remove items from current Package selection
  • Loading branch information
dnenov committed Oct 16, 2023
1 parent da0501f commit 2ecd63a
Show file tree
Hide file tree
Showing 8 changed files with 323 additions and 157 deletions.
2 changes: 2 additions & 0 deletions src/DynamoCoreWpf/DynamoCoreWpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<None Remove="UI\Images\NodeStates\package-64px.png" />
<None Remove="UI\Images\PackageManager\empty-state-first-use-light-gray.png" />
<None Remove="UI\Images\remove-pk-16px.png" />
<None Remove="UI\Images\remove-pk-dark-16px.png" />
<None Remove="UI\Images\search_icon_20px.png" />
<None Remove="UI\Images\TitleBarButtons\close-darktheme-disabled-16px.png" />
<None Remove="UI\Prompts\PortPropertiesEditPrompt.xaml" />
Expand Down Expand Up @@ -985,6 +986,7 @@
<Resource Include="UI\Images\PackageManager\empty-state-first-use-light-gray.png" />
<Resource Include="UI\Images\question-hover-blue-16px.png" />
<Resource Include="UI\Images\remove-pk-16px.png" />
<Resource Include="UI\Images\remove-pk-dark-16px.png" />
<Resource Include="UI\Images\search_icon_20px.png" />
<Resource Include="UI\Images\TitleBarButtons\close-darktheme-default-16px.png" />
<Resource Include="UI\Images\TitleBarButtons\close-darktheme-disabled-16px.png" />
Expand Down
21 changes: 21 additions & 0 deletions src/DynamoCoreWpf/UI/Converters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1415,6 +1415,27 @@ public object ConvertBack(object value, Type targetType, object parameter, Syste
}
}

/// <summary>
/// Converts 0 Collapsed state, otherwise returns Visible
/// </summary>
public class ZeroToVisibilityCollapsedConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value is int zero)
{
return zero == 0 ? Visibility.Collapsed : Visibility.Visible;
}

return Visibility.Collapsed; // If not int or int not zero, return collapsed.
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotSupportedException();
}
}

/// <summary>
/// Takes a value and if the value is not null returns Unity Type Auto (*) as a length value
/// Returns 0 length if the value is null
Expand Down
Binary file added src/DynamoCoreWpf/UI/Images/remove-pk-dark-16px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/DynamoCoreWpf/UI/Themes/Modern/DynamoConverters.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
<controls:BoolToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<controls:BoolToVisibilityCollapsedConverter x:Key="BooleanToVisibilityCollapsedConverter" />
<controls:InverseBooleanToVisibilityCollapsedConverter x:Key="InverseBoolToVisibilityCollapsedConverter" />
<controls:EmptyToVisibilityCollapsedConverter x:Key="EmptyToVisibilityCollapsedConverter"/>
<controls:EmptyToVisibilityCollapsedConverter x:Key="EmptyToVisibilityCollapsedConverter" />
<controls:ZeroToVisibilityCollapsedConverter x:Key="ZeroToVisibilityCollapsedConverter" />
<controls:EmptyToZeroLengthConverter x:Key="EmptyToZeroLengthConverter"/>
<controls:NavigationToOpacityConverter x:Key="NavigationToOpacityConverter" />
<controls:ViewButtonClipRectConverter x:Key="ViewButtonClipRectConverter" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@
<!--Folders-->
<TreeView Style="{DynamicResource TreeViewStyle}"
x:Name="customTreeView"
Margin="8"
Margin="0"
SelectedItemChanged="customTreeView_SelectedItemChanged"
ItemContainerStyle="{StaticResource CustomTreeViewItem}"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=Root, Mode=OneWay}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,70 +404,10 @@
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="28px" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<!-- Top Row: Buttons and Label -->
<DockPanel Grid.Row="0"
Grid.ColumnSpan="2"
Margin="5 5 20 5"
VerticalAlignment="Top"
HorizontalAlignment="Right">
<!-- Add Directory -->
<Button Command="{Binding Path=SelectDirectoryAndAddFilesRecursivelyCommand}"
Content="{x:Static p:Resources.PublishPackageViewAddDirectoryButton}"
DockPanel.Dock="Right"
TabIndex="16"
Background="{StaticResource PrimaryCharcoal300Brush}"
BorderThickness="0"
Cursor="Hand">
<Button.ToolTip>
<ToolTip Content="{x:Static p:Resources.PublishPackageViewAddDirectoryButtonTooltip}"
Style="{StaticResource GenericToolTipLight}" />
</Button.ToolTip>
<Button.Template>
<ControlTemplate>
<Grid>
<Rectangle Width="16"
Height="16">
<Rectangle.Fill>
<ImageBrush ImageSource="/DynamoCoreWpf;component/UI/Images/add-folder-16px.png" />
</Rectangle.Fill>
</Rectangle>
</Grid>
</ControlTemplate>
</Button.Template>
</Button>

<!-- Add Files -->
<Button Command="{Binding Path=ShowAddFileDialogAndAddCommand}"
Content="{x:Static p:Resources.PublishPackageViewAddFileButton}"
DockPanel.Dock="Right"
TabIndex="15"
Margin="0 2 10 0"
Background="{StaticResource PrimaryCharcoal300Brush}"
BorderThickness="0"
Cursor="Hand">
<Button.ToolTip>
<ToolTip Content="{x:Static p:Resources.PublishPackageViewAddFileButtonTooltip}"
Style="{StaticResource GenericToolTipLight}" />
</Button.ToolTip>
<Button.Template>
<ControlTemplate>
<Grid>
<Rectangle Width="16"
Height="16">
<Rectangle.Fill>
<ImageBrush ImageSource="/DynamoCoreWpf;component/UI/Images/add-file-16px.png" />
</Rectangle.Fill>
</Rectangle>
</Grid>
</ControlTemplate>
</Button.Template>
</Button>
</DockPanel>

<local:CustomBrowserControl x:Name="customBrowserControl"
Grid.Column="0"
Grid.Row="1"
Expand Down
Loading

0 comments on commit 2ecd63a

Please sign in to comment.