Skip to content

Commit 50bad71

Browse files
committed
Slight improvement on conversation chat box
1 parent cee4e73 commit 50bad71

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Signal-Windows/Controls/Conversation.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<Grid.RowDefinitions>
2828
<RowDefinition Height="50" />
2929
<RowDefinition Height="*" />
30-
<RowDefinition Height="50" />
30+
<RowDefinition Height="Auto" />
3131
</Grid.RowDefinitions>
3232
<Border Grid.Row="0" Background="{x:Bind HeaderBackground, Mode=OneWay}">
3333
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
@@ -50,8 +50,8 @@
5050
<ColumnDefinition Width="*"/>
5151
<ColumnDefinition Width="Auto"/>
5252
</Grid.ColumnDefinitions>
53-
<TextBox Grid.Column="0" Name="InputTextBox" VerticalAlignment="Center" KeyDown="TextBox_KeyDown" PlaceholderText="Type a message" BorderBrush="{x:Null}" BorderThickness="0"/>
54-
<Button x:Name="SendMessageButton" Grid.Column="1" Click="SendMessageButton_Click" IsEnabled="{x:Bind SendEnabled, Mode=OneWay}" Background="{x:Bind HeaderBackground}" VerticalAlignment="Center" Width="50" Height="49">
53+
<TextBox Grid.Column="0" Name="InputTextBox" VerticalAlignment="Center" KeyDown="TextBox_KeyDown" PlaceholderText="Type a message" BorderBrush="{x:Null}" BorderThickness="0" TextWrapping="Wrap" TextChanged="InputTextBox_TextChanged"/>
54+
<Button x:Name="SendMessageButton" Grid.Column="1" Click="SendMessageButton_Click" IsEnabled="{x:Bind SendEnabled, Mode=OneWay}" Background="{x:Bind HeaderBackground}" VerticalAlignment="Bottom" Width="50" VerticalContentAlignment="Stretch" MinHeight="50">
5555
<SymbolIcon Symbol="Send"/>
5656
</Button>
5757
</Grid>

Signal-Windows/Controls/Conversation.xaml.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@ public void AddToOutgoingMessagesCache(SignalMessage sm)
216216

217217
private async void TextBox_KeyDown(object sender, KeyRoutedEventArgs e)
218218
{
219-
TextBox t = sender as TextBox;
220-
SendEnabled = t.Text != string.Empty;
221219
if (e.Key == Windows.System.VirtualKey.Enter)
222220
{
223221
// this fixes double send by enter repeat
@@ -243,6 +241,12 @@ private async void SendMessageButton_Click(object sender, RoutedEventArgs e)
243241
{
244242
await GetMainPageVm().SendMessageButton_Click(InputTextBox);
245243
}
244+
245+
private void InputTextBox_TextChanged(object sender, TextChangedEventArgs e)
246+
{
247+
TextBox t = sender as TextBox;
248+
SendEnabled = t.Text != string.Empty;
249+
}
246250
}
247251

248252
public class SignalUnreadMarker

0 commit comments

Comments
 (0)