fixed attachments layout and size and added progressbar
This commit is contained in:
@@ -54,11 +54,14 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
<!-- Attachment Template -->
|
<!-- Attachment Template -->
|
||||||
|
<!-- Margin -8 0 is used to remove the padding from the ListViewItem-->
|
||||||
<DataTemplate x:Key="ComposerFileAttachmentTemplate" x:DataType="data:MailAttachmentViewModel">
|
<DataTemplate x:Key="ComposerFileAttachmentTemplate" x:DataType="data:MailAttachmentViewModel">
|
||||||
<Grid
|
<Grid
|
||||||
Height="75"
|
Height="50"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
ColumnSpacing="3">
|
ColumnSpacing="3"
|
||||||
|
Margin="-8 0"
|
||||||
|
Padding="0,0,5,0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="36" />
|
<ColumnDefinition Width="36" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
@@ -74,7 +77,7 @@
|
|||||||
<!-- Name && Size -->
|
<!-- Name && Size -->
|
||||||
<Grid
|
<Grid
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
MaxWidth="250"
|
MaxWidth="200"
|
||||||
VerticalAlignment="Center">
|
VerticalAlignment="Center">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
@@ -85,7 +88,7 @@
|
|||||||
FontSize="13"
|
FontSize="13"
|
||||||
Text="{x:Bind FileName}"
|
Text="{x:Bind FileName}"
|
||||||
MaxLines="2"
|
MaxLines="2"
|
||||||
TextTrimming="None" />
|
TextTrimming="CharacterEllipsis" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
@@ -98,7 +101,7 @@
|
|||||||
|
|
||||||
<SymbolIcon
|
<SymbolIcon
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Margin="6,0"
|
Margin="0,0,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Symbol="Cancel"
|
Symbol="Cancel"
|
||||||
Foreground="{StaticResource DeleteBrush}" />
|
Foreground="{StaticResource DeleteBrush}" />
|
||||||
@@ -602,24 +605,25 @@
|
|||||||
Text="{x:Bind ViewModel.Subject, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
Text="{x:Bind ViewModel.Subject, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||||
|
|
||||||
<!-- Attachments -->
|
<!-- Attachments -->
|
||||||
<ListView
|
<ListView x:Name="AttachmentsListView"
|
||||||
x:Name="AttachmentsListView"
|
Grid.Row="6"
|
||||||
Grid.Row="6"
|
Padding="5"
|
||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
x:Load="{x:Bind helpers:XamlHelpers.CountToBooleanConverter(ViewModel.IncludedAttachments.Count), Mode=OneWay}"
|
x:Load="{x:Bind helpers:XamlHelpers.CountToBooleanConverter(ViewModel.IncludedAttachments.Count), Mode=OneWay}"
|
||||||
IsItemClickEnabled="True"
|
IsItemClickEnabled="True"
|
||||||
ItemTemplate="{StaticResource ComposerFileAttachmentTemplate}"
|
ItemTemplate="{StaticResource ComposerFileAttachmentTemplate}"
|
||||||
ItemsSource="{x:Bind ViewModel.IncludedAttachments, Mode=OneWay}"
|
ItemsSource="{x:Bind ViewModel.IncludedAttachments, Mode=OneWay}"
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
ItemClick="AttachmentClicked"
|
||||||
ScrollViewer.VerticalScrollMode="Enabled"
|
SelectionMode="None">
|
||||||
ItemClick="AttachmentClicked"
|
|
||||||
SelectionMode="None">
|
|
||||||
<ListView.ItemsPanel>
|
<ListView.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<ItemsStackPanel Orientation="Horizontal" />
|
<controls1:WrapPanel Orientation="Horizontal" />
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ListView.ItemsPanel>
|
</ListView.ItemsPanel>
|
||||||
</ListView>
|
</ListView>
|
||||||
|
|
||||||
|
<!--Attachments-->
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
|
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
|
||||||
|
xmlns:controls2="using:CommunityToolkit.WinUI.Controls"
|
||||||
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
|
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
|
||||||
xmlns:selectors="using:Wino.Selectors"
|
xmlns:selectors="using:Wino.Selectors"
|
||||||
IsDarkEditor="{x:Bind ViewModel.IsDarkWebviewRenderer, Mode=TwoWay}"
|
IsDarkEditor="{x:Bind ViewModel.IsDarkWebviewRenderer, Mode=TwoWay}"
|
||||||
@@ -59,75 +60,92 @@
|
|||||||
ReplyAll="{StaticResource CommandBarItemReplyAllTemplate}" />
|
ReplyAll="{StaticResource CommandBarItemReplyAllTemplate}" />
|
||||||
|
|
||||||
<!-- Attachment Template -->
|
<!-- Attachment Template -->
|
||||||
|
<!-- Margin -8 0 is used to remove the padding from the ListViewItem-->
|
||||||
<DataTemplate x:Key="FileAttachmentTemplate" x:DataType="viewModelData:MailAttachmentViewModel">
|
<DataTemplate x:Key="FileAttachmentTemplate" x:DataType="viewModelData:MailAttachmentViewModel">
|
||||||
<Grid
|
<Grid Height="51" RowSpacing="0">
|
||||||
Height="75"
|
<Grid.RowDefinitions>
|
||||||
Background="Transparent"
|
<RowDefinition Height="50" />
|
||||||
ColumnSpacing="3">
|
<RowDefinition Height="*" />
|
||||||
<ToolTipService.ToolTip>
|
</Grid.RowDefinitions>
|
||||||
<ToolTip Content="{x:Bind FileName}" />
|
<Grid
|
||||||
</ToolTipService.ToolTip>
|
Grid.Row="0"
|
||||||
<Grid.ContextFlyout>
|
Height="50"
|
||||||
<MenuFlyout Placement="Right">
|
Background="Transparent"
|
||||||
<MenuFlyoutItem
|
ColumnSpacing="3"
|
||||||
Text="{x:Bind domain:Translator.Buttons_Open}"
|
Padding="0,0,5,0"
|
||||||
Command="{Binding ElementName=root, Path=ViewModel.OpenAttachmentCommand}"
|
Margin="-8 0">
|
||||||
CommandParameter="{x:Bind}">
|
<ToolTipService.ToolTip>
|
||||||
<MenuFlyoutItem.Icon>
|
<ToolTip Content="{x:Bind FileName}" />
|
||||||
<PathIcon Data="{StaticResource OpenFilePathIcon}" />
|
</ToolTipService.ToolTip>
|
||||||
</MenuFlyoutItem.Icon>
|
<Grid.ContextFlyout>
|
||||||
</MenuFlyoutItem>
|
<MenuFlyout Placement="Right">
|
||||||
<MenuFlyoutItem
|
<MenuFlyoutItem
|
||||||
Text="{x:Bind domain:Translator.Buttons_Save}"
|
Text="{x:Bind domain:Translator.Buttons_Open}"
|
||||||
Command="{Binding ElementName=root, Path=ViewModel.SaveAttachmentCommand}"
|
Command="{Binding ElementName=root, Path=ViewModel.OpenAttachmentCommand}"
|
||||||
CommandParameter="{x:Bind}">
|
CommandParameter="{x:Bind}">
|
||||||
<MenuFlyoutItem.Icon>
|
<MenuFlyoutItem.Icon>
|
||||||
<PathIcon Data="{StaticResource SaveAttachmentPathIcon}" />
|
<PathIcon Data="{StaticResource OpenFilePathIcon}" />
|
||||||
</MenuFlyoutItem.Icon>
|
</MenuFlyoutItem.Icon>
|
||||||
</MenuFlyoutItem>
|
</MenuFlyoutItem>
|
||||||
</MenuFlyout>
|
<MenuFlyoutItem
|
||||||
</Grid.ContextFlyout>
|
Text="{x:Bind domain:Translator.Buttons_Save}"
|
||||||
<Grid.ColumnDefinitions>
|
Command="{Binding ElementName=root, Path=ViewModel.SaveAttachmentCommand}"
|
||||||
<ColumnDefinition Width="36" />
|
CommandParameter="{x:Bind}">
|
||||||
<ColumnDefinition Width="*" />
|
<MenuFlyoutItem.Icon>
|
||||||
<ColumnDefinition Width="Auto" />
|
<PathIcon Data="{StaticResource SaveAttachmentPathIcon}" />
|
||||||
</Grid.ColumnDefinitions>
|
</MenuFlyoutItem.Icon>
|
||||||
|
</MenuFlyoutItem>
|
||||||
|
</MenuFlyout>
|
||||||
|
</Grid.ContextFlyout>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="36" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- Icon -->
|
<!-- Icon -->
|
||||||
<ContentControl
|
<ContentControl
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Content="{x:Bind AttachmentType}"
|
Content="{x:Bind AttachmentType}"
|
||||||
ContentTemplateSelector="{StaticResource FileTypeIconSelector}" />
|
ContentTemplateSelector="{StaticResource FileTypeIconSelector}" />
|
||||||
|
|
||||||
<!-- Name && Size -->
|
<!-- Name && Size -->
|
||||||
<Grid Grid.Column="1" VerticalAlignment="Center">
|
<Grid Grid.Column="1"
|
||||||
<Grid.RowDefinitions>
|
VerticalAlignment="Center"
|
||||||
<RowDefinition Height="Auto" />
|
Padding="0,0,5,0"
|
||||||
<RowDefinition Height="*" />
|
MaxWidth="250">
|
||||||
</Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
Text="{x:Bind FileName}"
|
Text="{x:Bind FileName}"
|
||||||
MaxLines="2"
|
MaxLines="1"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
TextTrimming="CharacterEllipsis" />
|
TextTrimming="CharacterEllipsis" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="0,2,0,0"
|
Margin="0,2,0,0"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
FontSize="11"
|
FontSize="11"
|
||||||
Foreground="Gray"
|
Foreground="Gray"
|
||||||
Text="{x:Bind ReadableSize}" />
|
Text="{x:Bind ReadableSize}" />
|
||||||
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<muxc:ProgressBar
|
||||||
<ProgressRing
|
Grid.Row="1"
|
||||||
Grid.Column="2"
|
VerticalAlignment="Top"
|
||||||
VerticalAlignment="Center"
|
HorizontalAlignment="Stretch"
|
||||||
IsActive="{x:Bind IsBusy, Mode=OneWay}" />
|
Visibility="{x:Bind IsBusy, Mode=OneWay}"
|
||||||
|
IsIndeterminate="{x:Bind IsBusy, Mode=OneWay}"
|
||||||
|
ShowPaused="False"
|
||||||
|
Margin="0, -5, 0,0"
|
||||||
|
ShowError="False"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
</Page.Resources>
|
</Page.Resources>
|
||||||
@@ -292,20 +310,22 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<GridView
|
<!-- Attachments -->
|
||||||
Grid.Row="2"
|
<ListView x:Name="AttachmentsListView"
|
||||||
ui:ListViewExtensions.ItemContainerStretchDirection="Horizontal"
|
Grid.Row="2"
|
||||||
x:Name="AttachmentsListView"
|
x:Load="{x:Bind helpers:XamlHelpers.CountToBooleanConverter(ViewModel.Attachments.Count), Mode=OneWay}"
|
||||||
x:Load="{x:Bind helpers:XamlHelpers.CountToBooleanConverter(ViewModel.Attachments.Count), Mode=OneWay}"
|
IsItemClickEnabled="True"
|
||||||
IsItemClickEnabled="True"
|
ItemTemplate="{StaticResource FileAttachmentTemplate}"
|
||||||
MaxHeight="200"
|
ItemsSource="{x:Bind ViewModel.Attachments, Mode=OneWay}"
|
||||||
Padding="8,0,0,0"
|
ItemClick="AttachmentClicked"
|
||||||
ItemTemplate="{StaticResource FileAttachmentTemplate}"
|
SelectionMode="None"
|
||||||
ItemsSource="{x:Bind ViewModel.Attachments, Mode=OneWay}"
|
Height="53">
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
<ItemsControl.ItemsPanel>
|
||||||
ScrollViewer.VerticalScrollMode="Enabled"
|
<ItemsPanelTemplate>
|
||||||
ItemClick="AttachmentClicked"
|
<controls2:WrapPanel Orientation="Horizontal"/>
|
||||||
SelectionMode="None" />
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
</ListView>
|
||||||
|
|
||||||
<muxc:ProgressBar
|
<muxc:ProgressBar
|
||||||
x:Name="DownloadingProgressBar"
|
x:Name="DownloadingProgressBar"
|
||||||
|
|||||||
Reference in New Issue
Block a user