kotalk/src/PhysOn.Desktop/Views/ConversationWindow.axaml

146 lines
6.6 KiB
Text
Raw Normal View History

2026-04-16 09:24:26 +09:00
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:PhysOn.Desktop.ViewModels"
x:Class="PhysOn.Desktop.Views.ConversationWindow"
x:DataType="vm:ConversationWindowViewModel"
2026-04-16 11:14:22 +09:00
Width="404"
Height="748"
MinWidth="340"
2026-04-16 09:24:26 +09:00
MinHeight="520"
2026-04-16 12:04:40 +09:00
Background="#F7F3EE"
2026-04-16 09:24:26 +09:00
Title="{Binding ConversationTitle}">
<Window.Styles>
<Style Selector="Border.surface">
2026-04-16 11:14:22 +09:00
<Setter Property="CornerRadius" Value="2" />
2026-04-16 09:24:26 +09:00
<Setter Property="Background" Value="#FFFFFF" />
2026-04-16 12:04:40 +09:00
<Setter Property="BorderBrush" Value="#E8DDD2" />
2026-04-16 09:24:26 +09:00
<Setter Property="BorderThickness" Value="1" />
</Style>
2026-04-16 11:14:22 +09:00
<Style Selector="Border.muted">
<Setter Property="CornerRadius" Value="2" />
2026-04-16 12:04:40 +09:00
<Setter Property="Background" Value="#FBF7F2" />
<Setter Property="BorderBrush" Value="#ECE1D6" />
2026-04-16 09:24:26 +09:00
<Setter Property="BorderThickness" Value="1" />
</Style>
2026-04-16 11:14:22 +09:00
<Style Selector="Border.bubble">
<Setter Property="CornerRadius" Value="2" />
2026-04-16 09:24:26 +09:00
<Setter Property="Padding" Value="9,7" />
2026-04-16 11:14:22 +09:00
<Setter Property="Margin" Value="0,0,0,6" />
2026-04-16 12:04:40 +09:00
<Setter Property="Background" Value="#FBF7F2" />
<Setter Property="BorderBrush" Value="#E6D8CC" />
2026-04-16 11:14:22 +09:00
<Setter Property="BorderThickness" Value="1" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
<Style Selector="Border.bubble.mine">
2026-04-16 12:04:40 +09:00
<Setter Property="Background" Value="#F0E5D8" />
2026-04-16 11:14:22 +09:00
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
<Style Selector="Button.icon">
<Setter Property="CornerRadius" Value="2" />
<Setter Property="Padding" Value="8,6" />
2026-04-16 12:04:40 +09:00
<Setter Property="Background" Value="#FBF7F2" />
<Setter Property="BorderBrush" Value="#DCCFC4" />
2026-04-16 09:24:26 +09:00
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style Selector="Button.primary">
2026-04-16 11:14:22 +09:00
<Setter Property="CornerRadius" Value="2" />
<Setter Property="Padding" Value="11,8" />
2026-04-16 12:04:40 +09:00
<Setter Property="Background" Value="#394350" />
2026-04-16 09:24:26 +09:00
<Setter Property="Foreground" Value="#FFFFFF" />
</Style>
<Style Selector="TextBlock.caption">
2026-04-16 11:14:22 +09:00
<Setter Property="FontSize" Value="11.5" />
2026-04-16 12:04:40 +09:00
<Setter Property="Foreground" Value="#82766D" />
2026-04-16 09:24:26 +09:00
</Style>
<Style Selector="TextBlock.body">
<Setter Property="FontSize" Value="13" />
2026-04-16 12:04:40 +09:00
<Setter Property="Foreground" Value="#20242B" />
2026-04-16 09:24:26 +09:00
</Style>
</Window.Styles>
2026-04-16 11:14:22 +09:00
<Grid Margin="10" RowDefinitions="Auto,Auto,*,Auto" RowSpacing="8">
<Border Classes="surface" Padding="10">
<Grid ColumnDefinitions="40,*,Auto,Auto" ColumnSpacing="10">
<Border Width="40" Height="40" Classes="muted">
2026-04-16 09:24:26 +09:00
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding ConversationGlyph}"
FontWeight="SemiBold"
2026-04-16 12:04:40 +09:00
Foreground="#20242B" />
2026-04-16 09:24:26 +09:00
</Border>
<StackPanel Grid.Column="1" Spacing="2">
<TextBlock Text="{Binding ConversationTitle}"
2026-04-16 11:14:22 +09:00
FontSize="14.5"
2026-04-16 09:24:26 +09:00
FontWeight="SemiBold"
2026-04-16 12:04:40 +09:00
Foreground="#20242B"
2026-04-16 11:14:22 +09:00
TextTrimming="CharacterEllipsis" />
<TextBlock Text="{Binding ConversationSubtitle}"
Classes="caption"
2026-04-16 09:24:26 +09:00
TextTrimming="CharacterEllipsis" />
</StackPanel>
2026-04-16 11:14:22 +09:00
<Border Grid.Column="2" Classes="muted" Padding="8,4">
<TextBlock Text="{Binding StatusText}" Classes="caption" />
</Border>
<Button Grid.Column="3"
Classes="icon"
Command="{Binding ReloadCommand}"
Content="↻" />
2026-04-16 09:24:26 +09:00
</Grid>
</Border>
<Border Grid.Row="1"
Classes="surface"
2026-04-16 11:14:22 +09:00
Padding="9"
2026-04-16 09:24:26 +09:00
IsVisible="{Binding HasErrorText}">
<TextBlock Text="{Binding ErrorText}"
2026-04-16 12:04:40 +09:00
Foreground="#C9573C"
2026-04-16 09:24:26 +09:00
Classes="caption"
TextWrapping="Wrap" />
</Border>
2026-04-16 11:14:22 +09:00
<Border Grid.Row="2" Classes="surface" Padding="8">
<ScrollViewer Name="MessagesScrollViewer" MaxWidth="360" HorizontalAlignment="Center">
2026-04-16 09:24:26 +09:00
<ItemsControl ItemsSource="{Binding Messages}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:MessageRowViewModel">
<Border Classes="bubble"
Classes.mine="{Binding IsMine}">
<StackPanel Spacing="4">
<TextBlock Text="{Binding SenderName}"
Classes="caption"
FontWeight="SemiBold"
IsVisible="{Binding ShowSenderName}" />
<TextBlock Text="{Binding Text}"
Classes="body"
TextWrapping="Wrap" />
<TextBlock Text="{Binding MetaText}" Classes="caption" />
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
2026-04-16 11:14:22 +09:00
<Border Grid.Row="3" Classes="muted" Padding="8" MaxWidth="360" HorizontalAlignment="Center">
2026-04-16 09:24:26 +09:00
<Grid ColumnDefinitions="*,Auto" ColumnSpacing="10">
<TextBox Name="ComposerTextBox"
PlaceholderText="메시지"
AcceptsReturn="True"
TextWrapping="Wrap"
2026-04-16 11:14:22 +09:00
MinHeight="44"
2026-04-16 09:24:26 +09:00
Text="{Binding ComposerText}"
KeyDown="ComposerTextBox_OnKeyDown" />
<Button Grid.Column="1"
Classes="primary"
2026-04-16 11:14:22 +09:00
MinWidth="72"
2026-04-16 09:24:26 +09:00
Command="{Binding SendMessageCommand}"
Content="보내기" />
</Grid>
</Border>
</Grid>
</Window>