diff options
Diffstat (limited to 'UVtools.WPF/Windows/ToolWindow.axaml')
-rw-r--r-- | UVtools.WPF/Windows/ToolWindow.axaml | 81 |
1 files changed, 26 insertions, 55 deletions
diff --git a/UVtools.WPF/Windows/ToolWindow.axaml b/UVtools.WPF/Windows/ToolWindow.axaml index f14f07e..0a50fd0 100644 --- a/UVtools.WPF/Windows/ToolWindow.axaml +++ b/UVtools.WPF/Windows/ToolWindow.axaml @@ -1,7 +1,8 @@ -<Window xmlns="https://github.com/avaloniaui" +<controls:WindowEx xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:controls="clr-namespace:UVtools.WPF.Controls" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="UVtools.WPF.Windows.ToolWindow" CanResize="False" @@ -9,39 +10,30 @@ WindowStartupLocation="CenterOwner" Title="Tool" Icon="/Assets/Icons/UVtools.ico"> - <StackPanel Orientation="Vertical"> + + <StackPanel Orientation="Vertical"> <!-- Description --> <Border Background="WhiteSmoke" Padding="10" - IsVisible="{Binding Description, Converter={x:Static StringConverters.IsNotNullOrEmpty}}" - > - <Panel> - <TextBox + IsVisible="{Binding Description, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"> + <TextBox Classes="TransparentReadOnly" HorizontalAlignment="Left" - TextWrapping="Wrap" MaxWidth="{Binding DescriptionMaxWidth}" FontSize="16" - IsReadOnly="True" - AcceptsReturn="True" - Background="Transparent" - CaretBrush="Transparent" - BorderBrush="Transparent" Watermark="Description:" UseFloatingWatermark="True" Padding="5" Width="Infinity" Text="{Binding Description}"/> - </Panel> </Border> <!-- Layer Range --> <Border Background="WhiteSmoke" + Classes="GroupBox" Margin="5" - BorderBrush="LightBlue" - BorderThickness="4" IsVisible="{Binding LayerRangeVisible}"> <StackPanel Orientation="Vertical"> @@ -65,7 +57,7 @@ <Grid RowDefinitions="Auto,5,Auto" - ColumnDefinitions="Auto,100,Auto,100,150" + ColumnDefinitions="Auto,150,Auto,150,Auto" Margin="15"> <TextBlock Grid.Row="0" @@ -107,6 +99,7 @@ Grid.Column="4" Margin="10,0,0,0" VerticalAlignment="Stretch" + VerticalContentAlignment="Center" Padding="10,0,10,0" Content="Select ⮟" Command="{Binding OpenContextMenu}" @@ -161,15 +154,16 @@ <TextBlock Grid.Row="2" Grid.Column="1" HorizontalAlignment="Center" - Text="{Binding LayerStartMM, StringFormat=(\{0\}mm)}" /> + Text="{Binding LayerStartMM, StringFormat=(\{0:F2\}mm)}" /> <TextBlock Grid.Row="2" Grid.Column="3" HorizontalAlignment="Center" - Text="{Binding LayerEndMM, StringFormat=(\{0\}mm)}" /> + Text="{Binding LayerEndMM, StringFormat=(\{0:F2\}mm)}" /> <TextBlock Grid.Row="2" Grid.Column="4" + Margin="10,0,0,0" HorizontalAlignment="Center" Text="{Binding LayerRangeCountStr}" /> @@ -180,18 +174,14 @@ <!-- ROI --> <Border + Classes="GroupBox" Background="WhiteSmoke" Margin="5" - BorderBrush="LightBlue" - BorderThickness="4" - IsVisible="{Binding IsROIVisible}" - > + IsVisible="{Binding IsROIVisible}"> <StackPanel Orientation="Vertical"> <TextBlock - Padding="10" - Background="LightBlue" - FontWeight="Bold" + Classes="GroupBoxHeader" Text="ROI - Region of interest"/> <TextBlock Margin="15" @@ -214,10 +204,9 @@ <!-- Profiles --> <Border + Classes="GroupBox" Background="WhiteSmoke" Margin="5" - BorderBrush="LightBlue" - BorderThickness="4" IsVisible="{Binding IsProfilesVisible}" > @@ -258,13 +247,14 @@ IsEnabled="{Binding Profiles.Count}" IsVisible="{Binding Profiles.Count}" SelectedItem="{Binding SelectedProfileItem}" + HorizontalAlignment="Stretch" Items="{Binding Profiles}" /> <Button Grid.Row="0" Grid.Column="2" Margin="0,0,0,10" - VerticalAlignment="Center" + VerticalAlignment="Stretch" ToolTip.Tip="Deselect the current profile" IsEnabled="{Binding SelectedProfileItem, Converter={x:Static ObjectConverters.IsNotNull}}" IsVisible="{Binding Profiles.Count}" @@ -276,8 +266,7 @@ Grid.Row="0" Grid.Column="4" Margin="0,0,0,10" - Width="24" - VerticalAlignment="Center" + VerticalAlignment="Stretch" FontWeight="Bold" ToolTip.Tip="Set the selected profile as default to load in with this dialog. 
Shift + click to clear the default profile." @@ -290,7 +279,7 @@ Grid.Row="0" Grid.Column="6" Margin="0,0,0,10" - VerticalAlignment="Center" + VerticalAlignment="Stretch" ToolTip.Tip="Remove the selected profile" IsEnabled="{Binding SelectedProfileItem, Converter={x:Static ObjectConverters.IsNotNull}}" IsVisible="{Binding Profiles.Count}" @@ -309,7 +298,7 @@ <Button Grid.Row="1" Grid.Column="2" - VerticalAlignment="Center" + VerticalAlignment="Stretch" ToolTip.Tip="Add a new profile with the current set values" IsEnabled="{Binding ButtonOkEnabled}" Command="{Binding AddProfile}" @@ -319,37 +308,19 @@ </Grid> - - <!-- - <StackPanel Spacing="20" Margin="15,0,15,15" Orientation="Horizontal"> - <CheckBox - Content="Clear ROI after perform the operation" - IsChecked="{Binding ClearROIAfterOperation}" - /> - <Button - Padding="5" - Content="Clear ROI" - Command="{Binding ClearROI}"/> - </StackPanel> - !--> - </StackPanel> </Border> <!-- Content --> <Border + Classes="GroupBox" IsVisible="{Binding IsContentVisible}" Background="WhiteSmoke" - Margin="5" - BorderBrush="LightBlue" - BorderThickness="4"> + Margin="5"> <StackPanel Orientation="Vertical"> - <TextBlock - Padding="10" - Background="LightBlue" - FontWeight="Bold" + <TextBlock Classes="GroupBoxHeader" Text="{Binding Title}"/> <ScrollViewer @@ -361,7 +332,7 @@ </Border> <!-- Actions --> - <Border Margin="0,10,0,0" Padding="5,20" Background="LightGray"> + <Border Classes="FooterActions"> <Grid ColumnDefinitions="*"> <StackPanel Spacing="10" Orientation="Horizontal"> <Button @@ -419,4 +390,4 @@ </Border> </StackPanel> -</Window> +</controls:WindowEx> |