Refactoring the html editor toolbar.
This commit is contained in:
@@ -29,16 +29,6 @@
|
||||
<Setter Property="CornerRadius" Value="4" />
|
||||
</Style>
|
||||
|
||||
<DataTemplate x:Key="AttendeeSuggestionTemplate" x:DataType="shared:AccountContact">
|
||||
<StackPanel Padding="8,4" Orientation="Vertical">
|
||||
<TextBlock FontWeight="SemiBold" Text="{x:Bind Name}" />
|
||||
<TextBlock FontSize="12" Text="{x:Bind Address}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="AttendeeTokenTemplate" x:DataType="data:CalendarComposeAttendeeViewModel">
|
||||
<TextBlock Text="{x:Bind DisplayName}" />
|
||||
</DataTemplate>
|
||||
</Page.Resources>
|
||||
|
||||
<Grid>
|
||||
@@ -60,9 +50,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Left: Calendar, Show As, Reminder -->
|
||||
<StackPanel
|
||||
Orientation="Horizontal"
|
||||
Spacing="12">
|
||||
<StackPanel Orientation="Horizontal" Spacing="12">
|
||||
|
||||
<!-- Calendar -->
|
||||
<StackPanel
|
||||
@@ -410,10 +398,10 @@
|
||||
ItemsSource="{x:Bind ViewModel.Attendees, Mode=OneWay}"
|
||||
LostFocus="AddressBoxLostFocus"
|
||||
PlaceholderText="{x:Bind domain:Translator.CalendarEventDetails_InviteSomeone}"
|
||||
SuggestedItemTemplate="{StaticResource AttendeeSuggestionTemplate}"
|
||||
SuggestedItemTemplate="{StaticResource ContactSuggestionTemplate}"
|
||||
TokenDelimiter=";"
|
||||
TokenItemAdding="TokenItemAdding"
|
||||
TokenItemTemplate="{StaticResource AttendeeTokenTemplate}" />
|
||||
TokenItemTemplate="{StaticResource ContactTokenTemplate}" />
|
||||
|
||||
<ListView
|
||||
Margin="-8,0,-8,-8"
|
||||
@@ -475,10 +463,15 @@
|
||||
|
||||
<!-- Attachments Pane -->
|
||||
<Border
|
||||
x:Name="AttachmentsPane"
|
||||
Margin="0,8,0,0"
|
||||
AllowDrop="True"
|
||||
Padding="16"
|
||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||
CornerRadius="{StaticResource ControlCornerRadius}"
|
||||
DragLeave="AttachmentsPane_DragLeave"
|
||||
DragOver="AttachmentsPane_DragOver"
|
||||
Drop="AttachmentsPane_Drop"
|
||||
Visibility="{x:Bind AttachmentsToggle.IsChecked, Mode=OneWay}">
|
||||
<StackPanel Spacing="8">
|
||||
<Button
|
||||
@@ -487,21 +480,21 @@
|
||||
Style="{StaticResource TransparentActionButtonStyle}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<coreControls:WinoFontIcon FontSize="14" Icon="AttachmentNew" />
|
||||
<TextBlock Text="{x:Bind domain:Translator.CalendarEventCompose_AddAttachment}" />
|
||||
<TextBlock FontSize="18" FontWeight="SemiBold" Text="+" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<ListView
|
||||
<GridView
|
||||
Margin="-8,0,-8,-8"
|
||||
ItemsSource="{x:Bind ViewModel.Attachments, Mode=OneWay}"
|
||||
SelectionMode="None">
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<!--<ListView.ItemContainerStyle>
|
||||
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
|
||||
<Setter Property="Padding" Value="8,4" />
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.ItemTemplate>
|
||||
</ListView.ItemContainerStyle>-->
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate x:DataType="data:CalendarComposeAttachmentViewModel">
|
||||
<Grid Height="44" ColumnSpacing="8">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -536,12 +529,15 @@
|
||||
Click="RemoveAttachmentClicked"
|
||||
Style="{StaticResource TransparentActionButtonStyle}"
|
||||
Tag="{x:Bind}">
|
||||
<coreControls:WinoFontIcon FontSize="12" Icon="Delete" />
|
||||
<coreControls:WinoFontIcon
|
||||
FontSize="20"
|
||||
Foreground="{ThemeResource DeleteBrush}"
|
||||
Icon="Delete" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
@@ -560,7 +556,7 @@
|
||||
<mailControls:EditorTabbedCommandBarControl CommandTarget="{x:Bind NotesEditor}" />
|
||||
<mailControls:WebViewEditorControl
|
||||
x:Name="NotesEditor"
|
||||
MinHeight="600"
|
||||
MinHeight="500"
|
||||
IsEditorDarkMode="{x:Bind ViewModel.IsDarkWebviewRenderer, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
@@ -9,7 +9,10 @@ using EmailValidation;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Windows.ApplicationModel.DataTransfer;
|
||||
using Windows.Foundation;
|
||||
using Windows.Storage;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Messaging.Client.Shell;
|
||||
using Wino.Calendar.ViewModels.Data;
|
||||
using Wino.Mail.WinUI.Views.Abstract;
|
||||
@@ -145,6 +148,42 @@ public sealed partial class CalendarEventComposePage : CalendarEventComposePageA
|
||||
}
|
||||
}
|
||||
|
||||
private void AttachmentsPane_DragOver(object sender, DragEventArgs e)
|
||||
{
|
||||
e.AcceptedOperation = e.DataView.Contains(StandardDataFormats.StorageItems)
|
||||
? DataPackageOperation.Copy
|
||||
: DataPackageOperation.None;
|
||||
|
||||
if (e.AcceptedOperation == DataPackageOperation.Copy)
|
||||
{
|
||||
e.DragUIOverride.Caption = Translator.ComposerAttachmentsDragDropAttach_Message;
|
||||
e.DragUIOverride.IsCaptionVisible = true;
|
||||
e.DragUIOverride.IsGlyphVisible = true;
|
||||
e.DragUIOverride.IsContentVisible = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void AttachmentsPane_DragLeave(object sender, DragEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private async void AttachmentsPane_Drop(object sender, DragEventArgs e)
|
||||
{
|
||||
if (!e.DataView.Contains(StandardDataFormats.StorageItems))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var storageItems = await e.DataView.GetStorageItemsAsync();
|
||||
var files = storageItems.OfType<StorageFile>();
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
var basicProperties = await file.GetBasicPropertiesAsync();
|
||||
await ViewModel.ExecuteUIThread(() => ViewModel.TryAddAttachment(file.Path, (long)basicProperties.Size));
|
||||
}
|
||||
}
|
||||
|
||||
public void Receive(ApplicationThemeChanged message)
|
||||
{
|
||||
ViewModel.IsDarkWebviewRenderer = message.IsUnderlyingThemeDark;
|
||||
|
||||
@@ -25,47 +25,6 @@
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Page.Resources>
|
||||
<DataTemplate x:Key="TokenBoxTemplate" x:DataType="entities:AccountContact">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip Content="{x:Bind Address}" />
|
||||
</ToolTipService.ToolTip>
|
||||
|
||||
<!-- TODO: Display contact info. -->
|
||||
<!--<Grid.ContextFlyout>
|
||||
<MenuFlyout Placement="RightEdgeAlignedBottom">
|
||||
<MenuFlyoutItem Text="{x:Bind domain:Translator.ViewContactDetails}" />
|
||||
</MenuFlyout>
|
||||
</Grid.ContextFlyout>-->
|
||||
|
||||
<Viewbox Width="24">
|
||||
<controls:ImagePreviewControl PreviewContact="{x:Bind}" />
|
||||
</Viewbox>
|
||||
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="6,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Bind Name}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="SuggestionBoxTemplate" x:DataType="entities:AccountContact">
|
||||
<Grid Margin="0,12" ColumnSpacing="6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<controls:ImagePreviewControl PreviewContact="{x:Bind}" />
|
||||
<TextBlock Grid.Column="1">
|
||||
<Run FontWeight="SemiBold" Text="{x:Bind Name}" /><LineBreak /><Run Text="{x:Bind Address}" />
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Attachment Template -->
|
||||
<!-- Margin -8 0 is used to remove the padding from the ListViewItem -->
|
||||
<DataTemplate x:Key="ComposerFileAttachmentTemplate" x:DataType="data:MailAttachmentViewModel">
|
||||
@@ -186,13 +145,7 @@
|
||||
Visibility="{x:Bind ViewModel.IsDraftBusy, Mode=OneWay}">
|
||||
<ProgressRing IsActive="True" />
|
||||
</AppBarButton>
|
||||
|
||||
<AppBarButton Command="{x:Bind ViewModel.DiscardCommand}" Label="{x:Bind domain:Translator.Buttons_Discard}">
|
||||
<AppBarButton.Icon>
|
||||
<coreControls:WinoFontIcon Icon="Delete" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarToggleButton
|
||||
<AppBarToggleButton
|
||||
x:Name="EditorThemeToggleButton"
|
||||
IsChecked="{x:Bind WebViewEditor.IsEditorDarkMode, Mode=TwoWay}"
|
||||
Label=""
|
||||
@@ -201,6 +154,12 @@
|
||||
<coreControls:WinoFontIcon Icon="DarkEditor" />
|
||||
</AppBarToggleButton.Icon>
|
||||
</AppBarToggleButton>
|
||||
<AppBarButton Command="{x:Bind ViewModel.DiscardCommand}" Label="{x:Bind domain:Translator.Buttons_Discard}">
|
||||
<AppBarButton.Icon>
|
||||
<coreControls:WinoFontIcon Icon="Delete" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
|
||||
<AppBarButton
|
||||
Command="{x:Bind ViewModel.SendCommand}"
|
||||
Label="{x:Bind domain:Translator.Buttons_Send}"
|
||||
@@ -226,7 +185,7 @@
|
||||
<AppBarButton
|
||||
x:Name="FilesButton"
|
||||
Command="{x:Bind ViewModel.AttachFilesCommand}"
|
||||
Label="{x:Bind domain:Translator.Files}">
|
||||
LabelPosition="Collapsed">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="{StaticResource AttachPathIcon}" />
|
||||
</AppBarButton.Icon>
|
||||
@@ -388,11 +347,11 @@
|
||||
ItemsSource="{x:Bind ViewModel.ToItems, Mode=OneTime}"
|
||||
LostFocus="AddressBoxLostFocus"
|
||||
PlaceholderText="{x:Bind domain:Translator.ComposerToPlaceholder}"
|
||||
SuggestedItemTemplate="{StaticResource SuggestionBoxTemplate}"
|
||||
SuggestedItemTemplate="{StaticResource ContactSuggestionTemplate}"
|
||||
Tag="ToBox"
|
||||
TokenDelimiter=";"
|
||||
TokenItemAdding="TokenItemAdding"
|
||||
TokenItemTemplate="{StaticResource TokenBoxTemplate}" />
|
||||
TokenItemTemplate="{StaticResource ContactTokenTemplate}" />
|
||||
|
||||
<Button
|
||||
x:Name="CCBCCShowButton"
|
||||
@@ -430,11 +389,11 @@
|
||||
ItemsSource="{x:Bind ViewModel.CCItems, Mode=OneTime}"
|
||||
LostFocus="AddressBoxLostFocus"
|
||||
PlaceholderText="{x:Bind domain:Translator.ComposerToPlaceholder}"
|
||||
SuggestedItemTemplate="{StaticResource SuggestionBoxTemplate}"
|
||||
SuggestedItemTemplate="{StaticResource ContactSuggestionTemplate}"
|
||||
Tag="CCBox"
|
||||
TokenDelimiter=";"
|
||||
TokenItemAdding="TokenItemAdding"
|
||||
TokenItemTemplate="{StaticResource TokenBoxTemplate}"
|
||||
TokenItemTemplate="{StaticResource ContactTokenTemplate}"
|
||||
Visibility="{x:Bind ViewModel.IsCCBCCVisible, Mode=OneWay}" />
|
||||
|
||||
<TextBlock
|
||||
@@ -453,11 +412,11 @@
|
||||
ItemsSource="{x:Bind ViewModel.BCCItems, Mode=OneTime}"
|
||||
LostFocus="AddressBoxLostFocus"
|
||||
PlaceholderText="{x:Bind domain:Translator.ComposerToPlaceholder}"
|
||||
SuggestedItemTemplate="{StaticResource SuggestionBoxTemplate}"
|
||||
SuggestedItemTemplate="{StaticResource ContactSuggestionTemplate}"
|
||||
Tag="BCCBox"
|
||||
TokenDelimiter=";"
|
||||
TokenItemAdding="TokenItemAdding"
|
||||
TokenItemTemplate="{StaticResource TokenBoxTemplate}"
|
||||
TokenItemTemplate="{StaticResource ContactTokenTemplate}"
|
||||
Visibility="{x:Bind ViewModel.IsCCBCCVisible, Mode=OneWay}" />
|
||||
|
||||
<!-- Subject -->
|
||||
|
||||
Reference in New Issue
Block a user