diff --git a/src/RemoteViewer.Client/App.axaml b/src/RemoteViewer.Client/App.axaml index da0987a..598bfcb 100644 --- a/src/RemoteViewer.Client/App.axaml +++ b/src/RemoteViewer.Client/App.axaml @@ -7,26 +7,54 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/RemoteViewer.Client/Controls/Toasts/ToastsView.axaml b/src/RemoteViewer.Client/Controls/Toasts/ToastsView.axaml index ab84dcd..95d3a60 100644 --- a/src/RemoteViewer.Client/Controls/Toasts/ToastsView.axaml +++ b/src/RemoteViewer.Client/Controls/Toasts/ToastsView.axaml @@ -5,302 +5,403 @@ xmlns:toasts="using:RemoteViewer.Client.Controls.Toasts" xmlns:ft="using:RemoteViewer.Client.Services.FileTransfer" xmlns:conv="using:RemoteViewer.Client.Converters" - xmlns:sys="using:System" x:Class="RemoteViewer.Client.Controls.Toasts.ToastsView" x:DataType="toasts:ToastsViewModel"> - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + - + + - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - + + + - + diff --git a/src/RemoteViewer.Client/Converters/ProgressWidthConverter.cs b/src/RemoteViewer.Client/Converters/ProgressWidthConverter.cs new file mode 100644 index 0000000..c99d26a --- /dev/null +++ b/src/RemoteViewer.Client/Converters/ProgressWidthConverter.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using Avalonia.Data.Converters; + +namespace RemoteViewer.Client.Converters; + +public class ProgressWidthConverter : IMultiValueConverter +{ + public object? Convert(IList values, Type targetType, object? parameter, CultureInfo culture) + { + if (values.Count < 2) + { + return 0.0; + } + + var progress = values[0] switch + { + double d => d, + float f => (double)f, + int i => (double)i, + _ => 0.0 + }; + + var parentWidth = values[1] switch + { + double d => d, + float f => (double)f, + int i => (double)i, + _ => 0.0 + }; + + progress = Math.Clamp(progress, 0.0, 1.0); + return parentWidth * progress; + } +}