From 1d4fc38c20ada779388054631dfb7586c6a7b475 Mon Sep 17 00:00:00 2001 From: iAmAsval Date: Mon, 21 Jun 2021 19:28:06 +0200 Subject: [PATCH] breadcrumb no click --- CUE4Parse | 2 +- FModel/MainWindow.xaml | 20 +------- FModel/ViewModels/Commands/MenuCommand.cs | 8 --- .../Views/Resources/Controls/Breadcrumb.xaml | 13 +++++ .../Resources/Controls/Breadcrumb.xaml.cs | 51 +++++++++++++++++++ FModel/Views/Resources/Resources.xaml | 1 - 6 files changed, 67 insertions(+), 28 deletions(-) create mode 100644 FModel/Views/Resources/Controls/Breadcrumb.xaml create mode 100644 FModel/Views/Resources/Controls/Breadcrumb.xaml.cs diff --git a/CUE4Parse b/CUE4Parse index 212313d0..682f45f7 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 212313d0f5a21cd4d2a02a4f518ad7f6e01ee3e1 +Subproject commit 682f45f762d049814a39e8fdfd8d1ee6bf1b1973 diff --git a/FModel/MainWindow.xaml b/FModel/MainWindow.xaml index 8a6590f6..4cdcd8d3 100644 --- a/FModel/MainWindow.xaml +++ b/FModel/MainWindow.xaml @@ -436,24 +436,8 @@ - - - - - - - - - - + diff --git a/FModel/ViewModels/Commands/MenuCommand.cs b/FModel/ViewModels/Commands/MenuCommand.cs index 74fb15cf..ae5c5a44 100644 --- a/FModel/ViewModels/Commands/MenuCommand.cs +++ b/FModel/ViewModels/Commands/MenuCommand.cs @@ -61,14 +61,6 @@ namespace FModel.ViewModels.Commands case "ToolBox_Open_Output_Directory": Process.Start(new ProcessStartInfo {FileName = UserSettings.Default.OutputDirectory, UseShellExecute = true}); break; - case TreeItem selectedFolder: - MainWindow.YesWeCats.AssetsListName.ItemsSource = null; - var folder = contextViewModel.CustomDirectories.GoToCommand.JumpTo(selectedFolder.PathAtThisPoint.SubstringBeforeLast('/')); - if (folder == null) return; - - do { await Task.Delay(100); } while (MainWindow.YesWeCats.AssetsListName.Items.Count < folder.AssetsList.Assets.Count); - MainWindow.YesWeCats.LeftTabControl.SelectedIndex = 2; // assets tab - break; } } } diff --git a/FModel/Views/Resources/Controls/Breadcrumb.xaml b/FModel/Views/Resources/Controls/Breadcrumb.xaml new file mode 100644 index 00000000..fe9e26bb --- /dev/null +++ b/FModel/Views/Resources/Controls/Breadcrumb.xaml @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/FModel/Views/Resources/Controls/Breadcrumb.xaml.cs b/FModel/Views/Resources/Controls/Breadcrumb.xaml.cs new file mode 100644 index 00000000..7ba461bd --- /dev/null +++ b/FModel/Views/Resources/Controls/Breadcrumb.xaml.cs @@ -0,0 +1,51 @@ +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; +using System.Windows.Shapes; + +namespace FModel.Views.Resources.Controls +{ + public partial class Breadcrumb + { + private const string _NAVIGATE_NEXT = "M9.31 6.71c-.39.39-.39 1.02 0 1.41L13.19 12l-3.88 3.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41L10.72 6.7c-.38-.38-1.02-.38-1.41.01z"; + + public Breadcrumb() + { + InitializeComponent(); + } + + private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) + { + if (e.NewValue is not string pathAtThisPoint) return; + InMeDaddy.Children.Clear(); + + var folders = pathAtThisPoint.Split('/'); + for (var i = 0; i < folders.Length; i++) + { + InMeDaddy.Children.Add(new TextBlock + { + Text = folders[i], + Margin = new Thickness(0, 3, 0, 0) + }); + if (i >= folders.Length - 1) continue; + + InMeDaddy.Children.Add(new Viewbox + { + Width = 16, + Height = 16, + HorizontalAlignment = HorizontalAlignment.Center, + Child = new Canvas + { + Width = 24, + Height = 24, + Children = { new Path + { + Fill = Brushes.White, + Data = Geometry.Parse(_NAVIGATE_NEXT) + }} + } + }); + } + } + } +} \ No newline at end of file diff --git a/FModel/Views/Resources/Resources.xaml b/FModel/Views/Resources/Resources.xaml index a85955f0..387a134c 100644 --- a/FModel/Views/Resources/Resources.xaml +++ b/FModel/Views/Resources/Resources.xaml @@ -59,7 +59,6 @@ M10 12c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM6 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12-8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-4 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm4-4c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-4-4c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-4-4c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z M12,17c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S13.1,17,12,17z M17.95,14c-0.52,0-0.94,0.4-0.99,0.92 c-0.2,2.03-1.05,2.68-1.48,3.02C14.68,18.54,14,19,12,19s-2.68-0.46-3.48-1.06c-0.43-0.34-1.28-0.99-1.48-3.02 C6.99,14.4,6.57,14,6.05,14c-0.59,0-1.06,0.51-1,1.09c0.22,2.08,1.07,3.47,2.24,4.41c0.5,0.4,1.1,0.7,1.7,0.9L9,24h6v-3.6 c0.6-0.2,1.2-0.5,1.7-0.9c1.17-0.94,2.03-2.32,2.24-4.41C19.01,14.51,18.53,14,17.95,14z M12,0C5.92,0,1,1.9,1,4.25v3.49 C1,8.55,1.88,9,2.56,8.57C2.7,8.48,2.84,8.39,3,8.31L5,13h2l1.5-6.28C9.6,6.58,10.78,6.5,12,6.5s2.4,0.08,3.5,0.22L17,13h2l2-4.69 c0.16,0.09,0.3,0.17,0.44,0.26C22.12,9,23,8.55,23,7.74V4.25C23,1.9,18.08,0,12,0z M5.88,11.24L4.37,7.69 c0.75-0.28,1.6-0.52,2.53-0.71L5.88,11.24z M18.12,11.24L17.1,6.98c0.93,0.19,1.78,0.43,2.53,0.71L18.12,11.24z M13,9V7.82C14.16,7.4,15,6.3,15,5c0-1.65-1.35-3-3-3S9,3.35,9,5c0,1.3,0.84,2.4,2,2.82V9H9c-0.55,0-1,0.45-1,1v0 c0,0.55,0.45,1,1,1h2v8.92c-2.22-0.33-4.59-1.68-5.55-3.37l1.14-1.14c0.22-0.22,0.19-0.57-0.05-0.75L3.8,12.6 C3.47,12.35,3,12.59,3,13v2c0,3.88,4.92,7,9,7s9-3.12,9-7v-2c0-0.41-0.47-0.65-0.8-0.4l-2.74,2.05c-0.24,0.18-0.27,0.54-0.05,0.75 l1.14,1.14c-0.96,1.69-3.33,3.04-5.55,3.37V11h2c0.55,0,1-0.45,1-1v0c0-0.55-0.45-1-1-1H13z M12,4c0.55,0,1,0.45,1,1s-0.45,1-1,1 s-1-0.45-1-1S11.45,4,12,4z - M19 11H7.83l4.88-4.88c.39-.39.39-1.03 0-1.42-.39-.39-1.02-.39-1.41 0l-6.59 6.59c-.39.39-.39 1.02 0 1.41l6.59 6.59c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L7.83 13H19c.55 0 1-.45 1-1s-.45-1-1-1z