Skip to content

Commit

Permalink
improved dialog boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w1zard1 committed May 22, 2023
1 parent 996f731 commit 641e737
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions KOTORModSync.GUI/ConfirmationDialog.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
Title="Confirmation" Width="300" Height="150"
x:Class="KOTORModSync.GUI.ConfirmationDialog">
<Grid>
<TextBlock x:Name="confirmTextBlock" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20"/>
<TextBlock x:Name="confirmTextBlock" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Margin="10"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="10">
<Button Content="Yes" Tag="Yes" Click="YesButton_Click" />
<Button Content="No" Tag="No" Click="NoButton_Click" />
<Button Content="Yes" Tag="Yes" Click="YesButton_Click" MinWidth="80" Margin="5"/>
<Button Content="No" Tag="No" Click="NoButton_Click" MinWidth="80" Margin="5"/>
</StackPanel>
</Grid>
</Window>
12 changes: 4 additions & 8 deletions KOTORModSync.GUI/InformationDialog.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@
xmlns:local="clr-namespace:KOTORModSync.GUI"
x:Class="KOTORModSync.GUI.InformationDialog"
Width="300" Height="150" Title="Save Confirmation" WindowStartupLocation="CenterScreen">
<Window.Styles>
<Style Selector="Window">
<Setter Property="Background" Value="#000000"/>
<Setter Property="Foreground" Value="#FFFFFF"/>
<Setter Property="BorderBrush" Value="#FFFFFF"/>
</Style>
</Window.Styles>
<Grid>
<TextBlock x:Name="InfoTextBlock"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="20"
FontSize="16"
TextWrapping="Wrap"
Margin="10"
Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit."/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="10">
<Button Content="OK" Click="OKButton_Click" MinWidth="80" Margin="5"/>
</StackPanel>
</Grid>
</Window>
6 changes: 6 additions & 0 deletions KOTORModSync.GUI/InformationDialog.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;

Expand Down Expand Up @@ -33,6 +34,11 @@ protected override void OnOpened(EventArgs e)
UpdateInfoText();
}

private void OKButton_Click(object sender, RoutedEventArgs e)
{
Close();
}

private void UpdateInfoText()
{
Dispatcher.UIThread.InvokeAsync(() =>
Expand Down

0 comments on commit 641e737

Please sign in to comment.