Skip to content
This repository was archived by the owner on Apr 30, 2024. It is now read-only.

Commit 8508825

Browse files
committed
Added download button to attachments
1 parent bd12898 commit 8508825

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

src/Quarrel/DataTemplates/MessageTemplates.xaml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
xmlns:bindableembeds="using:Quarrel.Bindables.Messages.Embeds"
1414
xmlns:mselector="using:Quarrel.Selectors.Messages"
1515
xmlns:markdown="using:Quarrel.Markdown">
16-
16+
1717
<SolidColorBrush x:Key="AttachmentBackgroundBrush" Color="#1E1E1E"/>
1818
<SolidColorBrush x:Key="AttachmentBorderBrush" Color="#3C3C3C"/>
1919

@@ -25,12 +25,29 @@
2525
<Grid.ColumnDefinitions>
2626
<ColumnDefinition Width="Auto"/>
2727
<ColumnDefinition Width="Auto"/>
28+
<ColumnDefinition Width="Auto"/>
2829
</Grid.ColumnDefinitions>
29-
<FontIcon x:Name="FileIcon" FontSize="36" Glyph="{x:Bind aconvert:AttachmentIconConverter.Convert(FileExtension)}" HorizontalAlignment="Left" Margin="0,0,6,0"/>
30-
<StackPanel Grid.Column="1">
31-
<HyperlinkButton Content="{x:Bind Attachment.Filename}" NavigateUri="{x:Bind Attachment.ProxyUrl}" FontSize="18" Padding="0" Style="{StaticResource PlainTextHyperlinkStyle}"/>
32-
<TextBlock Text="{x:Bind aconvert:HumanizeByteSizeConverter.Convert(Attachment.Size)}" FontSize="11" Opacity="0.5" Margin="0,-2,0,0"/>
30+
31+
<!--File icon-->
32+
<HyperlinkButton NavigateUri="{x:Bind Attachment.Url}"
33+
HorizontalAlignment="Left">
34+
<FontIcon Glyph="{x:Bind aconvert:AttachmentIconConverter.Convert(FileExtension)}" FontSize="32"/>
35+
</HyperlinkButton>
36+
37+
<!--File name and size-->
38+
<StackPanel Margin="6,0,12,0" Grid.Column="1">
39+
<HyperlinkButton Content="{x:Bind Attachment.Filename}" Padding="0"
40+
NavigateUri="{x:Bind Attachment.Url}" FontSize="18"
41+
Style="{StaticResource PlainTextHyperlinkStyle}"/>
42+
43+
<TextBlock Text="{x:Bind aconvert:HumanizeByteSizeConverter.Convert(Attachment.Size)}"
44+
FontSize="11" Opacity="0.5" Margin="0,-2,0,0"/>
3345
</StackPanel>
46+
47+
<!--Download button-->
48+
<HyperlinkButton NavigateUri="{x:Bind Attachment.Url}" Grid.Column="2">
49+
<FontIcon Glyph="" FontSize="24"/>
50+
</HyperlinkButton>
3451
</Grid>
3552
</DataTemplate>
3653

0 commit comments

Comments
 (0)