Files
LanMountainDesktop/LanMontainDesktop/Views/Components/RecordingWidget.axaml
lincube 094745122e 0.2.6
媒体播放组件,录音组件
2026-03-03 18:26:29 +08:00

171 lines
8.3 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignWidth="320"
d:DesignHeight="320"
x:Class="LanMontainDesktop.Views.Components.RecordingWidget">
<Border x:Name="RootBorder"
CornerRadius="34"
Padding="10"
ClipToBounds="True"
Background="#ECEFF3"
BorderBrush="#DEE3EA"
BorderThickness="1">
<Viewbox Stretch="Uniform">
<Grid Width="300"
Height="300">
<Border x:Name="RecorderCardBorder"
Width="248"
Height="248"
HorizontalAlignment="Center"
VerticalAlignment="Center"
CornerRadius="30"
BorderBrush="#E6EAF0"
BorderThickness="1"
Background="#F4F6FA">
<Grid Margin="16,14,16,12"
RowDefinitions="Auto,Auto,Auto,Auto,Auto">
<TextBlock x:Name="TitleTextBlock"
Grid.Row="0"
Text="录音"
FontSize="19"
FontWeight="SemiBold"
Foreground="#11151D"
HorizontalAlignment="Center" />
<TextBlock x:Name="TimerTextBlock"
Grid.Row="1"
Margin="0,8,0,0"
Text="00:00"
FontSize="66"
FontWeight="SemiBold"
FontFeatures="tnum"
Foreground="#151922"
HorizontalAlignment="Center" />
<Grid Grid.Row="2"
Margin="0,10,0,0"
ColumnDefinitions="*,2,68"
VerticalAlignment="Center">
<StackPanel x:Name="WaveformBarsPanel"
Grid.Column="0"
Orientation="Horizontal"
Spacing="3"
HorizontalAlignment="Left"
VerticalAlignment="Center" />
<Border Grid.Column="1"
Margin="0,0,0,0"
Width="2"
Height="32"
CornerRadius="1"
Background="#F14A40"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<Border x:Name="FutureLine"
Grid.Column="2"
Margin="8,0,0,0"
Height="2"
CornerRadius="1"
Background="#A3A8B3"
Opacity="0.55"
HorizontalAlignment="Stretch"
VerticalAlignment="Center" />
</Grid>
<Grid Grid.Row="3"
Margin="0,16,0,0"
HorizontalAlignment="Center"
ColumnDefinitions="Auto,Auto,Auto"
ColumnSpacing="16">
<Border x:Name="DiscardButtonBorder"
Grid.Column="0"
Width="54"
Height="54"
CornerRadius="27"
Background="#F8FAFD"
BorderBrush="#E0E5EC"
BorderThickness="1"
Cursor="Hand"
PointerPressed="OnDiscardButtonPointerPressed">
<Viewbox Width="20"
Height="20"
Stretch="Uniform">
<Path Data="M 5,2 V 18 M 5,3 H 15 L 13,7 L 15,11 H 5"
Stroke="#141922"
StrokeThickness="1.9" />
</Viewbox>
</Border>
<Border x:Name="RecordToggleButtonBorder"
Grid.Column="1"
Width="68"
Height="68"
CornerRadius="34"
Background="#EF3E38"
Cursor="Hand"
PointerPressed="OnRecordToggleButtonPointerPressed">
<Grid>
<Ellipse x:Name="RecordDot"
Width="15"
Height="15"
Fill="#FFFFFF"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<Path x:Name="PauseGlyphPath"
Width="14"
Height="16"
Stretch="Uniform"
Fill="#FFFFFF"
Data="M 0,0 H 4 V 16 H 0 Z M 8,0 H 12 V 16 H 8 Z"
IsVisible="False" />
<Path x:Name="PlayGlyphPath"
Width="16"
Height="16"
Stretch="Uniform"
Fill="#FFFFFF"
Data="M 0,0 L 0,16 L 13,8 Z"
IsVisible="False" />
</Grid>
</Border>
<Border x:Name="SaveButtonBorder"
Grid.Column="2"
Width="54"
Height="54"
CornerRadius="27"
Background="#F8FAFD"
BorderBrush="#E0E5EC"
BorderThickness="1"
Cursor="Hand"
PointerPressed="OnSaveButtonPointerPressed">
<Viewbox Width="22"
Height="22"
Stretch="Uniform">
<Path Data="M 3,11 L 8,16 L 19,5"
Stroke="#141922"
StrokeThickness="2.2" />
</Viewbox>
</Border>
</Grid>
<TextBlock x:Name="HintTextBlock"
Grid.Row="4"
Margin="0,10,0,0"
HorizontalAlignment="Center"
TextAlignment="Center"
FontSize="13"
FontWeight="Medium"
Foreground="#7A818E"
Text="点击红色按钮开始" />
</Grid>
</Border>
</Grid>
</Viewbox>
</Border>
</UserControl>