Folder operations, Gmail folder sync improvements and rework of menu items. (#273)
* New rename folder dialog keys. * Insfra work for folder operations and rename folder code. * RenameFolder for Gmail. * Fixed input dialog to take custom take for primary button. * Missing rename for DS call. * Outlook to throw exception in case of error. * Implemented rename folder functionality for Outlook. * Remove default primary text from input dialog. * Fixed an issue where outlook folder rename does not work. * Disable vertical scroll for composing page editor items. * Fixing some issues with imap folder sync. * fix copy pasta * TODO folder update/removed overrides for shell. * New rename folder dialog keys. * Insfra work for folder operations and rename folder code. * RenameFolder for Gmail. * Fixed input dialog to take custom take for primary button. * Missing rename for DS call. * Outlook to throw exception in case of error. * Implemented rename folder functionality for Outlook. * Remove default primary text from input dialog. * Fixed an issue where outlook folder rename does not work. * Disable vertical scroll for composing page editor items. * Fixing some issues with imap folder sync. * fix copy pasta * TODO folder update/removed overrides for shell. * New rename folder dialog keys. * Insfra work for folder operations and rename folder code. * RenameFolder for Gmail. * Fixed input dialog to take custom take for primary button. * Missing rename for DS call. * Outlook to throw exception in case of error. * Implemented rename folder functionality for Outlook. * Remove default primary text from input dialog. * Fixed an issue where outlook folder rename does not work. * Disable vertical scroll for composing page editor items. * Fixing some issues with imap folder sync. * fix copy pasta * TODO folder update/removed overrides for shell. * New rename folder dialog keys. * Fixed an issue where redundant older updates causing pivots to be re-created. * New empty folder request * New rename folder dialog keys. * Insfra work for folder operations and rename folder code. * RenameFolder for Gmail. * Fixed input dialog to take custom take for primary button. * Missing rename for DS call. * Outlook to throw exception in case of error. * Implemented rename folder functionality for Outlook. * Remove default primary text from input dialog. * Fixed an issue where outlook folder rename does not work. * Fixing some issues with imap folder sync. * fix copy pasta * TODO folder update/removed overrides for shell. * New rename folder dialog keys. * New rename folder dialog keys. * New rename folder dialog keys. * Fixed an issue where redundant older updates causing pivots to be re-created. * New empty folder request * Enable empty folder on base sync. * Move updates on event listeners. * Remove folder UI messages. * Reworked folder synchronization for gmail. * Loading folders on the fly as the selected account changed instead of relying on cached menu items. * Merged account folder items, re-navigating to existing rendering page. * - Reworked merged account menu system. - Reworked unread item count loadings. - Fixed back button visibility. - Instant rendering of mails if renderer is active. - Animation fixes. - Menu item re-load crash/hang fixes. * Handle folder renaming on the UI. * Empty folder for all synchronizers. * New execution delay mechanism and handling folder mark as read for all synchronizers. * Revert UI changes on failure for IMAP. * Remove duplicate translation keys. * Cleanup.
This commit is contained in:
@@ -40,6 +40,15 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Border style for each page's root border for separation of zones. -->
|
||||
<Style TargetType="Border" x:Key="PageRootBorderStyle">
|
||||
<Setter Property="Margin" Value="7,0,7,7" />
|
||||
<Setter Property="Background" Value="{ThemeResource WinoContentZoneBackgroud}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource CardStrokeColorDefaultBrush}" />
|
||||
<Setter Property="CornerRadius" Value="7" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
</Style>
|
||||
|
||||
<!-- Default StackPanel animation. -->
|
||||
<Style TargetType="StackPanel">
|
||||
<Setter Property="ChildrenTransitions">
|
||||
|
||||
@@ -30,95 +30,15 @@
|
||||
<muxc:NavigationViewItemSeparator Margin="-20,0" />
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Nested Account Template -->
|
||||
<DataTemplate x:Key="NestedAccountMenuTemplate" x:DataType="menu:AccountMenuItem">
|
||||
<controls:AccountNavigationItem
|
||||
x:Name="AccountItem"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsChildSelected="{x:Bind IsChildSelected, Mode=TwoWay}"
|
||||
IsExpanded="{x:Bind IsExpanded, Mode=TwoWay}"
|
||||
MenuItemsSource="{x:Bind SubMenuItems, Mode=OneWay}"
|
||||
SelectsOnInvoked="False">
|
||||
<controls:WinoNavigationViewItem.ContentTransitions>
|
||||
<TransitionCollection>
|
||||
<EdgeUIThemeTransition Edge="Top" />
|
||||
</TransitionCollection>
|
||||
</controls:WinoNavigationViewItem.ContentTransitions>
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<controls:WinoFontIcon FontSize="64" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(Parameter.ProviderType)}" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
<muxc:NavigationViewItem.InfoBadge>
|
||||
<muxc:InfoBadge
|
||||
Background="{ThemeResource SystemAccentColor}"
|
||||
Foreground="White"
|
||||
Visibility="{x:Bind helpers:XamlHelpers.CountToVisibilityConverter(UnreadItemCount), Mode=OneWay}"
|
||||
Value="{x:Bind UnreadItemCount, Mode=OneWay}" />
|
||||
</muxc:NavigationViewItem.InfoBadge>
|
||||
<Grid
|
||||
MaxHeight="70"
|
||||
Margin="0,8"
|
||||
RowSpacing="6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="2" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<TextBlock
|
||||
x:Name="AccountNameTextblock"
|
||||
FontWeight="{x:Bind helpers:XamlHelpers.GetFontWeightByChildSelectedState(IsChildSelected), Mode=OneWay}"
|
||||
MaxLines="1"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{x:Bind AccountName, Mode=OneWay}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
|
||||
<TextBlock
|
||||
FontSize="13"
|
||||
MaxLines="1"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind Parameter.Address, Mode=OneWay}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
</StackPanel>
|
||||
|
||||
<PathIcon
|
||||
x:Name="AttentionIcon"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
x:Load="{x:Bind IsAttentionRequired, Mode=OneWay}"
|
||||
Data="F1 M 2.021484 18.769531 C 1.767578 18.769531 1.52832 18.720703 1.303711 18.623047 C 1.079102 18.525391 0.880534 18.391928 0.708008 18.222656 C 0.535482 18.053385 0.398763 17.856445 0.297852 17.631836 C 0.19694 17.407227 0.146484 17.167969 0.146484 16.914062 C 0.146484 16.614584 0.211589 16.328125 0.341797 16.054688 L 7.695312 1.347656 C 7.851562 1.035156 8.082682 0.784506 8.388672 0.595703 C 8.694661 0.406902 9.023438 0.3125 9.375 0.3125 C 9.726562 0.3125 10.055338 0.406902 10.361328 0.595703 C 10.667317 0.784506 10.898438 1.035156 11.054688 1.347656 L 18.408203 16.054688 C 18.53841 16.328125 18.603516 16.614584 18.603516 16.914062 C 18.603516 17.167969 18.553059 17.407227 18.452148 17.631836 C 18.351236 17.856445 18.216145 18.053385 18.046875 18.222656 C 17.877604 18.391928 17.679035 18.525391 17.451172 18.623047 C 17.223307 18.720703 16.982422 18.769531 16.728516 18.769531 Z M 16.728516 17.519531 C 16.884766 17.519531 17.027994 17.460938 17.158203 17.34375 C 17.28841 17.226562 17.353516 17.086588 17.353516 16.923828 C 17.353516 16.806641 17.330729 16.702475 17.285156 16.611328 L 9.931641 1.904297 C 9.879557 1.793621 9.80306 1.708984 9.702148 1.650391 C 9.601236 1.591797 9.492188 1.5625 9.375 1.5625 C 9.257812 1.5625 9.148763 1.593426 9.047852 1.655273 C 8.946939 1.717123 8.870442 1.800131 8.818359 1.904297 L 1.464844 16.611328 C 1.419271 16.702475 1.396484 16.803387 1.396484 16.914062 C 1.396484 17.083334 1.459961 17.226562 1.586914 17.34375 C 1.713867 17.460938 1.858724 17.519531 2.021484 17.519531 Z M 8.75 11.875 L 8.75 6.875 C 8.75 6.705729 8.811849 6.559245 8.935547 6.435547 C 9.059244 6.31185 9.205729 6.25 9.375 6.25 C 9.544271 6.25 9.690755 6.31185 9.814453 6.435547 C 9.93815 6.559245 10 6.705729 10 6.875 L 10 11.875 C 10 12.044271 9.93815 12.190756 9.814453 12.314453 C 9.690755 12.438151 9.544271 12.5 9.375 12.5 C 9.205729 12.5 9.059244 12.438151 8.935547 12.314453 C 8.811849 12.190756 8.75 12.044271 8.75 11.875 Z M 8.4375 14.375 C 8.4375 14.114584 8.528646 13.893229 8.710938 13.710938 C 8.893229 13.528646 9.114583 13.4375 9.375 13.4375 C 9.635416 13.4375 9.856771 13.528646 10.039062 13.710938 C 10.221354 13.893229 10.3125 14.114584 10.3125 14.375 C 10.3125 14.635417 10.221354 14.856771 10.039062 15.039062 C 9.856771 15.221354 9.635416 15.3125 9.375 15.3125 C 9.114583 15.3125 8.893229 15.221354 8.710938 15.039062 C 8.528646 14.856771 8.4375 14.635417 8.4375 14.375 Z "
|
||||
Foreground="{ThemeResource InfoBarWarningSeverityIconBackground}" />
|
||||
|
||||
<muxc:ProgressBar
|
||||
x:Name="SynchronizationProgressBar"
|
||||
Grid.Row="1"
|
||||
Grid.ColumnSpan="3"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{ThemeResource AppBarItemBackgroundThemeBrush}"
|
||||
Foreground="{ThemeResource AppBarItemForegroundThemeBrush}"
|
||||
Visibility="{x:Bind IsSynchronizationProgressVisible, Mode=OneWay}"
|
||||
Value="{x:Bind SynchronizationProgress, Mode=OneWay}" />
|
||||
|
||||
</Grid>
|
||||
</controls:AccountNavigationItem>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Clickable New Style Account Template -->
|
||||
<DataTemplate x:Key="ClickableAccountMenuTemplate" x:DataType="menu:AccountMenuItem">
|
||||
<controls:AccountNavigationItem
|
||||
x:Name="AccountItem"
|
||||
BindingData="{x:Bind}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
DataContext="{x:Bind}"
|
||||
IsActiveAccount="{x:Bind IsSelected, Mode=OneWay}"
|
||||
IsChildSelected="{x:Bind IsChildSelected, Mode=TwoWay}"
|
||||
IsExpanded="{x:Bind IsExpanded, Mode=TwoWay}"
|
||||
SelectsOnInvoked="False"
|
||||
Style="{StaticResource SingleAccountNavigationViewItemTemplate}">
|
||||
@@ -128,7 +48,7 @@
|
||||
</TransitionCollection>
|
||||
</controls:WinoNavigationViewItem.ContentTransitions>
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<controls:WinoFontIcon FontSize="64" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(Parameter.ProviderType)}" />
|
||||
<controls:WinoFontIcon FontSize="12" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(Parameter.ProviderType)}" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
<muxc:NavigationViewItem.InfoBadge>
|
||||
<muxc:InfoBadge
|
||||
@@ -326,14 +246,15 @@
|
||||
<DataTemplate x:Key="MergedAccountTemplate" x:DataType="menu:MergedAccountMenuItem">
|
||||
<controls:AccountNavigationItem
|
||||
x:Name="AccountItem"
|
||||
BindingData="{x:Bind}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
DataContext="{x:Bind}"
|
||||
IsActiveAccount="{x:Bind IsSelected, Mode=OneWay}"
|
||||
IsChildSelected="{x:Bind IsChildSelected, Mode=TwoWay}"
|
||||
IsActiveAccount="{x:Bind IsSelected, Mode=TwoWay}"
|
||||
IsExpanded="{x:Bind IsExpanded, Mode=TwoWay}"
|
||||
SelectsOnInvoked="False"
|
||||
Style="{StaticResource SingleAccountNavigationViewItemTemplate}">
|
||||
MenuItemsSource="{x:Bind SubMenuItems}"
|
||||
Style="{StaticResource SingleAccountNavigationViewItemTemplate}"
|
||||
SelectsOnInvoked="False">
|
||||
<muxc:NavigationViewItem.InfoBadge>
|
||||
<muxc:InfoBadge
|
||||
x:Name="FolderInfoBadge"
|
||||
@@ -347,9 +268,9 @@
|
||||
<EdgeUIThemeTransition Edge="Top" />
|
||||
</TransitionCollection>
|
||||
</controls:WinoNavigationViewItem.ContentTransitions>
|
||||
<controls:AccountNavigationItem.Icon>
|
||||
<controls:WinoNavigationViewItem.Icon>
|
||||
<PathIcon Data="F1 M 8.613281 17.5 C 8.75 17.942709 8.945312 18.359375 9.199219 18.75 L 4.921875 18.75 C 4.433594 18.75 3.966471 18.650717 3.520508 18.452148 C 3.074544 18.25358 2.683919 17.986654 2.348633 17.651367 C 2.013346 17.31608 1.746419 16.925455 1.547852 16.479492 C 1.349284 16.033529 1.25 15.566406 1.25 15.078125 L 1.25 4.921875 C 1.25 4.433594 1.349284 3.966473 1.547852 3.520508 C 1.746419 3.074545 2.013346 2.68392 2.348633 2.348633 C 2.683919 2.013348 3.074544 1.74642 3.520508 1.547852 C 3.966471 1.349285 4.433594 1.25 4.921875 1.25 L 15.078125 1.25 C 15.566406 1.25 16.033527 1.349285 16.479492 1.547852 C 16.925455 1.74642 17.31608 2.013348 17.651367 2.348633 C 17.986652 2.68392 18.25358 3.074545 18.452148 3.520508 C 18.650715 3.966473 18.75 4.433594 18.75 4.921875 L 18.75 6.572266 C 18.580729 6.344402 18.390299 6.132813 18.178711 5.9375 C 17.967121 5.742188 17.740885 5.566407 17.5 5.410156 L 17.5 4.951172 C 17.5 4.625651 17.433268 4.314779 17.299805 4.018555 C 17.16634 3.722332 16.987305 3.461914 16.762695 3.237305 C 16.538086 3.012695 16.277668 2.83366 15.981445 2.700195 C 15.685221 2.566732 15.374349 2.5 15.048828 2.5 L 4.951172 2.5 C 4.619141 2.5 4.303385 2.568359 4.003906 2.705078 C 3.704427 2.841797 3.44401 3.02409 3.222656 3.251953 C 3.001302 3.479818 2.825521 3.745117 2.695312 4.047852 C 2.565104 4.350587 2.5 4.66797 2.5 5 L 13.310547 5 C 12.60091 5.266928 11.998697 5.683594 11.503906 6.25 L 2.5 6.25 L 2.5 15.048828 C 2.5 15.38737 2.568359 15.704753 2.705078 16.000977 C 2.841797 16.297201 3.024088 16.55599 3.251953 16.777344 C 3.479818 16.998697 3.745117 17.174479 4.047852 17.304688 C 4.350586 17.434896 4.667969 17.5 5 17.5 Z M 18.125 9.443359 C 18.125 9.866537 18.040363 10.263672 17.871094 10.634766 C 17.701822 11.005859 17.473957 11.329753 17.1875 11.606445 C 16.901041 11.883139 16.56901 12.101237 16.191406 12.260742 C 15.813802 12.420248 15.416666 12.5 15 12.5 C 14.563802 12.5 14.1569 12.41862 13.779297 12.255859 C 13.401691 12.0931 13.071288 11.870117 12.788086 11.586914 C 12.504882 11.303711 12.2819 10.973308 12.119141 10.595703 C 11.95638 10.2181 11.875 9.811198 11.875 9.375 C 11.875 8.938803 11.95638 8.531901 12.119141 8.154297 C 12.2819 7.776693 12.504882 7.446289 12.788086 7.163086 C 13.071288 6.879883 13.401691 6.656901 13.779297 6.494141 C 14.1569 6.331381 14.563802 6.25 15 6.25 C 15.449218 6.25 15.864257 6.333008 16.245117 6.499023 C 16.625977 6.665039 16.956379 6.892904 17.236328 7.182617 C 17.516275 7.472331 17.734375 7.810873 17.890625 8.198242 C 18.046875 8.585612 18.125 9.000651 18.125 9.443359 Z M 20 16.25 C 20 16.666666 19.926758 17.049154 19.780273 17.397461 C 19.633789 17.745768 19.435221 18.058268 19.18457 18.334961 C 18.933918 18.611654 18.642578 18.854166 18.310547 19.0625 C 17.978516 19.270834 17.626953 19.444986 17.255859 19.584961 C 16.884766 19.724936 16.505533 19.829102 16.118164 19.897461 C 15.730794 19.96582 15.358072 20 15 20 C 14.654947 20 14.291992 19.96582 13.911133 19.897461 C 13.530273 19.829102 13.154297 19.726562 12.783203 19.589844 C 12.412109 19.453125 12.058919 19.282227 11.723633 19.077148 C 11.388346 18.87207 11.092122 18.632812 10.834961 18.359375 C 10.577799 18.085938 10.374349 17.779947 10.224609 17.441406 C 10.074869 17.102865 10 16.731771 10 16.328125 L 10 15.78125 C 10 15.501303 10.052083 15.237631 10.15625 14.990234 C 10.260416 14.742839 10.405273 14.526367 10.59082 14.34082 C 10.776367 14.155273 10.991211 14.010417 11.235352 13.90625 C 11.479492 13.802084 11.744791 13.75 12.03125 13.75 L 17.96875 13.75 C 18.248697 13.75 18.512369 13.803711 18.759766 13.911133 C 19.00716 14.018555 19.222004 14.163412 19.404297 14.345703 C 19.586588 14.527995 19.731445 14.742839 19.838867 14.990234 C 19.946289 15.237631 20 15.501303 20 15.78125 Z " />
|
||||
</controls:AccountNavigationItem.Icon>
|
||||
</controls:WinoNavigationViewItem.Icon>
|
||||
|
||||
<Grid MinHeight="50">
|
||||
<StackPanel VerticalAlignment="Center" Spacing="0">
|
||||
@@ -480,7 +401,6 @@
|
||||
MergedAccountFolderTemplate="{StaticResource MergedAccountFolderMenuItemTemplate}"
|
||||
MergedAccountMoreExpansionItemTemplate="{StaticResource MergedAccountMoreFolderItemTemplate}"
|
||||
MergedAccountTemplate="{StaticResource MergedAccountTemplate}"
|
||||
NestedAccountMenuTemplate="{StaticResource NestedAccountMenuTemplate}"
|
||||
NewMailTemplate="{StaticResource CreateNewMailTemplate}"
|
||||
RatingItemTemplate="{StaticResource RatingItemTemplate}"
|
||||
SeperatorTemplate="{StaticResource SeperatorTemplate}"
|
||||
|
||||
@@ -140,20 +140,21 @@ namespace Wino.Views
|
||||
{
|
||||
if (message.FolderId == default) return;
|
||||
|
||||
var menuItem = ViewModel.MenuItems.GetFolderItem(message.FolderId);
|
||||
if (ViewModel.MenuItems.TryGetFolderMenuItem(message.FolderId, out IBaseFolderMenuItem foundMenuItem))
|
||||
{
|
||||
if (foundMenuItem == null) return;
|
||||
|
||||
if (menuItem == null) return;
|
||||
foundMenuItem.Expand();
|
||||
|
||||
menuItem.Expand();
|
||||
await ViewModel.NavigateFolderAsync(foundMenuItem);
|
||||
|
||||
await ViewModel.NavigateFolderAsync(menuItem);
|
||||
navigationView.SelectedItem = foundMenuItem;
|
||||
|
||||
navigationView.SelectedItem = menuItem;
|
||||
if (message.NavigateMailItem == null) return;
|
||||
|
||||
if (message.NavigateMailItem == null) return;
|
||||
|
||||
// At this point folder is navigated and items are loaded.
|
||||
WeakReferenceMessenger.Default.Send(new MailItemNavigationRequested(message.NavigateMailItem.UniqueId));
|
||||
// At this point folder is navigated and items are loaded.
|
||||
WeakReferenceMessenger.Default.Send(new MailItemNavigationRequested(message.NavigateMailItem.UniqueId));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -205,6 +206,9 @@ namespace Wino.Views
|
||||
private void BackButtonClicked(Controls.Advanced.WinoAppTitleBar sender, RoutedEventArgs args)
|
||||
{
|
||||
WeakReferenceMessenger.Default.Send(new ClearMailSelectionsRequested());
|
||||
WeakReferenceMessenger.Default.Send(new DisposeRenderingFrameRequested());
|
||||
WeakReferenceMessenger.Default.Send(new ShellStateUpdated());
|
||||
|
||||
}
|
||||
|
||||
private async void MenuItemContextRequested(UIElement sender, ContextRequestedEventArgs args)
|
||||
|
||||
@@ -1,29 +1,40 @@
|
||||
using System.Diagnostics;
|
||||
using System.Numerics;
|
||||
using CommunityToolkit.WinUI;
|
||||
using System.Numerics;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Windows.UI.Xaml;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Controls
|
||||
{
|
||||
public class AccountNavigationItem : WinoNavigationViewItem
|
||||
{
|
||||
|
||||
public static readonly DependencyProperty IsActiveAccountProperty = DependencyProperty.Register(nameof(IsActiveAccount), typeof(bool), typeof(AccountNavigationItem), new PropertyMetadata(false, new PropertyChangedCallback(OnIsActiveAccountChanged)));
|
||||
public static readonly DependencyProperty BindingDataProperty = DependencyProperty.Register(nameof(BindingData), typeof(IAccountMenuItem), typeof(AccountNavigationItem), new PropertyMetadata(null));
|
||||
|
||||
|
||||
public bool IsActiveAccount
|
||||
{
|
||||
get { return (bool)GetValue(IsActiveAccountProperty); }
|
||||
set { SetValue(IsActiveAccountProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IsActiveAccountProperty = DependencyProperty.Register(nameof(IsActiveAccount), typeof(bool), typeof(AccountNavigationItem), new PropertyMetadata(false, new PropertyChangedCallback(OnIsActiveAccountChanged)));
|
||||
|
||||
public IAccountMenuItem BindingData
|
||||
{
|
||||
get { return (IAccountMenuItem)GetValue(BindingDataProperty); }
|
||||
set { SetValue(BindingDataProperty, value); }
|
||||
}
|
||||
|
||||
private const string PART_NavigationViewItemMenuItemsHost = "NavigationViewItemMenuItemsHost";
|
||||
private const string PART_SelectionIndicator = "SelectionIndicator";
|
||||
private const string PART_SelectionIndicator = "CustomSelectionIndicator";
|
||||
|
||||
private ItemsRepeater _itemsRepeater;
|
||||
private Windows.UI.Xaml.Shapes.Rectangle _selectionIndicator;
|
||||
|
||||
public AccountNavigationItem()
|
||||
{
|
||||
DefaultStyleKey = typeof(AccountNavigationItem);
|
||||
}
|
||||
|
||||
protected override void OnApplyTemplate()
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
@@ -48,7 +59,13 @@ namespace Wino.Controls
|
||||
{
|
||||
if (_selectionIndicator == null) return;
|
||||
|
||||
_selectionIndicator.Scale = IsActiveAccount ? new Vector3(1,1,1) : new Vector3(0,0,0);
|
||||
// Adjsuting Margin in the styles are not possible due to the fact that we use the same tempalte for different types of menu items.
|
||||
// Account templates listed under merged accounts will have Padding of 44. We must adopt to that.
|
||||
|
||||
bool hasParentMenuItem = BindingData is IAccountMenuItem accountMenuItem && accountMenuItem.ParentMenuItem != null;
|
||||
|
||||
_selectionIndicator.Margin = !hasParentMenuItem ? new Thickness(-44, 12, 0, 12) : new Thickness(-60, 12, -60, 12);
|
||||
_selectionIndicator.Scale = IsActiveAccount ? new Vector3(1, 1, 1) : new Vector3(0, 0, 0);
|
||||
_selectionIndicator.Visibility = IsActiveAccount ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<StackPanel
|
||||
x:Name="LeftMenuStackPanel"
|
||||
Orientation="Horizontal"
|
||||
SizeChanged="asd">
|
||||
SizeChanged="TitlebarSizeChanged">
|
||||
<Button
|
||||
x:Name="PaneButton"
|
||||
Width="48"
|
||||
|
||||
@@ -161,9 +161,6 @@ namespace Wino.Controls.Advanced
|
||||
IsNavigationPaneOpen = !IsNavigationPaneOpen;
|
||||
}
|
||||
|
||||
private void asd(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
DrawTitleBar();
|
||||
}
|
||||
private void TitlebarSizeChanged(object sender, SizeChangedEventArgs e) => DrawTitleBar();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
Style="{StaticResource WinoDialogStyle}"
|
||||
DefaultButton="Primary"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
PrimaryButtonText="{x:Bind domain:Translator.Buttons_Create}"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
PrimaryButtonClick="UpdateOrCreateClicked"
|
||||
SecondaryButtonText="{x:Bind domain:Translator.Buttons_Cancel}"
|
||||
|
||||
@@ -25,6 +25,11 @@ namespace Wino.Dialogs
|
||||
DialogDescription.Text = description;
|
||||
}
|
||||
|
||||
public void SetPrimaryButtonText(string text)
|
||||
{
|
||||
PrimaryButtonText = text;
|
||||
}
|
||||
|
||||
private void CancelClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
Hide();
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace Wino.Selectors
|
||||
{
|
||||
public DataTemplate MenuItemTemplate { get; set; }
|
||||
public DataTemplate AccountManagementTemplate { get; set; }
|
||||
public DataTemplate NestedAccountMenuTemplate { get; set; }
|
||||
public DataTemplate ClickableAccountMenuTemplate { get; set; }
|
||||
public DataTemplate MergedAccountTemplate { get; set; }
|
||||
public DataTemplate MergedAccountFolderTemplate { get; set; }
|
||||
@@ -34,7 +33,7 @@ namespace Wino.Selectors
|
||||
return SeperatorTemplate;
|
||||
else if (item is AccountMenuItem accountMenuItem)
|
||||
// Merged inbox account menu items must be nested.
|
||||
return accountMenuItem.Parameter.MergedInboxId != null ? NestedAccountMenuTemplate : ClickableAccountMenuTemplate;
|
||||
return ClickableAccountMenuTemplate;
|
||||
else if (item is ManageAccountsMenuItem)
|
||||
return AccountManagementTemplate;
|
||||
else if (item is RateMenuItem)
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace Wino.Services
|
||||
public void InfoBarMessage(string title, string message, InfoBarMessageType messageType, string actionButtonText, Action action)
|
||||
=> WeakReferenceMessenger.Default.Send(new InfoBarMessageRequested(messageType, title, message, actionButtonText, action));
|
||||
|
||||
public async Task<string> ShowTextInputDialogAsync(string currentInput, string dialogTitle, string dialogDescription)
|
||||
public async Task<string> ShowTextInputDialogAsync(string currentInput, string dialogTitle, string dialogDescription, string primaryButtonText)
|
||||
{
|
||||
var inputDialog = new TextInputDialog()
|
||||
{
|
||||
@@ -161,6 +161,7 @@ namespace Wino.Services
|
||||
};
|
||||
|
||||
inputDialog.SetDescription(dialogDescription);
|
||||
inputDialog.SetPrimaryButtonText(primaryButtonText);
|
||||
|
||||
await HandleDialogPresentationAsync(inputDialog);
|
||||
|
||||
|
||||
@@ -125,7 +125,19 @@ namespace Wino.Services
|
||||
|
||||
if (listingFrame == null) return false;
|
||||
|
||||
listingFrame.Navigate(pageType, parameter, transitionInfo);
|
||||
// Active page is mail list page and we are opening a mail item.
|
||||
// No navigation needed, just refresh the rendered mail item.
|
||||
if (listingFrame.Content != null
|
||||
&& listingFrame.Content.GetType() == GetPageType(WinoPage.MailRenderingPage)
|
||||
&& parameter is MailItemViewModel mailItemViewModel
|
||||
&& page != WinoPage.ComposePage)
|
||||
{
|
||||
WeakReferenceMessenger.Default.Send(new NewMailItemRenderingRequestedEvent(mailItemViewModel));
|
||||
}
|
||||
else
|
||||
{
|
||||
listingFrame.Navigate(pageType, parameter, transitionInfo);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -169,10 +181,6 @@ namespace Wino.Services
|
||||
throw new ArgumentException("MailItem must be of type MailItemViewModel.");
|
||||
}
|
||||
|
||||
public void NavigateWelcomePage() => Navigate(WinoPage.WelcomePage);
|
||||
|
||||
public void NavigateManageAccounts() => Navigate(WinoPage.AccountManagementPage);
|
||||
|
||||
public void NavigateFolder(NavigateMailFolderEventArgs args)
|
||||
=> Navigate(WinoPage.MailListPage, args, NavigationReferenceFrame.ShellFrame);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:primitiveContract7Present="using:Microsoft.UI.Xaml.Controls.Primitives?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
|
||||
xmlns:primitives="using:Microsoft.UI.Xaml.Controls.Primitives"
|
||||
xmlns:winoControls="using:Wino.Controls"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls">
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
@@ -149,7 +150,7 @@
|
||||
<!-- Clickable account navigation view item style -->
|
||||
<!-- This introduces custom selector pipe for multi selection in NavigationView in shell. -->
|
||||
|
||||
<Style x:Key="SingleAccountNavigationViewItemTemplate" TargetType="muxc:NavigationViewItem">
|
||||
<Style x:Key="SingleAccountNavigationViewItemTemplate" TargetType="winoControls:AccountNavigationItem">
|
||||
<Setter Property="Foreground" Value="{ThemeResource NavigationViewItemForeground}" />
|
||||
<Setter Property="Background" Value="{ThemeResource NavigationViewItemBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrush}" />
|
||||
@@ -163,46 +164,105 @@
|
||||
<Setter Property="TabNavigation" Value="Once" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="muxc:NavigationViewItem">
|
||||
<ControlTemplate TargetType="winoControls:AccountNavigationItem">
|
||||
<Grid x:Name="NVIRootGrid">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<primitives:NavigationViewItemPresenter
|
||||
x:Name="NavigationViewItemPresenter"
|
||||
Icon="{TemplateBinding Icon}"
|
||||
InfoBadge="{TemplateBinding InfoBadge}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
UseSystemFocusVisuals="{TemplateBinding UseSystemFocusVisuals}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
|
||||
CornerRadius="4"
|
||||
IsTabStop="false"
|
||||
Control.IsTemplateFocusTarget="True">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Rectangle
|
||||
x:Name="CustomSelectionIndicator"
|
||||
Width="3"
|
||||
Opacity="1"
|
||||
HorizontalAlignment="Left"
|
||||
Visibility="Collapsed"
|
||||
Scale="0,0,0"
|
||||
Fill="{ThemeResource NavigationViewSelectionIndicatorForeground}"
|
||||
RadiusX="2"
|
||||
RadiusY="2">
|
||||
<Rectangle.ScaleTransition>
|
||||
<Vector3Transition />
|
||||
</Rectangle.ScaleTransition>
|
||||
</Rectangle>
|
||||
<ContentPresenter Content="{TemplateBinding Content}" Grid.Column="1" />
|
||||
</Grid>
|
||||
</primitives:NavigationViewItemPresenter>
|
||||
|
||||
<muxc:ItemsRepeater
|
||||
x:Load="False"
|
||||
Grid.Row="1"
|
||||
Visibility="Collapsed"
|
||||
x:Name="NavigationViewItemMenuItemsHost">
|
||||
<muxc:ItemsRepeater.Layout>
|
||||
<muxc:StackLayout Orientation="Vertical" />
|
||||
</muxc:ItemsRepeater.Layout>
|
||||
</muxc:ItemsRepeater>
|
||||
|
||||
|
||||
<!-- Custom selecotr pipe. -->
|
||||
|
||||
|
||||
<FlyoutBase.AttachedFlyout>
|
||||
<Flyout x:Name="ChildrenFlyout" Placement="Right">
|
||||
<Flyout x:Name="ChildrenFlyout" Placement="RightEdgeAlignedTop">
|
||||
<Flyout.FlyoutPresenterStyle>
|
||||
<Style TargetType="FlyoutPresenter">
|
||||
<Setter Property="Padding" Value="{ThemeResource NavigationViewItemChildrenMenuFlyoutPadding}" />
|
||||
<!-- Set negative top margin to make the flyout align exactly with the button -->
|
||||
<Setter Property="Margin" Value="0,-4,0,0" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
|
||||
<Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="FlyoutPresenter">
|
||||
<ScrollViewer
|
||||
x:Name="ScrollViewer"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"
|
||||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
||||
ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}">
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
AutomationProperties.AccessibilityView="Raw">
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{ThemeResource OverlayCornerRadius}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
</ScrollViewer>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
@@ -214,53 +274,6 @@
|
||||
</Grid>
|
||||
</Flyout>
|
||||
</FlyoutBase.AttachedFlyout>
|
||||
<primitiveContract7Present:NavigationViewItemPresenter
|
||||
x:Name="NavigationViewItemPresenter"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
IsTabStop="false"
|
||||
Icon="{TemplateBinding Icon}"
|
||||
InfoBadge="{TemplateBinding InfoBadge}"
|
||||
Control.IsTemplateFocusTarget="True"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
UseSystemFocusVisuals="{TemplateBinding UseSystemFocusVisuals}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}" />
|
||||
<muxc:ItemsRepeater
|
||||
x:Name="NavigationViewItemMenuItemsHost"
|
||||
Grid.Row="1"
|
||||
Visibility="Collapsed"
|
||||
x:Load="False">
|
||||
<muxc:ItemsRepeater.Layout>
|
||||
<muxc:StackLayout Orientation="Vertical" />
|
||||
</muxc:ItemsRepeater.Layout>
|
||||
</muxc:ItemsRepeater>
|
||||
|
||||
<!-- Custom selecotr pipe. -->
|
||||
<Rectangle
|
||||
x:Name="SelectionIndicator"
|
||||
Width="3"
|
||||
Opacity="1"
|
||||
HorizontalAlignment="Left"
|
||||
Visibility="Collapsed"
|
||||
Margin="4,12"
|
||||
Scale="0,0,0"
|
||||
Fill="{ThemeResource NavigationViewSelectionIndicatorForeground}"
|
||||
RadiusX="2"
|
||||
RadiusY="2">
|
||||
<Rectangle.ScaleTransition>
|
||||
<Vector3Transition />
|
||||
</Rectangle.ScaleTransition>
|
||||
</Rectangle>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="ItemOnNavigationViewListPositionStates">
|
||||
<VisualState x:Name="OnLeftNavigation">
|
||||
@@ -272,7 +285,7 @@
|
||||
<VisualState.Setters>
|
||||
<Setter Target="NavigationViewItemPresenter.Margin" Value="{ThemeResource TopNavigationViewItemMargin}" />
|
||||
<Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPane}" />
|
||||
<Setter Target="ChildrenFlyout.Placement" Value="Bottom" />
|
||||
<Setter Target="ChildrenFlyout.Placement" Value="BottomEdgeAlignedLeft" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="OnTopNavigationOverflow">
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
ContentAlignment="Vertical">
|
||||
<Grid Height="160" RowSpacing="6">
|
||||
<Grid MinHeight="160" RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
|
||||
@@ -811,7 +811,7 @@
|
||||
|
||||
<Grid Grid.Column="1" x:Name="RenderingGrid">
|
||||
<!-- Mail Rendering Frame -->
|
||||
<Frame x:Name="RenderingFrame" IsNavigationStackEnabled="False" />
|
||||
<Frame x:Name="RenderingFrame" IsNavigationStackEnabled="False" />
|
||||
|
||||
<!-- No Mail Selected Message -->
|
||||
<StackPanel
|
||||
|
||||
@@ -37,7 +37,8 @@ namespace Wino.Views
|
||||
IRecipient<ActiveMailItemChangedEvent>,
|
||||
IRecipient<ActiveMailFolderChangedEvent>,
|
||||
IRecipient<SelectMailItemContainerEvent>,
|
||||
IRecipient<ShellStateUpdated>
|
||||
IRecipient<ShellStateUpdated>,
|
||||
IRecipient<DisposeRenderingFrameRequested>
|
||||
{
|
||||
private const string NarrowVisualStateKey = "NarrowState";
|
||||
private const string AdaptivenessStatesKey = "AdaptiveStates";
|
||||
@@ -562,5 +563,10 @@ namespace Wino.Views
|
||||
await ViewModel.PerformSearchAsync();
|
||||
}
|
||||
}
|
||||
|
||||
public void Receive(DisposeRenderingFrameRequested message)
|
||||
{
|
||||
ViewModel.NavigationService.Navigate(WinoPage.IdlePage, null, NavigationReferenceFrame.RenderingFrame, NavigationTransitionType.DrillIn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Wino.Views
|
||||
InitializeComponent();
|
||||
|
||||
Environment.SetEnvironmentVariable("WEBVIEW2_DEFAULT_BACKGROUND_COLOR", "00FFFFFF");
|
||||
Environment.SetEnvironmentVariable("WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS", "--enable-features=OverlayScrollbar,msOverlayScrollbarWinStyle,msOverlayScrollbarWinStyleAnimation");
|
||||
Environment.SetEnvironmentVariable("WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS", "--enable-features=OverlayScrollbar,msOverlayScrollbarWinStyle,msOverlayScrollbarWinStyleAnimation,msWebView2CodeCache");
|
||||
}
|
||||
|
||||
public override async void OnEditorThemeChanged()
|
||||
|
||||
@@ -12,11 +12,7 @@
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Border
|
||||
Margin="0,0,7,7"
|
||||
Background="{ThemeResource WinoContentZoneBackgroud}"
|
||||
BorderBrush="{StaticResource CardStrokeColorDefaultBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="7">
|
||||
Style="{StaticResource PageRootBorderStyle}">
|
||||
<Grid
|
||||
MaxWidth="900"
|
||||
Padding="20"
|
||||
|
||||
@@ -11,12 +11,7 @@
|
||||
Style="{StaticResource PageStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Border
|
||||
Margin="0,0,7,7"
|
||||
Background="{ThemeResource WinoContentZoneBackgroud}"
|
||||
BorderBrush="{StaticResource CardStrokeColorDefaultBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="7">
|
||||
<Border Style="{StaticResource PageRootBorderStyle}">
|
||||
<Grid
|
||||
MaxWidth="900"
|
||||
Padding="20"
|
||||
|
||||
Reference in New Issue
Block a user