Moving expander chevron to mail display control.

This commit is contained in:
Burak Kaan Köse
2024-08-30 02:20:16 +02:00
parent 72ff8e67ed
commit b9a1756f90
4 changed files with 43 additions and 3 deletions

View File

@@ -310,7 +310,7 @@ namespace Wino.Controls.Advanced
} }
else if (addedItem is ThreadMailItemViewModel threadMailItemViewModel) else if (addedItem is ThreadMailItemViewModel threadMailItemViewModel)
{ {
threadMailItemViewModel.IsThreadExpanded = true; // threadMailItemViewModel.IsThreadExpanded = true;
// Don't select thread containers. // Don't select thread containers.
SelectedItems.Remove(addedItem); SelectedItems.Remove(addedItem);

View File

@@ -147,20 +147,31 @@
</Grid> </Grid>
<!-- Subject + IsDraft --> <!-- Subject + IsDraft -->
<Grid Grid.Row="1" ColumnSpacing="4"> <Grid Grid.Row="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<FontIcon
x:Name="ExpanderChevron"
Margin="0,0,2,0"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="12"
Glyph="&#xE76C;"
Visibility="{x:Bind IsThreadExpanderVisible, Mode=OneWay}" />
<TextBlock <TextBlock
x:Name="TitleText" x:Name="TitleText"
Grid.Column="1"
MaxLines="1" MaxLines="1"
Text="{x:Bind MailItem.Subject}" Text="{x:Bind MailItem.Subject}"
TextTrimming="CharacterEllipsis" /> TextTrimming="CharacterEllipsis" />
<TextBlock <TextBlock
Grid.Column="1" Grid.Column="2"
Margin="4,0,0,0"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
FontSize="11" FontSize="11"
@@ -279,6 +290,19 @@
</VisualState.StateTriggers> </VisualState.StateTriggers>
</VisualState> </VisualState>
</VisualStateGroup> </VisualStateGroup>
<!-- Thread Expanding States -->
<VisualStateGroup x:Name="ExpanderStates">
<VisualState x:Name="NotExpanded" />
<VisualState x:Name="ExpandedState">
<VisualState.Setters>
<Setter Target="ExpanderChevron.Glyph" Value="&#xE70D;" />
</VisualState.Setters>
<VisualState.StateTriggers>
<StateTrigger IsActive="{x:Bind IsThreadExpanded, Mode=OneWay}" />
</VisualState.StateTriggers>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups> </VisualStateManager.VisualStateGroups>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@@ -28,6 +28,20 @@ namespace Wino.Controls
public static readonly DependencyProperty MailItemProperty = DependencyProperty.Register(nameof(MailItem), typeof(IMailItem), typeof(MailItemDisplayInformationControl), new PropertyMetadata(null)); public static readonly DependencyProperty MailItemProperty = DependencyProperty.Register(nameof(MailItem), typeof(IMailItem), typeof(MailItemDisplayInformationControl), new PropertyMetadata(null));
public static readonly DependencyProperty IsHoverActionsEnabledProperty = DependencyProperty.Register(nameof(IsHoverActionsEnabled), typeof(bool), typeof(MailItemDisplayInformationControl), new PropertyMetadata(true)); public static readonly DependencyProperty IsHoverActionsEnabledProperty = DependencyProperty.Register(nameof(IsHoverActionsEnabled), typeof(bool), typeof(MailItemDisplayInformationControl), new PropertyMetadata(true));
public static readonly DependencyProperty Prefer24HourTimeFormatProperty = DependencyProperty.Register(nameof(Prefer24HourTimeFormat), typeof(bool), typeof(MailItemDisplayInformationControl), new PropertyMetadata(false)); public static readonly DependencyProperty Prefer24HourTimeFormatProperty = DependencyProperty.Register(nameof(Prefer24HourTimeFormat), typeof(bool), typeof(MailItemDisplayInformationControl), new PropertyMetadata(false));
public static readonly DependencyProperty IsThreadExpanderVisibleProperty = DependencyProperty.Register(nameof(IsThreadExpanderVisible), typeof(bool), typeof(MailItemDisplayInformationControl), new PropertyMetadata(false));
public static readonly DependencyProperty IsThreadExpandedProperty = DependencyProperty.Register(nameof(IsThreadExpanded), typeof(bool), typeof(MailItemDisplayInformationControl), new PropertyMetadata(false));
public bool IsThreadExpanded
{
get { return (bool)GetValue(IsThreadExpandedProperty); }
set { SetValue(IsThreadExpandedProperty, value); }
}
public bool IsThreadExpanderVisible
{
get { return (bool)GetValue(IsThreadExpanderVisibleProperty); }
set { SetValue(IsThreadExpanderVisibleProperty, value); }
}
public bool Prefer24HourTimeFormat public bool Prefer24HourTimeFormat
{ {

View File

@@ -176,6 +176,8 @@
IsAvatarVisible="{Binding ElementName=root, Path=ViewModel.PreferencesService.IsShowSenderPicturesEnabled, Mode=OneWay}" IsAvatarVisible="{Binding ElementName=root, Path=ViewModel.PreferencesService.IsShowSenderPicturesEnabled, Mode=OneWay}"
IsHitTestVisible="True" IsHitTestVisible="True"
IsHoverActionsEnabled="{Binding ElementName=root, Path=ViewModel.PreferencesService.IsHoverActionsEnabled, Mode=OneWay}" IsHoverActionsEnabled="{Binding ElementName=root, Path=ViewModel.PreferencesService.IsHoverActionsEnabled, Mode=OneWay}"
IsThreadExpanded="{x:Bind IsThreadExpanded, Mode=TwoWay}"
IsThreadExpanderVisible="True"
LeftHoverAction="{Binding ElementName=root, Path=ViewModel.PreferencesService.LeftHoverAction, Mode=OneWay}" LeftHoverAction="{Binding ElementName=root, Path=ViewModel.PreferencesService.LeftHoverAction, Mode=OneWay}"
MailItem="{x:Bind MailItem, Mode=OneWay}" MailItem="{x:Bind MailItem, Mode=OneWay}"
Prefer24HourTimeFormat="{Binding ElementName=root, Path=ViewModel.PreferencesService.Prefer24HourTimeFormat, Mode=OneWay}" Prefer24HourTimeFormat="{Binding ElementName=root, Path=ViewModel.PreferencesService.Prefer24HourTimeFormat, Mode=OneWay}"