Skip to content

Commit 431fce9

Browse files
jrkasprzykclaude
andcommitted
Make original/translated caption panes resizable with a splitter
Both caption rows now share available height equally by default, and a GridSplitter between them lets the user drag the boundary, e.g. to give the original caption several lines. Previously the original caption row was always sized to content (effectively one line) and only the translated row could grow. The splitter is hidden when caption log cards are enabled, where rows are content-sized. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 794f442 commit 431fce9

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

src/pages/CaptionPage.xaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<Grid Margin="5,5,15,5">
1414
<Grid.RowDefinitions>
1515
<RowDefinition x:Name="OriginalCaption_Row" Height="Auto" />
16+
<RowDefinition Height="Auto" />
1617
<RowDefinition x:Name="TranslatedCaption_Row" Height="Auto" />
1718
<RowDefinition x:Name="CaptionLogCard_Row" Height="Auto" />
1819
</Grid.RowDefinitions>
@@ -38,10 +39,20 @@
3839
ToolTip="Click To Copy" />
3940
</ui:Card>
4041

41-
<ui:Card
42+
<GridSplitter
43+
x:Name="CaptionSplitter"
4244
Grid.Row="1"
45+
Height="6"
46+
HorizontalAlignment="Stretch"
47+
Background="Transparent"
48+
Cursor="SizeNS"
49+
ResizeBehavior="PreviousAndNext"
50+
ResizeDirection="Rows"
51+
ToolTip="Drag to Resize" />
52+
53+
<ui:Card
54+
Grid.Row="2"
4355
MinHeight="43"
44-
Margin="0,3,0,0"
4556
Padding="8"
4657
VerticalAlignment="Stretch">
4758
<TextBlock
@@ -57,7 +68,7 @@
5768

5869
<ui:Card
5970
x:Name="LogCards"
60-
Grid.Row="2"
71+
Grid.Row="3"
6172
Margin="0,0,0,5"
6273
Padding="8"
6374
VerticalAlignment="Top"

src/pages/CaptionPage.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,16 @@ public void CollapseTranslatedCaption(bool isCollapsed)
8080

8181
if (isCollapsed)
8282
{
83+
OriginalCaption_Row.Height = (GridLength)converter.ConvertFromString("Auto");
8384
TranslatedCaption_Row.Height = (GridLength)converter.ConvertFromString("Auto");
85+
CaptionSplitter.Visibility = Visibility.Collapsed;
8486
LogCards.Visibility = Visibility.Visible;
8587
}
8688
else
8789
{
90+
OriginalCaption_Row.Height = (GridLength)converter.ConvertFromString("*");
8891
TranslatedCaption_Row.Height = (GridLength)converter.ConvertFromString("*");
92+
CaptionSplitter.Visibility = Visibility.Visible;
8993
LogCards.Visibility = Visibility.Collapsed;
9094
}
9195
}

0 commit comments

Comments
 (0)