Skip to content

Commit

Permalink
Better dialog layout, selectable error text
Browse files Browse the repository at this point in the history
  • Loading branch information
KimihikoAkayasaki committed Feb 20, 2023
1 parent 07859c6 commit b0d9142
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
72 changes: 36 additions & 36 deletions K2CrashHandler/ContentDialogView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,42 +38,42 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<ContentControl
Grid.Row="0"
Margin="{StaticResource ContentDialogTitleMargin}"
HorizontalAlignment="Left"
VerticalAlignment="Top"
d:Content="Title"
x:Name="DialogTitle"
FontSize="20"
FontWeight="SemiBold"
Foreground="{ThemeResource ContentDialogForeground}"
IsTabStop="False">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<ContentPresenter
Margin="{TemplateBinding Margin}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
MaxLines="2"
TextWrapping="Wrap" />
</ControlTemplate>
</ContentControl.Template>
</ContentControl>

<ContentPresenter
Grid.Row="1"
Margin="{StaticResource ContentDialogContentMargin}"
HorizontalAlignment="Stretch"
d:Content="Message Dialog Content"
x:Name="DialogContent"
FontFamily="{StaticResource ContentControlThemeFontFamily}"
FontSize="{ThemeResource ContentControlFontSize}"
Foreground="{ThemeResource ContentDialogForeground}"
TextWrapping="WrapWholeWords" />
<StackPanel Orientation="Vertical" HorizontalAlignment="Stretch">
<ContentControl
Margin="{StaticResource ContentDialogTitleMargin}"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
d:Content="Title"
x:Name="DialogTitle"
FontSize="20"
FontWeight="SemiBold"
Foreground="{ThemeResource ContentDialogForeground}"
IsTabStop="False">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<ContentPresenter
Margin="{TemplateBinding Margin}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
MaxLines="2"
TextWrapping="Wrap" />
</ControlTemplate>
</ContentControl.Template>
</ContentControl>

<TextBlock
Margin="{StaticResource ContentDialogContentMargin}"
HorizontalAlignment="Stretch"
d:Content="Message Dialog Content"
x:Name="DialogContent" IsTextSelectionEnabled="True"
FontFamily="{StaticResource ContentControlThemeFontFamily}"
FontSize="{ThemeResource ContentControlFontSize}"
Foreground="{ThemeResource ContentDialogForeground}"
TextWrapping="WrapWholeWords" />
</StackPanel>

<ContentPresenter
Grid.Row="2"
Expand Down
2 changes: 1 addition & 1 deletion K2CrashHandler/ContentDialogView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ContentDialogView
InitializeComponent();

DialogTitle.Content = title;
DialogContent.Content = content;
DialogContent.Text = content;

// Back up
_primaryButtonText = primaryButtonText;
Expand Down

0 comments on commit b0d9142

Please sign in to comment.