diff --git a/src/UniGetUI.Core.Data/Licenses.cs b/src/UniGetUI.Core.Data/Licenses.cs
index 616f2b2936..f705627cad 100644
--- a/src/UniGetUI.Core.Data/Licenses.cs
+++ b/src/UniGetUI.Core.Data/Licenses.cs
@@ -13,6 +13,7 @@ public static class LicenseData
{"NancyFx", "MIT"},
{"PhotoSauce.MagicScaler", "MIT"},
{"YamlDotNet", "MIT"},
+ {"WinUIEx", "MIT"},
{"InnoDependencyInstaller", "CPOL 1.02" },
// Package managers and related
@@ -47,6 +48,7 @@ public static class LicenseData
{"NancyFx", new Uri("https://github.com/NancyFx/Nancy/blob/master/license.txt")},
{"PhotoSauce.MagicScaler", new Uri("https://github.com/saucecontrol/PhotoSauce/blob/master/license")},
{"YamlDotNet", new Uri("https://github.com/aaubry/YamlDotNet/blob/master/LICENSE.txt") },
+ {"WinUIEx", new Uri("https://github.com/dotMorten/WinUIEx/blob/main/LICENSE") },
{"InnoDependencyInstaller", new Uri("https://github.com/DomGries/InnoDependencyInstaller/blob/master/LICENSE.md") },
// Package managers and related
@@ -81,6 +83,7 @@ public static class LicenseData
{"NancyFx", new Uri("https://github.com/NancyFx/Nancy/")},
{"PhotoSauce.MagicScaler", new Uri("https://github.com/saucecontrol/PhotoSauce/")},
{"YamlDotNet", new Uri("https://github.com/aaubry/YamlDotNet/") },
+ {"WinUIEx", new Uri("https://github.com/dotMorten/WinUIEx/") },
{"InnoDependencyInstaller", new Uri("https://github.com/DomGries/InnoDependencyInstaller")},
// Package managers and related
diff --git a/src/UniGetUI/Controls/CustomNavViewItem.cs b/src/UniGetUI/Controls/CustomNavViewItem.cs
new file mode 100644
index 0000000000..1d5cff7004
--- /dev/null
+++ b/src/UniGetUI/Controls/CustomNavViewItem.cs
@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Numerics;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.UI.Text;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Documents;
+using UniGetUI.Core.Tools;
+using UniGetUI.Interface;
+using UniGetUI.Interface.Enums;
+using UniGetUI.Interface.Widgets;
+using UniGetUI.PackageEngine.Managers.WingetManager;
+using Windows.ApplicationModel.VoiceCommands;
+using Windows.Devices.Bluetooth.Advertisement;
+using Windows.UI.WebUI;
+using YamlDotNet.Core.Tokens;
+using static System.Net.Mime.MediaTypeNames;
+
+namespace UniGetUI.Controls;
+internal class CustomNavViewItem : NavigationViewItem
+{
+ int _iconSize = 28;
+ public IconType LocalIcon
+ {
+ set => base.Icon = new LocalIcon(value);
+
+ }
+ public string GlyphIcon
+ {
+ set => base.Icon = new FontIcon() { Glyph = value };
+ }
+ public new IconElement Icon
+ {
+ set => base.Icon = value;
+ }
+
+ public bool IsLoading
+ {
+ set
+ {
+ base.Icon.Margin = new Thickness(value ? 6 : 0);
+ _progressRing.Visibility = value? Visibility.Visible: Visibility.Collapsed;
+ }
+ }
+
+ public int IconSize
+ {
+ set => Resources["NavigationViewItemOnLeftIconBoxHeight"] = _iconSize = value;
+ }
+
+ public string Text
+ {
+ set => _textBlock.Text = CoreTools.Translate(value);
+ }
+
+ private readonly TextBlock _textBlock;
+ private readonly ProgressRing _progressRing;
+
+ private PageType _pageType;
+ public new PageType Tag
+ {
+ set => _pageType = value;
+ get => _pageType;
+ }
+
+ public CustomNavViewItem()
+ {
+ Height = 60;
+ Resources["NavigationViewItemOnLeftIconBoxHeight"] = _iconSize;
+ Resources["NavigationViewItemContentPresenterMargin"] = new Thickness(0);
+
+ var grid = new Grid { Height = 50 };
+
+ _progressRing = new ProgressRing
+ {
+ Margin = new Thickness(-46, 0, 0, 0),
+ HorizontalAlignment = HorizontalAlignment.Left,
+ VerticalAlignment = VerticalAlignment.Center,
+ IsIndeterminate = true,
+ Visibility = Visibility.Collapsed,
+ };
+
+ _textBlock = new TextBlock
+ {
+ VerticalAlignment = VerticalAlignment.Center,
+ };
+
+ grid.Children.Add(_progressRing);
+ grid.Children.Add(_textBlock);
+ base.Content = grid;
+ }
+}
diff --git a/src/UniGetUI/Controls/NavButton.xaml b/src/UniGetUI/Controls/NavButton.xaml
deleted file mode 100644
index 8a247126d7..0000000000
--- a/src/UniGetUI/Controls/NavButton.xaml
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/UniGetUI/Controls/NavButton.xaml.cs b/src/UniGetUI/Controls/NavButton.xaml.cs
deleted file mode 100644
index ce9c416e75..0000000000
--- a/src/UniGetUI/Controls/NavButton.xaml.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using UniGetUI.Core.Tools;
-
-// To learn more about WinUI, the WinUI project structure,
-// and more about our project templates, see: http://aka.ms/winui-project-info.
-
-namespace UniGetUI.Interface.Widgets
-{
- public sealed partial class NavButton : UserControl
- {
- public string Text
- {
- set {
- string val = CoreTools.Translate(value);
- int count = val.Count(x => x == ' ');
- TextBlock.Text = val.Replace(" ", "\x0a");
- ToggleButton.Content = val.Replace(" ", "\x0a");
- }
- }
-
- public string Glyph
- {
- set => IconBlock.Glyph = value;
- }
-
- public bool IsChecked
- {
- get => ToggleButton.IsChecked ?? false;
- set => ToggleButton.IsChecked = value;
- }
-
- public event EventHandler? Click;
-
- public NavButton()
- {
- InitializeComponent();
- DefaultStyleKey = typeof(NavButton);
- MainApp.Instance.MainWindow.NavButtonList.Add(this);
- }
-
- private void ToggleButton_Click(object sender, RoutedEventArgs e)
- {
- Click?.Invoke(this, EventArgs.Empty);
- }
-
- public void ForceClick()
- {
- ToggleButton.IsChecked = true;
- Click?.Invoke(this, EventArgs.Empty);
- }
- }
-}
diff --git a/src/UniGetUI/MainWindow.xaml b/src/UniGetUI/MainWindow.xaml
index 32849864a1..ca86572607 100644
--- a/src/UniGetUI/MainWindow.xaml
+++ b/src/UniGetUI/MainWindow.xaml
@@ -8,6 +8,7 @@
xmlns:local="using:UniGetUI"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:widgets="using:UniGetUI.Interface.Widgets"
+ xmlns:winex="using:WinUIEx"
Title="UniGetUI"
mc:Ignorable="d">
@@ -26,46 +27,26 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ Severity="Informational"
+ Visibility="Collapsed" />
diff --git a/src/UniGetUI/MainWindow.xaml.cs b/src/UniGetUI/MainWindow.xaml.cs
index d0b8b54a1c..8f39edd43f 100644
--- a/src/UniGetUI/MainWindow.xaml.cs
+++ b/src/UniGetUI/MainWindow.xaml.cs
@@ -13,7 +13,6 @@
using UniGetUI.Core.Logging;
using UniGetUI.Core.SettingsEngine;
using UniGetUI.Core.Tools;
-using UniGetUI.Interface.Widgets;
using UniGetUI.PackageEngine;
using UniGetUI.PackageEngine.Classes.Manager.Classes;
using UniGetUI.PackageEngine.Interfaces;
@@ -46,7 +45,6 @@ public XamlRoot XamlRoot
public int LoadingDialogCount;
public List DialogQueue = [];
- public List NavButtonList = [];
public static readonly ObservableQueue ParametersToProcess = new();
@@ -195,15 +193,15 @@ public static void ApplyProxyVariableToProcess()
private void AddToSubtitle(string line)
{
- if (AppSubTitle.Text.Length > 0)
- AppSubTitle.Text += " - ";
- AppSubTitle.Text += line;
- Title = "UniGetUI - " + AppSubTitle.Text;
+ if (TitleBar.Subtitle.Length > 0)
+ TitleBar.Subtitle += " - ";
+ TitleBar.Subtitle += line;
+ Title = "UniGetUI - " + TitleBar.Subtitle;
}
private void ClearSubtitle()
{
- AppSubTitle.Text = "";
+ TitleBar.Subtitle = "";
Title = "UniGetUI";
}
@@ -682,11 +680,12 @@ public void UpdateSystemTrayStatus()
public void SwitchToInterface()
{
- __app_titlebar.Visibility = Visibility.Visible;
- SetTitleBar(__app_titlebar);
+ TitleBar.Visibility = Visibility.Visible;
+ SetTitleBar(TitleBar);
NavigationPage = new MainView();
+
object? control = MainContentFrame.Content as Grid;
if (control is Grid loadingWindow)
{
@@ -705,6 +704,7 @@ public void SwitchToInterface()
MainContentFrame.Content = NavigationPage;
};
+
}
public void ApplyTheme()
@@ -989,6 +989,17 @@ private static bool IsRectangleFullyVisible(int x, int y, int width, int height)
return true;
}
+ private void TitleBar_PaneToggleRequested(WinUIEx.TitleBar sender, object args)
+ {
+ if (NavigationPage is not null)
+ {
+ if(this.AppWindow.Size.Width >= 1600)
+ {
+ Settings.Set("CollapseNavMenuOnWideScreen", NavigationPage.NavView.IsPaneOpen);
+ }
+ NavigationPage.NavView.IsPaneOpen = !NavigationPage.NavView.IsPaneOpen;
+ }
+ }
}
public static class NativeHelpers
diff --git a/src/UniGetUI/Pages/MainView.xaml b/src/UniGetUI/Pages/MainView.xaml
index fa99f926c6..166254f2b8 100644
--- a/src/UniGetUI/Pages/MainView.xaml
+++ b/src/UniGetUI/Pages/MainView.xaml
@@ -4,6 +4,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
+ xmlns:controls1="using:UniGetUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:interface="using:UniGetUI.Interface"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -11,12 +12,12 @@
xmlns:operations="using:UniGetUI.PackageOperations"
xmlns:pages="using:UniGetUI.Interface"
xmlns:widgets="using:UniGetUI.Interface.Widgets"
+ xmlns:winex="using:WinUIEx"
MinWidth="200"
MinHeight="200"
mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
+
+
+
+ 0,0,0,0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -262,6 +354,7 @@
Name="ContentFrame"
Grid.Row="0"
Grid.Column="0" />
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- *
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/UniGetUI/Pages/MainView.xaml.cs b/src/UniGetUI/Pages/MainView.xaml.cs
index 45711dd279..c40561bb50 100644
--- a/src/UniGetUI/Pages/MainView.xaml.cs
+++ b/src/UniGetUI/Pages/MainView.xaml.cs
@@ -16,6 +16,10 @@
using UniGetUI.PackageEngine.Enums;
using UniGetUI.PackageOperations;
using UniGetUI.Pages.SettingsPages;
+using UniGetUI.Controls;
+using ABI.Windows.Graphics.Imaging;
+using UniGetUI.PackageEngine;
+using UniGetUI.PackageEngine.PackageLoader;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
@@ -105,6 +109,19 @@ public MainView()
}
};
+
+ foreach(var pair in new Dictionary
+ {
+ { DiscoverNavBtn, PEInterface.DiscoveredPackagesLoader },
+ { UpdatesNavBtn, PEInterface.UpgradablePackagesLoader },
+ { InstalledNavBtn, PEInterface.InstalledPackagesLoader },
+ })
+ {
+ pair.Value.FinishedLoading += (_, _) => MainApp.Dispatcher.TryEnqueue(() => pair.Key.IsLoading = false);
+ pair.Value.StartedLoading += (_, _) => MainApp.Dispatcher.TryEnqueue(() => pair.Key.IsLoading = true);
+ pair.Key.IsLoading = pair.Value.IsLoading;
+ }
+
LoadDefaultPage();
if (CoreTools.IsAdministrator() && !Settings.Get("AlreadyWarnedAboutAdmin"))
@@ -120,6 +137,11 @@ public MainView()
{
DialogHelper.ShowTelemetryBanner();
}
+
+ if (!Settings.Get("CollapseNavMenuOnWideScreen"))
+ {
+ NavView.IsPaneOpen = true;
+ }
}
public void LoadDefaultPage()
@@ -136,25 +158,6 @@ public void LoadDefaultPage()
NavigateTo(type);
}
- private void DiscoverNavButton_Click(object sender, EventArgs e)
- => NavigateTo(PageType.Discover);
-
- private void InstalledNavButton_Click(object sender, EventArgs e)
- => NavigateTo(PageType.Installed);
-
- private void UpdatesNavButton_Click(object sender, EventArgs e)
- => NavigateTo(PageType.Updates);
-
- private void BundlesNavButton_Click(object sender, EventArgs e)
- => NavigateTo(PageType.Bundles);
-
- private void MoreNavButton_Click(object sender, EventArgs e)
- {
- SelectNavButtonForPage(PageType.OwnLog);
- (VersionMenuItem as MenuFlyoutItem).Text = CoreTools.Translate("WingetUI Version {0}", CoreData.VersionName);
- MoreNavButtonMenu.ShowAt(MoreNavButton, new FlyoutShowOptions { ShowMode = FlyoutShowMode.Standard });
- }
-
private Page GetPageForType(PageType type)
=> type switch
{
@@ -220,13 +223,16 @@ private void ManagersNavButton_Click(object sender, EventArgs e)
private void SelectNavButtonForPage(PageType page)
{
- DiscoverNavButton.IsChecked = page is PageType.Discover;
- UpdatesNavButton.IsChecked = page is PageType.Updates;
- InstalledNavButton.IsChecked = page is PageType.Installed;
- BundlesNavButton.IsChecked = page is PageType.Bundles;
- ManagersNavButton.IsChecked = page is PageType.Managers;
- SettingsNavButton.IsChecked = page is PageType.Settings;
- MoreNavButton.IsChecked = page is PageType.Help or PageType.ManagerLog or PageType.OperationHistory or PageType.OwnLog;
+ NavView.SelectedItem = page switch
+ {
+ PageType.Discover => DiscoverNavBtn,
+ PageType.Updates => UpdatesNavBtn,
+ PageType.Installed => InstalledNavBtn,
+ PageType.Bundles => BundlesNavBtn,
+ PageType.Settings => SettingsNavBtn,
+ PageType.Managers => ManagersNavBtn,
+ _ => MoreNavBtn,
+ };
}
private async void AboutNavButton_Click(object sender, RoutedEventArgs e)
@@ -389,5 +395,25 @@ private void ClearSuccessfulOps_Click(object sender, RoutedEventArgs e)
widget.Close();
}
}
+
+ private void NavigationView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
+ {
+ if(args.SelectedItem is CustomNavViewItem item)
+ {
+ if(item.Tag is PageType.Null)
+ {
+ }
+ else
+ {
+ NavigateTo(item.Tag);
+ }
+ }
+ }
+
+ private void MoreNavBtn_Tapped(object sender, Microsoft.UI.Xaml.Input.TappedRoutedEventArgs e)
+ {
+ (VersionMenuItem as MenuFlyoutItem).Text = CoreTools.Translate("WingetUI Version {0}", CoreData.VersionName);
+ MoreNavButtonMenu.ShowAt(sender as FrameworkElement);
+ }
}
}
diff --git a/src/UniGetUI/Pages/SettingsPages/GeneralPages/Internet.xaml b/src/UniGetUI/Pages/SettingsPages/GeneralPages/Internet.xaml
index 6d84e5d0cc..21e3810f6e 100644
--- a/src/UniGetUI/Pages/SettingsPages/GeneralPages/Internet.xaml
+++ b/src/UniGetUI/Pages/SettingsPages/GeneralPages/Internet.xaml
@@ -100,7 +100,7 @@
-
+
diff --git a/src/UniGetUI/Pages/SettingsPages/ManagersPages/PackageManager.xaml b/src/UniGetUI/Pages/SettingsPages/ManagersPages/PackageManager.xaml
index d506736ad6..44fb3d5736 100644
--- a/src/UniGetUI/Pages/SettingsPages/ManagersPages/PackageManager.xaml
+++ b/src/UniGetUI/Pages/SettingsPages/ManagersPages/PackageManager.xaml
@@ -99,7 +99,7 @@
Text="Related settings" />
diff --git a/src/UniGetUI/Pages/SoftwarePages/AbstractPackagesPage.xaml b/src/UniGetUI/Pages/SoftwarePages/AbstractPackagesPage.xaml
index b010fc35da..1540abc87b 100644
--- a/src/UniGetUI/Pages/SoftwarePages/AbstractPackagesPage.xaml
+++ b/src/UniGetUI/Pages/SoftwarePages/AbstractPackagesPage.xaml
@@ -800,7 +800,7 @@
-
+
@@ -822,9 +822,9 @@
-
-
-
+
+
+
+ TextWrapping="Wrap" />
+ TextWrapping="Wrap" />
-
-
-
-
-
+ Grid.ColumnSpan="3">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Checked="InstantSearchValueChanged"
+ Unchecked="InstantSearchValueChanged">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+ Padding="4,6,4,6"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch"
+ Background="{ThemeResource SystemFillColorNeutralBackgroundBrush}"
+ BorderBrush="{StaticResource ExpanderContentBorderBrush}"
+ BorderThickness="1"
+ CornerRadius="8">
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ VerticalAlignment="Stretch"
+ x:FieldModifier="protected"
+ CanBeScrollAnchor="False"
+ CharacterReceived="{x:Bind PackageList_CharacterReceived}"
+ ItemTemplate="{StaticResource PackageTemplate}"
+ ItemsSource="{x:Bind FilteredPackages, Mode=OneWay}">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+ Visibility="Collapsed">
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Padding="20,11,10,11"
+ x:FieldModifier="protected"
+ CornerRadius="8,0,0,8"
+ FontSize="40"
+ FontWeight="SemiBold" />
+
+
+
+
+
+
+
+
+
+
+
-
+
-
diff --git a/src/UniGetUI/Pages/SoftwarePages/AbstractPackagesPage.xaml.cs b/src/UniGetUI/Pages/SoftwarePages/AbstractPackagesPage.xaml.cs
index 0154dd3c28..a49166f0c8 100644
--- a/src/UniGetUI/Pages/SoftwarePages/AbstractPackagesPage.xaml.cs
+++ b/src/UniGetUI/Pages/SoftwarePages/AbstractPackagesPage.xaml.cs
@@ -18,6 +18,9 @@
using UniGetUI.Interface.Telemetry;
using UniGetUI.Pages.DialogPages;
using DispatcherQueuePriority = Microsoft.UI.Dispatching.DispatcherQueuePriority;
+using Microsoft.UI;
+using Microsoft.UI.Xaml.Media;
+using Windows.UI;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
@@ -280,13 +283,14 @@ protected AbstractPackagesPage(PackagesPageData data)
BackgroundText.Visibility = Visibility.Collapsed;
}
+ ChangeFilteringPaneLayout();
if (Settings.GetDictionaryItem("HideToggleFilters", PAGE_NAME))
{
- HideFilteringPane(skipAnimation: true);
+ HideFilteringPane();
}
else
{
- ShowFilteringPane(skipAnimation: true);
+ ShowFilteringPane();
}
QueryBlock.PlaceholderText = CoreTools.Translate("Search for packages");
@@ -891,7 +895,7 @@ private void SidepanelWidth_SizeChanged(object sender, SizeChangedEventArgs e)
return;
}
- if ((int)e.NewSize.Width < 30)
+ if ((int)e.NewSize.Width < 100)
{
HideFilteringPane();
Settings.SetDictionaryItem("SidepanelWidths", PAGE_NAME, 250);
@@ -974,7 +978,11 @@ private async void ForceRedrawByScroll()
private void ToggleFiltersButton_Click(object sender, RoutedEventArgs e)
{
- Settings.SetDictionaryItem("HideToggleFilters", PAGE_NAME, !ToggleFiltersButton.IsChecked ?? false);
+ if(FilteringPanel.DisplayMode is SplitViewDisplayMode.Inline)
+ {
+ Settings.SetDictionaryItem("HideToggleFilters", PAGE_NAME, !ToggleFiltersButton.IsChecked ?? false);
+ }
+
if (ToggleFiltersButton.IsChecked ?? false)
{
ShowFilteringPane();
@@ -985,64 +993,34 @@ private void ToggleFiltersButton_Click(object sender, RoutedEventArgs e)
}
}
- private async void HideFilteringPane(bool skipAnimation = false)
+ private async void HideFilteringPane()
{
- if (PaneIsAnimated) return;
-
- PaneIsAnimated = true;
- ToggleFiltersButton.IsChecked = false;
-
- if (!skipAnimation)
- {
- OutAnimation_FiltersPane.Start();
- double width = BodyGrid.ColumnDefinitions[0].Width.Value;
- while (width > 0)
- {
- BodyGrid.ColumnDefinitions[0].Width = new GridLength(width);
- await Task.Delay(10);
- width -= 40;
- }
- }
-
- FiltersResizer.Visibility = SidePanel.Visibility = Visibility.Collapsed;
- BodyGrid.ColumnDefinitions[0].Width = new GridLength(0);
- BodyGrid.ColumnSpacing = 0;
- PaneIsAnimated = false;
+ FilteringPanel.IsPaneOpen = false;
+ PackagesListGrid.Margin = new Thickness(0, 0, 0, 0);
}
- private async void ShowFilteringPane(bool skipAnimation = false)
+ private async void ShowFilteringPane()
{
- if (PaneIsAnimated) return;
-
- PaneIsAnimated = true;
- ToggleFiltersButton.IsChecked = true;
- FiltersResizer.Visibility = SidePanel.Visibility = Visibility.Visible;
- BodyGrid.ColumnSpacing = 12;
- InAnimation_FiltersPane.Start();
-
- int final_width = 250;
- try
- {
- final_width = Settings.GetDictionaryItem("SidepanelWidths", PAGE_NAME);
- }
- catch
- {
- Settings.SetDictionaryItem("SidepanelWidths", PAGE_NAME, 250);
- }
-
- if (!skipAnimation)
+ if (FilteringPanel.DisplayMode is SplitViewDisplayMode.Inline)
{
- double width = 0;
- while (width < final_width)
+ int finalWidth = 250;
+ try
{
- BodyGrid.ColumnDefinitions[0].Width = new GridLength(width);
- await Task.Delay(10);
- width += 40;
+ finalWidth = Settings.GetDictionaryItem("SidepanelWidths", PAGE_NAME);
}
+ catch
+ {
+ Settings.SetDictionaryItem("SidepanelWidths", PAGE_NAME, 250);
+ }
+ FilteringPanel.OpenPaneLength = finalWidth;
+ PackagesListGrid.Margin = new Thickness(12, 0, 0, 0);
}
-
- BodyGrid.ColumnDefinitions[0].Width = new GridLength(final_width);
- PaneIsAnimated = false;
+ else
+ {
+ FilteringPanel.OpenPaneLength = 250;
+ }
+ FilteringPanel.IsPaneOpen = true;
+ ToggleFiltersButton.IsChecked = true;
}
private async Task LoadIconsForNewPackages()
@@ -1148,5 +1126,66 @@ private void PackageItemContainer_PreviewKeyDown(object sender, KeyRoutedEventAr
e.Handled = true;
}
}
+
+ private async void ChangeFilteringPaneLayout()
+ {
+ if (FilteringPanel.ActualWidth == 0)
+ {
+ FilteringPanel.DisplayMode = SplitViewDisplayMode.CompactInline;
+ }
+ else if (FilteringPanel.ActualWidth < 1000 && FilteringPanel.DisplayMode is not SplitViewDisplayMode.Overlay)
+ {
+ FilteringPanel.DisplayMode = SplitViewDisplayMode.Overlay;
+ HideFilteringPane();
+ FiltersResizer.Opacity = 0;
+ ToggleFiltersButton.IsChecked = false;
+
+ await Task.Delay(200);
+ FilteringPanel.Shadow = new ThemeShadow();
+ SidePanel.BorderThickness = new Thickness(0, 1, 1, 1);
+
+ SidePanel.Background = new AcrylicBrush()
+ {
+ TintColor = Color.FromArgb(255, 20, 20, 20),
+ TintOpacity = 0.4,
+ FallbackColor = Color.FromArgb(255, 20, 20, 20),
+ TintLuminosityOpacity = 0.8
+ };
+
+ if (FilteringPanel.Pane is ScrollViewer filters)
+ {
+ filters.Padding = new Thickness(8);
+ filters.Margin = new Thickness(0, 1, 0, 1);
+ }
+ }
+ else if (FilteringPanel.ActualWidth >= 1000 && FilteringPanel.DisplayMode is not SplitViewDisplayMode.Inline)
+ {
+ FilteringPanel.DisplayMode = SplitViewDisplayMode.Inline;
+ SidePanel.Background = new SolidColorBrush(Colors.Transparent);
+ FiltersResizer.Opacity = 1;
+ SidePanel.BorderThickness = new Thickness(0);
+
+ if (FilteringPanel.Pane is ScrollViewer filters)
+ {
+ filters.Padding = new Thickness(0);
+ filters.Margin = new Thickness(0);
+ }
+
+ if (!Settings.GetDictionaryItem("HideToggleFilters", PAGE_NAME))
+ {
+ ShowFilteringPane();
+ }
+ }
+ }
+
+ private void FilteringPanel_SizeChanged(object sender, SizeChangedEventArgs e)
+ {
+ ChangeFilteringPaneLayout();
+ }
+
+ private void FilteringPanel_PaneClosing(SplitView sender, SplitViewPaneClosingEventArgs args)
+ {
+ ToggleFiltersButton.IsChecked = false;
+ }
}
}
diff --git a/src/UniGetUI/UniGetUI.csproj b/src/UniGetUI/UniGetUI.csproj
index 4d2d1f250a..da44232e4c 100644
--- a/src/UniGetUI/UniGetUI.csproj
+++ b/src/UniGetUI/UniGetUI.csproj
@@ -90,6 +90,7 @@
+