Files
Wino-Mail/Wino.Mail.WinUI/ShellWindow.xaml
2026-02-07 14:03:41 +01:00

134 lines
15 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<winuiex:WindowEx
x:Class="Wino.Mail.WinUI.ShellWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:domain="using:Wino.Core.Domain"
xmlns:local="using:Wino.Mail.WinUI"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:notifyicon="using:H.NotifyIcon"
xmlns:syncModels="using:Wino.Core.Domain.Models.Synchronization"
xmlns:winuiex="using:WinUIEx"
Title="ShellWindow"
mc:Ignorable="d">
<!-- SystemBackdrop will be set by NewThemeService -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.RowSpan="2" Background="{ThemeResource WinoApplicationBackgroundColor}" />
<TitleBar
x:Name="ShellTitleBar"
Title="{x:Bind StatePersistanceService.CoreWindowTitle, Mode=OneWay}"
Margin="-2"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
BackRequested="BackButtonClicked"
Background="Transparent"
IsBackButtonVisible="{x:Bind StatePersistanceService.IsBackButtonVisible, Mode=OneWay}"
IsPaneToggleButtonVisible="True"
PaneToggleRequested="PaneButtonClicked">
<TitleBar.RightHeader>
<StackPanel Orientation="Horizontal" Spacing="8">
<!-- Sync Status Button -->
<Button
x:Name="SyncStatusButton"
Padding="8,4"
VerticalAlignment="Center"
Background="Transparent"
BorderThickness="0"
Visibility="Collapsed">
<StackPanel Orientation="Horizontal" Spacing="6">
<ProgressRing
Width="16"
Height="16"
IsActive="True" />
<TextBlock
x:Name="SyncStatusText"
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}" />
</StackPanel>
<Button.Flyout>
<Flyout x:Name="SyncStatusFlyout" Placement="Bottom">
<ItemsRepeater x:Name="SyncActionsRepeater" ItemsSource="{x:Bind SyncActionItems}">
<ItemsRepeater.ItemTemplate>
<DataTemplate x:DataType="syncModels:SynchronizationActionItem">
<Grid
MinWidth="280"
MaxWidth="400"
Padding="0,6"
ColumnSpacing="8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ProgressRing
Width="16"
Height="16"
IsActive="True" />
<StackPanel Grid.Column="1">
<TextBlock
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Bind AccountName}" />
<TextBlock Text="{x:Bind Description}" TextWrapping="Wrap" />
</StackPanel>
</Grid>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</Flyout>
</Button.Flyout>
</Button>
<!-- Mail/Calendar Mode Switcher -->
<controls:Segmented x:Name="AppModeSegmentedControl" SelectionChanged="SegmentedChanged">
<controls:SegmentedItem>
<controls:SegmentedItem.Icon>
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 16.943359 2.5 C 17.353516 2.5 17.744141 2.583008 18.115234 2.749023 C 18.486328 2.915039 18.810221 3.136395 19.086914 3.413086 C 19.363605 3.689779 19.584961 4.013673 19.750977 4.384766 C 19.916992 4.75586 20 5.146485 20 5.556641 L 20 15.693359 C 20 16.103516 19.916992 16.494141 19.750977 16.865234 C 19.584961 17.236328 19.363605 17.560221 19.086914 17.836914 C 18.810221 18.113607 18.486328 18.334961 18.115234 18.500977 C 17.744141 18.666992 17.353516 18.75 16.943359 18.75 L 3.056641 18.75 C 2.646484 18.75 2.255859 18.666992 1.884766 18.500977 C 1.513672 18.334961 1.189779 18.113607 0.913086 17.836914 C 0.636393 17.560221 0.415039 17.236328 0.249023 16.865234 C 0.083008 16.494141 0 16.103516 0 15.693359 L 0 5.556641 C 0 5.146485 0.083008 4.75586 0.249023 4.384766 C 0.415039 4.013673 0.636393 3.689779 0.913086 3.413086 C 1.189779 3.136395 1.513672 2.915039 1.884766 2.749023 C 2.255859 2.583008 2.646484 2.5 3.056641 2.5 Z M 3.125 3.75 C 2.871094 3.75 2.630208 3.798828 2.402344 3.896484 C 2.174479 3.994141 1.974284 4.129232 1.801758 4.301758 C 1.629232 4.474285 1.494141 4.67448 1.396484 4.902344 C 1.298828 5.130209 1.25 5.371094 1.25 5.625 L 1.25 5.898438 L 10 11.142578 L 18.75 5.898438 L 18.75 5.625 C 18.75 5.371094 18.701172 5.130209 18.603516 4.902344 C 18.505859 4.67448 18.370768 4.474285 18.198242 4.301758 C 18.025715 4.129232 17.82552 3.994141 17.597656 3.896484 C 17.369791 3.798828 17.128906 3.75 16.875 3.75 Z M 16.875 17.5 C 17.128906 17.5 17.369791 17.451172 17.597656 17.353516 C 17.82552 17.255859 18.025715 17.120768 18.198242 16.948242 C 18.370768 16.775717 18.505859 16.575521 18.603516 16.347656 C 18.701172 16.119791 18.75 15.878906 18.75 15.625 L 18.75 7.353516 L 10.322266 12.412109 C 10.224609 12.470703 10.117188 12.5 10 12.5 C 9.882812 12.5 9.775391 12.470703 9.677734 12.412109 L 1.25 7.353516 L 1.25 15.625 C 1.25 15.878906 1.298828 16.119791 1.396484 16.347656 C 1.494141 16.575521 1.629232 16.775717 1.801758 16.948242 C 1.974284 17.120768 2.174479 17.255859 2.402344 17.353516 C 2.630208 17.451172 2.871094 17.5 3.125 17.5 Z " />
</controls:SegmentedItem.Icon>
</controls:SegmentedItem>
<controls:SegmentedItem>
<controls:SegmentedItem.Icon>
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 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 15.078125 C 18.75 15.566406 18.650715 16.033529 18.452148 16.479492 C 18.25358 16.925455 17.986652 17.31608 17.651367 17.651367 C 17.31608 17.986654 16.925455 18.25358 16.479492 18.452148 C 16.033527 18.650717 15.566406 18.75 15.078125 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 Z M 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 17.5 5 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 Z M 15.048828 17.5 C 15.374349 17.5 15.685221 17.433268 15.981445 17.299805 C 16.277668 17.166342 16.538086 16.987305 16.762695 16.762695 C 16.987305 16.538086 17.16634 16.27767 17.299805 15.981445 C 17.433268 15.685222 17.5 15.37435 17.5 15.048828 L 17.5 6.25 L 2.5 6.25 L 2.5 15.048828 C 2.5 15.37435 2.566732 15.685222 2.700195 15.981445 C 2.833659 16.27767 3.012695 16.538086 3.237305 16.762695 C 3.461914 16.987305 3.722331 17.166342 4.018555 17.299805 C 4.314778 17.433268 4.625651 17.5 4.951172 17.5 Z M 5 10 C 5 9.824219 5.032552 9.661459 5.097656 9.511719 C 5.16276 9.361979 5.252278 9.230144 5.366211 9.116211 C 5.480143 9.002279 5.613606 8.912761 5.766602 8.847656 C 5.919596 8.782553 6.083984 8.75 6.259766 8.75 C 6.435547 8.75 6.598307 8.782553 6.748047 8.847656 C 6.897786 8.912761 7.027994 9.000651 7.138672 9.111328 C 7.249349 9.222006 7.337239 9.352214 7.402344 9.501953 C 7.467447 9.651693 7.5 9.814453 7.5 9.990234 C 7.5 10.166016 7.467447 10.330404 7.402344 10.483398 C 7.337239 10.636394 7.247721 10.769857 7.133789 10.883789 C 7.019856 10.997722 6.888021 11.08724 6.738281 11.152344 C 6.588542 11.217448 6.425781 11.25 6.25 11.25 C 6.074219 11.25 5.909831 11.217448 5.756836 11.152344 C 5.603841 11.08724 5.472005 10.99935 5.361328 10.888672 C 5.250651 10.777995 5.16276 10.646159 5.097656 10.493164 C 5.032552 10.34017 5 10.175781 5 10 Z M 8.75 10 C 8.75 9.824219 8.782552 9.661459 8.847656 9.511719 C 8.91276 9.361979 9.002278 9.230144 9.116211 9.116211 C 9.230143 9.002279 9.363606 8.912761 9.516602 8.847656 C 9.669596 8.782553 9.833984 8.75 10.009766 8.75 C 10.185547 8.75 10.348307 8.782553 10.498047 8.847656 C 10.647786 8.912761 10.777994 9.000651 10.888672 9.111328 C 10.999349 9.222006 11.087239 9.352214 11.152344 9.501953 C 11.217447 9.651693 11.25 9.814453 11.25 9.990234 C 11.25 10.166016 11.217447 10.330404 11.152344 10.483398 C 11.087239 10.636394 10.997721 10.769857 10.883789 10.883789 C 10.769856 10.997722 10.638021 11.08724 10.488281 11.152344 C 10.338541 11.217448 10.175781 11.25 10 11.25 C 9.824219 11.25 9.65983 11.217448 9.506836 11.152344 C 9.353841 11.08724 9.222005 10.99935 9.111328 10.888672 C 9.00065 10.777995 8.91276 10.646159 8.847656 10.493164 C 8.782552 10.34017 8.75 10.175781 8.75 10 Z M 15 9.990234 C 14.999999 10.166016 14.967447 10.330404 14.902344 10.483398 C 14.837239 10.636394 14.747721 10.769857 14.633789 10.883789 C 14.519856 10.997722 14.388021 11.08724 14.238281 11.152344 C 14.088541 11.217448 13.925781 11.25 13.75 11.25 C 13.574219 11.25 13.40983 11.217448 13.256836 11.152344 C 13.103841 11.08724 12.972005 10.99935 12.861328 10.888672 C 12.75065 10.777995 12.66276 10.646159 12.597656 10.493164 C 12.532552 10.34017 12.5 10.175781 12.5 10 C 12.5 9.824219 12.532552 9.661459 12.597656 9.511719 C 12.66276 9.361979 12.752278 9.230144 12.866211 9.116211 C 12.980143 9.002279 13.113605 8.912761 13.266602 8.847656 C 13.419596 8.782553 13.583984 8.75 13.759766 8.75 C 13.935547 8.75 14.098307 8.782553 14.248047 8.847656 C 14.397785 8.912761 14.527994 9.000651 14.638672 9.111328 C 14.749349 9.222006 14.837239 9.352214 14.902344 9.501953 C 14.967447 9.651693 14.999999 9.814453 15 9.990234 Z M 7.5 13.75 C 7.5 13.925781 7.467447 14.088542 7.402344 14.238281 C 7.337239 14.388021 7.247721 14.519857 7.133789 14.633789 C 7.019856 14.747722 6.886393 14.83724 6.733398 14.902344 C 6.580403 14.967448 6.416015 15 6.240234 15 C 6.064453 15 5.901692 14.967448 5.751953 14.902344 C 5.602213 14.83724 5.472005 14.74935 5.361328 14.638672 C 5.250651 14.527995 5.16276 14.397787 5.097656 14.248047 C 5.032552 14.098308 5 13.935547 5 13.759766 C 5 13.583984 5.032552 13.419597 5.097656 13.266602 C 5.16276 13.113607 5.252278 12.980144 5.366211 12.866211 C 5.480143 12.752279 5.611979 12.662761 5.761719 12.597656 C 5.911458 12.532553 6.074219 12.5 6.25 12.5 C 6.425781 12.5 6.590169 12.532553 6.743164 12.597656 C 6.896158 12.662761 7.027994 12.750651 7.138672 12.861328 C 7.249349 12.972006 7.337239 13.103842 7.402344 13.256836 C 7.467447 13.409831 7.5 13.574219 7.5 13.75 Z M 11.25 13.75 C 11.25 13.925781 11.217447 14.088542 11.152344 14.238281 C 11.087239 14.388021 10.997721 14.519857 10.883789 14.633789 C 10.769856 14.747722 10.636393 14.83724 10.483398 14.902344 C 10.330403 14.967448 10.166016 15 9.990234 15 C 9.814453 15 9.651692 14.967448 9.501953 14.902344 C 9.352213 14.83724 9.222005 14.74935 9.111328 14.638672 C 9.00065 14.527995 8.91276 14.397787 8.847656 14.248047 C 8.782552 14.098308 8.75 13.935547 8.75 13.759766 C 8.75 13.583984 8.782552 13.419597 8.847656 13.266602 C 8.91276 13.113607 9.002278 12.980144 9.116211 12.866211 C 9.230143 12.752279 9.361979 12.662761 9.511719 12.597656 C 9.661458 12.532553 9.824219 12.5 10 12.5 C 10.175781 12.5 10.340169 12.532553 10.493164 12.597656 C 10.646158 12.662761 10.777994 12.750651 10.888672 12.861328 C 10.999349 12.972006 11.087239 13.103842 11.152344 13.256836 C 11.217447 13.409831 11.25 13.574219 11.25 13.75 Z " />
</controls:SegmentedItem.Icon>
</controls:SegmentedItem>
</controls:Segmented>
</StackPanel>
</TitleBar.RightHeader>
</TitleBar>
<Frame
x:Name="MainShellFrame"
Grid.Row="1"
CacheSize="2"
Navigated="MainFrameNavigated" />
<notifyicon:TaskbarIcon
x:Name="SystemTrayIcon"
ContextMenuMode="PopupMenu"
DoubleClickCommand="{x:Bind ShowWinoCommand}"
IconSource="/Assets/Wino_Icon.ico"
NoLeftClickDelay="True">
<notifyicon:TaskbarIcon.ContextFlyout>
<MenuFlyout AreOpenCloseAnimationsEnabled="False">
<MenuFlyoutItem Command="{x:Bind ShowWinoCommand}" Text="{x:Bind domain:Translator.SystemTrayMenu_ShowWino}" />
<MenuFlyoutSeparator />
<MenuFlyoutItem Command="{x:Bind ExitWinoCommand}" Text="{x:Bind domain:Translator.SystemTrayMenu_ExitWino}" />
</MenuFlyout>
</notifyicon:TaskbarIcon.ContextFlyout>
</notifyicon:TaskbarIcon>
</Grid>
</winuiex:WindowEx>