Files
Wino-Mail/Wino.Core.UWP/Controls/WinoAppTitleBar.xaml
Aleh Khantsevich 2ec05ea7cc UWP .NET9 (#555)
* Ground work for NET9 UWP switch.

* Add launch settings for Wino.Mail

* Added new test WAP project

* fix platforms in slnx solution

* ManagePackageVersionsCentrally set default

* Fixing assets and couple issues with the new packaging project.

* Add back markdown

* Fix nuget warnings

* FIx error in WAP about build tools

* Add build.props with default language preview

* Some AOT compilation progress.

* More AOT stuff.

* Remove deprecated protocol auth activation handler.

* Fix remaining protocol handler for google auth.

* Even more AOT

* More more AOT fixes

* Fix a few more AOT warnings

* Fix signature editor AOT

* Fix composer and renderer AOT JSON

* Outlook Sync AOT

* Fixing bundle generation and package signing.

---------

Co-authored-by: Burak Kaan Köse <bkaankose@outlook.com>
2025-02-14 01:43:52 +01:00

194 lines
14 KiB
XML

<UserControl
x:Class="Wino.Core.UWP.Controls.WinoAppTitleBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:animatedvisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals"
xmlns:animations="using:CommunityToolkit.WinUI.Animations"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:domain="using:Wino.Core.Domain"
xmlns:enums="using:Wino.Core.Domain.Enums"
xmlns:helpers="using:Wino.Helpers"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
d:DesignHeight="300"
d:DesignWidth="400"
mc:Ignorable="d">
<Grid x:Name="MainGrid" Background="{ThemeResource AppBarBackgroundColor}">
<Grid
x:Name="dragbar"
Background="Transparent"
IsHitTestVisible="True" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="FluentButtonWidth" Width="Auto" />
<ColumnDefinition x:Name="EmptySpaceWidth" Width="*" />
<ColumnDefinition x:Name="SystemReservedWidth" Width="180" />
</Grid.ColumnDefinitions>
<!-- Shell Title Bar Left Side Background Placeholder -->
<Grid Grid.ColumnSpan="3" />
<!-- Menu + Back Button -->
<StackPanel
x:Name="LeftMenuStackPanel"
Orientation="Horizontal"
SizeChanged="TitlebarSizeChanged">
<Button
x:Name="PaneButton"
Width="48"
Margin="-2,-2,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
Background="Transparent"
BorderBrush="Transparent"
Click="PaneClicked"
FocusVisualPrimaryThickness="0"
FocusVisualSecondaryThickness="0"
Visibility="{x:Bind IsMenuButtonVisible, Mode=OneWay}">
<muxc:AnimatedIcon Width="16">
<muxc:AnimatedIcon.Source>
<animatedvisuals:AnimatedGlobalNavigationButtonVisualSource />
</muxc:AnimatedIcon.Source>
<muxc:AnimatedIcon.FallbackIconSource>
<muxc:SymbolIconSource Symbol="GlobalNavigationButton" />
</muxc:AnimatedIcon.FallbackIconSource>
</muxc:AnimatedIcon>
</Button>
<Button
x:Name="BackButton"
Width="48"
Margin="-2,4,4,4"
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
Background="Transparent"
BorderBrush="Transparent"
Click="BackClicked"
Visibility="{x:Bind IsBackButtonVisible, Mode=OneWay}">
<muxc:AnimatedIcon Width="16">
<muxc:AnimatedIcon.Source>
<animatedvisuals:AnimatedBackVisualSource />
</muxc:AnimatedIcon.Source>
<muxc:AnimatedIcon.FallbackIconSource>
<muxc:SymbolIconSource Symbol="Back" />
</muxc:AnimatedIcon.FallbackIconSource>
</muxc:AnimatedIcon>
</Button>
</StackPanel>
<!-- CoreWindow Title -->
<TextBlock
x:Name="CoreWindowTitleTextBlock"
Grid.Column="1"
Margin="4,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontWeight="SemiBold"
HorizontalTextAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Bind CoreWindowText, Mode=OneWay}"
TextTrimming="Clip">
<animations:Implicit.ShowAnimations>
<animations:OpacityAnimation
From="0"
To="1.0"
Duration="0:0:1" />
</animations:Implicit.ShowAnimations>
</TextBlock>
<!-- Shell Sub Content -->
<Grid Grid.Column="1" Canvas.ZIndex="999">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter
x:Name="ShellContentContainer"
Content="{x:Bind ShellFrameContent, Mode=OneWay}"
Visibility="{x:Bind IsShellFrameContentVisible, Mode=OneWay}">
<ContentPresenter.ContentTransitions>
<TransitionCollection>
<PaneThemeTransition Edge="Top" />
</TransitionCollection>
</ContentPresenter.ContentTransitions>
</ContentPresenter>
<!-- Server disconnected button -->
<Button
x:Name="ConnectionStatusButton"
Grid.Column="1"
Margin="4,0,0,0"
HorizontalAlignment="Left"
ToolTipService.ToolTip="{x:Bind domain:Translator.TitleBarServerDisconnectedButton_Description}"
Visibility="Collapsed">
<Button.Flyout>
<Flyout x:Name="ReconnectFlyout" Placement="Bottom">
<StackPanel Spacing="12">
<TextBlock
Width="250"
Text="{x:Bind domain:Translator.TitleBarServerDisconnectedButton_Description}"
TextWrapping="Wrap" />
<Button
HorizontalAlignment="Right"
Click="ReconnectClicked"
Content="{x:Bind domain:Translator.TitleBarServerReconnectButton_Title}" />
</StackPanel>
</Flyout>
</Button.Flyout>
<StackPanel Orientation="Horizontal" Spacing="10">
<muxc:ProgressRing
x:Name="ReconnectingProgressRing"
Width="5"
Height="5"
Foreground="Lime"
IsActive="True"
Visibility="Collapsed" />
<Viewbox
x:Name="DisconnectedPathIcon"
Width="16"
Height="16">
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 14.375 7.5 C 14.205729 7.5 14.059244 7.438151 13.935547 7.314453 C 13.811849 7.190756 13.75 7.044271 13.75 6.875 C 13.75 6.705729 13.811849 6.559245 13.935547 6.435547 C 14.059244 6.31185 14.205729 6.25 14.375 6.25 L 17.910156 6.25 C 17.558594 5.488281 17.104492 4.799805 16.547852 4.18457 C 15.991211 3.569336 15.367838 3.043621 14.677734 2.607422 C 13.98763 2.171225 13.245442 1.835938 12.451172 1.601562 C 11.6569 1.367188 10.839844 1.25 10 1.25 L 9.912109 1.25 C 9.182942 1.25 8.468424 1.344402 7.768555 1.533203 C 7.068685 1.722006 6.404622 1.988934 5.776367 2.333984 C 5.148112 2.679037 4.567057 3.098959 4.033203 3.59375 C 3.499349 4.088542 3.033854 4.638672 2.636719 5.244141 C 2.389323 5.628256 2.174479 6.028646 1.992188 6.445312 C 1.946615 6.549479 1.907552 6.655273 1.875 6.762695 C 1.842448 6.870117 1.80013 6.975912 1.748047 7.080078 C 1.689453 7.210287 1.614583 7.312826 1.523438 7.387695 C 1.432292 7.462565 1.311849 7.5 1.162109 7.5 C 0.986328 7.5 0.838216 7.439779 0.717773 7.319336 C 0.597331 7.198895 0.537109 7.050782 0.537109 6.875 C 0.537109 6.809896 0.546875 6.741537 0.566406 6.669922 C 0.904948 5.69336 1.386719 4.796551 2.011719 3.979492 C 2.636719 3.162436 3.361002 2.459311 4.18457 1.870117 C 5.008138 1.280926 5.906575 0.821941 6.879883 0.493164 C 7.85319 0.164389 8.857422 0 9.892578 0 C 10.810547 0 11.705729 0.115561 12.578125 0.34668 C 13.45052 0.577801 14.269205 0.914715 15.03418 1.357422 C 15.799153 1.800131 16.497395 2.340496 17.128906 2.978516 C 17.760416 3.616537 18.300781 4.342448 18.75 5.15625 L 18.75 1.875 C 18.75 1.70573 18.811848 1.559246 18.935547 1.435547 C 19.059244 1.31185 19.205729 1.25 19.375 1.25 C 19.54427 1.25 19.690754 1.31185 19.814453 1.435547 C 19.93815 1.559246 20 1.70573 20 1.875 L 20 6.875 C 20 7.044271 19.93815 7.190756 19.814453 7.314453 C 19.690754 7.438151 19.54427 7.5 19.375 7.5 Z M 8.75 14.375 C 8.75 13.600261 8.898111 12.871094 9.194336 12.1875 C 9.49056 11.503906 9.892578 10.908203 10.400391 10.400391 C 10.908203 9.892578 11.503906 9.490561 12.1875 9.194336 C 12.871093 8.898112 13.60026 8.75 14.375 8.75 C 14.889322 8.75 15.385741 8.816732 15.864258 8.950195 C 16.342773 9.083659 16.790363 9.272461 17.207031 9.516602 C 17.623697 9.760742 18.004557 10.055339 18.349609 10.400391 C 18.69466 10.745443 18.989258 11.126303 19.233398 11.542969 C 19.477539 11.959636 19.66634 12.407227 19.799805 12.885742 C 19.933268 13.364258 20 13.860678 20 14.375 C 20 15.14974 19.851887 15.878906 19.555664 16.5625 C 19.259439 17.246094 18.857422 17.841797 18.349609 18.349609 C 17.841797 18.857422 17.246094 19.259439 16.5625 19.555664 C 15.878906 19.851889 15.149739 20 14.375 20 C 13.59375 20 12.861328 19.853516 12.177734 19.560547 C 11.494141 19.267578 10.898438 18.867188 10.390625 18.359375 C 9.882812 17.851562 9.482422 17.255859 9.189453 16.572266 C 8.896484 15.888672 8.75 15.15625 8.75 14.375 Z M 15 14.375 L 15 11.875 C 14.999999 11.705729 14.93815 11.559245 14.814453 11.435547 C 14.690755 11.31185 14.544271 11.25 14.375 11.25 C 14.205729 11.25 14.059244 11.31185 13.935547 11.435547 C 13.811849 11.559245 13.75 11.705729 13.75 11.875 L 13.75 14.375 C 13.75 14.544271 13.811849 14.690756 13.935547 14.814453 C 14.059244 14.938151 14.205729 15 14.375 15 C 14.544271 15 14.690755 14.938151 14.814453 14.814453 C 14.93815 14.690756 14.999999 14.544271 15 14.375 Z M 9.863281 20 C 8.984375 20 8.125 19.886068 7.285156 19.658203 C 6.445312 19.430338 5.651042 19.104818 4.902344 18.681641 C 4.153646 18.258463 3.466797 17.742514 2.841797 17.133789 C 2.216797 16.525066 1.686198 15.839844 1.25 15.078125 L 1.25 18.125 C 1.25 18.294271 1.188151 18.440756 1.064453 18.564453 C 0.940755 18.68815 0.794271 18.75 0.625 18.75 C 0.455729 18.75 0.309245 18.68815 0.185547 18.564453 C 0.061849 18.440756 0 18.294271 0 18.125 L 0 13.125 C 0 12.955729 0.061849 12.809245 0.185547 12.685547 C 0.309245 12.56185 0.455729 12.5 0.625 12.5 L 5.625 12.5 C 5.794271 12.5 5.940755 12.56185 6.064453 12.685547 C 6.188151 12.809245 6.25 12.955729 6.25 13.125 C 6.25 13.294271 6.188151 13.440756 6.064453 13.564453 C 5.940755 13.688151 5.794271 13.75 5.625 13.75 L 1.962891 13.75 C 2.275391 14.407553 2.661133 15.013021 3.120117 15.566406 C 3.579101 16.119793 4.095052 16.608074 4.667969 17.03125 C 5.240885 17.454428 5.859375 17.80599 6.523438 18.085938 C 7.1875 18.365885 7.880859 18.557943 8.603516 18.662109 C 8.792317 18.916016 8.994141 19.153646 9.208984 19.375 C 9.423828 19.596354 9.654947 19.804688 9.902344 20 Z M 15.15625 16.875 C 15.15625 16.660156 15.079752 16.476236 14.926758 16.323242 C 14.773763 16.170248 14.589844 16.09375 14.375 16.09375 C 14.160156 16.09375 13.976236 16.170248 13.823242 16.323242 C 13.670246 16.476236 13.593749 16.660156 13.59375 16.875 C 13.593749 17.089844 13.670246 17.273764 13.823242 17.426758 C 13.976236 17.579752 14.160156 17.65625 14.375 17.65625 C 14.589844 17.65625 14.773763 17.579752 14.926758 17.426758 C 15.079752 17.273764 15.15625 17.089844 15.15625 16.875 Z " />
</Viewbox>
<TextBlock
x:Name="ConnectionStatusTextBlock"
VerticalAlignment="Center"
Text="{x:Bind domain:Translator.TitleBarServerDisconnectedButton_Title}" />
</StackPanel>
</Button>
</Grid>
</Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="ServerConnectionStatus">
<VisualState x:Name="Connected" />
<VisualState x:Name="Connecting">
<VisualState.Setters>
<Setter Target="ReconnectingProgressRing.Visibility" Value="Visible" />
<Setter Target="ConnectionStatusButton.Visibility" Value="Visible" />
<Setter Target="DisconnectedPathIcon.Visibility" Value="Collapsed" />
<Setter Target="ConnectionStatusTextBlock.Text" Value="{x:Bind domain:Translator.TitleBarServerReconnectingButton_Title}" />
</VisualState.Setters>
<VisualState.StateTriggers>
<StateTrigger IsActive="{x:Bind helpers:XamlHelpers.ConnectionStatusEquals(ConnectionStatus, enums:WinoServerConnectionStatus.Connecting), Mode=OneWay}" />
</VisualState.StateTriggers>
</VisualState>
<VisualState x:Name="Disconnected">
<VisualState.Setters>
<Setter Target="ConnectionStatusButton.Visibility" Value="Visible" />
<Setter Target="DisconnectedPathIcon.Visibility" Value="Visible" />
<Setter Target="ReconnectingProgressRing.Visibility" Value="Collapsed" />
<Setter Target="ConnectionStatusTextBlock.Text" Value="{x:Bind domain:Translator.TitleBarServerDisconnectedButton_Title}" />
</VisualState.Setters>
<VisualState.StateTriggers>
<StateTrigger IsActive="{x:Bind helpers:XamlHelpers.ConnectionStatusEquals(ConnectionStatus, enums:WinoServerConnectionStatus.Disconnected), Mode=OneWay}" />
</VisualState.StateTriggers>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</UserControl>