From 2fbc0dab730a03a0e1c52e3cbe3b5811defbd5d5 Mon Sep 17 00:00:00 2001 From: pinzart90 <46732933+pinzart90@users.noreply.github.com> Date: Mon, 28 Jun 2021 10:43:35 -0400 Subject: [PATCH] Add installed package UI in Preferences TAB (#11750) * update * update * update * update * Update InstalledPackagesControl.xaml * Update icons and icon sizes. * More tweaking.. * More tweaking. Remove delete button. Restore delete button in context menu. * More tweaking * MergeFixes * Some more tweaks * Add contest menu style * update colors * More context menu tweaking. * One small tweak. * add mark for uninstall label * simplify control * Update DynamoModern.xaml * Change ListBox to ItemsControl * More tweaks * More tweaks * Restore Scollbar * Remove unused icon * align content with header and remove border * update * update menu icon * Update InstalledPackagesControl.xaml.cs * Fix Colors * Move style * Use FlatIconButtonStyle * Update comment and use nameof() * Update comment. Co-authored-by: pinzart Co-authored-by: Jorgen Dahl --- .../Controls/InstalledPackagesControl.xaml | 262 ++++++++++++++++++ .../Controls/InstalledPackagesControl.xaml.cs | 45 +++ src/DynamoCoreWpf/DynamoCoreWpf.csproj | 12 +- src/DynamoCoreWpf/UI/Images/caret_down.png | Bin 0 -> 223 bytes src/DynamoCoreWpf/UI/Images/caret_up.png | Bin 0 -> 204 bytes src/DynamoCoreWpf/UI/Images/menu.png | Bin 0 -> 291 bytes src/DynamoCoreWpf/UI/Images/menu_16_16.png | Bin 0 -> 236 bytes .../UI/Themes/Modern/DynamoModern.xaml | 117 +++++++- .../ViewModels/Menu/PreferencesViewModel.cs | 9 + .../Views/Menu/PreferencesView.xaml | 12 +- src/DynamoPackages/Package.cs | 8 + 11 files changed, 455 insertions(+), 10 deletions(-) create mode 100644 src/DynamoCoreWpf/Controls/InstalledPackagesControl.xaml create mode 100644 src/DynamoCoreWpf/Controls/InstalledPackagesControl.xaml.cs create mode 100644 src/DynamoCoreWpf/UI/Images/caret_down.png create mode 100644 src/DynamoCoreWpf/UI/Images/caret_up.png create mode 100644 src/DynamoCoreWpf/UI/Images/menu.png create mode 100644 src/DynamoCoreWpf/UI/Images/menu_16_16.png diff --git a/src/DynamoCoreWpf/Controls/InstalledPackagesControl.xaml b/src/DynamoCoreWpf/Controls/InstalledPackagesControl.xaml new file mode 100644 index 00000000000..47b2ae7f7fe --- /dev/null +++ b/src/DynamoCoreWpf/Controls/InstalledPackagesControl.xaml @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/DynamoCoreWpf/Controls/InstalledPackagesControl.xaml.cs b/src/DynamoCoreWpf/Controls/InstalledPackagesControl.xaml.cs new file mode 100644 index 00000000000..c30ec6ec2ed --- /dev/null +++ b/src/DynamoCoreWpf/Controls/InstalledPackagesControl.xaml.cs @@ -0,0 +1,45 @@ +using Dynamo.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Dynamo.Wpf.Controls +{ + /// + /// Interaction logic for InstalledPackagesControl.xaml + /// + public partial class InstalledPackagesControl : UserControl + { + public InstalledPackagesControl() + { + InitializeComponent(); + } + + private void MoreButton_OnClick(object sender, RoutedEventArgs e) + { + var button = (Button)sender; + button.ContextMenu.DataContext = button.DataContext; + button.ContextMenu.IsOpen = true; + } + + private void Expander_Expanded(object sender, RoutedEventArgs e) + { + Expander exp = (Expander)sender; + if (exp.DataContext is PackageViewModel pm) + { + pm.ToggleTypesVisibleInManagerCommand.Execute(); + } + } + } +} diff --git a/src/DynamoCoreWpf/DynamoCoreWpf.csproj b/src/DynamoCoreWpf/DynamoCoreWpf.csproj index 407826716d7..94f229a5528 100644 --- a/src/DynamoCoreWpf/DynamoCoreWpf.csproj +++ b/src/DynamoCoreWpf/DynamoCoreWpf.csproj @@ -121,6 +121,9 @@ + + InstalledPackagesControl.xaml + NodeAutoCompleteSearchControl.xaml @@ -427,6 +430,10 @@ + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -1258,7 +1265,7 @@ {8872CA17-C10D-43B9-8393-5C5A57065EB0} PythonNodeModels - False + False {ccb6e56b-2da1-4eba-a1f9-e8510e129d12} @@ -1304,6 +1311,9 @@ + + + diff --git a/src/DynamoCoreWpf/UI/Images/caret_down.png b/src/DynamoCoreWpf/UI/Images/caret_down.png new file mode 100644 index 0000000000000000000000000000000000000000..007f55c7ea92386bc859de21c69b6026ab5b008a GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>``W z$lZxy-8q?;Kn_c~qpu?a!^VE@KZ&eBeu<}xV@L(#+rERm4GKK2-R^$t4o*CKr@@M8 zav_Uf-vZ%)+eex+dkod89;w<-ng5B&;dy+J*W!0%gsW8 P_A_|8`njxgN@xNAa)eB8 literal 0 HcmV?d00001 diff --git a/src/DynamoCoreWpf/UI/Images/caret_up.png b/src/DynamoCoreWpf/UI/Images/caret_up.png new file mode 100644 index 0000000000000000000000000000000000000000..3d37b12dcb6d667d6a5247b271fddf2bc46f13bb GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>``W z$lZxy-8q?;Kn_c~qpu?a!^VE@KZ&eBexj#~V@L(#+rERm4F(*pmKF`sB{uF8{7wkY zI3y?_``W z$lZxy-8q?;Kn_c~qpu?a!^VE@KZ&eB{tizU$B+ufvq1-W4=eDra8)Qy5wv2OZK7P# zT-MTef%g{gB+*@t=8F6dHUd|s%~GFsLiv;@$Aq_!d-^vXK4h8h%n{sE_~~BsHExZn z|D9|KRa-x~Xa{)B+_>S|sfSjZbsHWricc-hVhyPBdda4>uHv1VfRjzpIr)GOp``W z$lZxy-8q?;Kn_c~qpu?a!^VE@KZ&eBexs+0V@L(#+eyA$4GIFS?mSmQE1L5{%ugtn zELnGY-98=lTcdg39(`|*~SFxRLa@lVKZe@G9z1my#zT8(cccGczopr05|1Pga7~l literal 0 HcmV?d00001 diff --git a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml index 07a566642bb..02ac675106f 100644 --- a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml +++ b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml @@ -2293,7 +2293,6 @@ - @@ -2421,7 +2420,55 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +