diff options
author | Tiago Conceição <Tiago_caza@hotmail.com> | 2022-09-20 21:40:26 +0300 |
---|---|---|
committer | Tiago Conceição <Tiago_caza@hotmail.com> | 2022-09-20 21:40:26 +0300 |
commit | 57dbbce7845cc563103bfbe084fb3392c3cda84d (patch) | |
tree | 51a2b924b2644e5639de1bfa6187ce2046dff725 /UVtools.WPF | |
parent | cae2f061baeca302ed38399bba4dfa4619024d68 (diff) |
v3.6.6v3.6.6
- **UI:**
- (Improvement) Auto show a horizontal scroll bar on wider than screen contents on the tool windows
- (Improvement) Move normal windows to zero position if negative and auto constrain height if necessary
- (Improvement) Set a minimum width and minimum height for tool windows
- (Fix) Setting - "Allow resize the tool windows" had been lost and no effect when checked
- (Add) Windows MSI - Option: Add installation directory to system PATH environment variable
- (Improvement) Better fetch of UVtools.Core.dll on PowerShell scripts under Windows
- (Improvement) Better handling in get the process output, this fixes processor name not being shown on macOS
Diffstat (limited to 'UVtools.WPF')
-rw-r--r-- | UVtools.WPF/Controls/WindowEx.cs | 27 | ||||
-rw-r--r-- | UVtools.WPF/UVtools.WPF.csproj | 2 | ||||
-rw-r--r-- | UVtools.WPF/Windows/MessageWindow.axaml | 3 | ||||
-rw-r--r-- | UVtools.WPF/Windows/MessageWindow.axaml.cs | 4 | ||||
-rw-r--r-- | UVtools.WPF/Windows/ToolWindow.axaml | 28 | ||||
-rw-r--r-- | UVtools.WPF/Windows/ToolWindow.axaml.cs | 11 |
6 files changed, 45 insertions, 30 deletions
diff --git a/UVtools.WPF/Controls/WindowEx.cs b/UVtools.WPF/Controls/WindowEx.cs index 49c76d5..3925d32 100644 --- a/UVtools.WPF/Controls/WindowEx.cs +++ b/UVtools.WPF/Controls/WindowEx.cs @@ -128,19 +128,34 @@ public class WindowEx : Window, INotifyPropertyChanged, IStyleable base.OnInitialized(); } - /*protected override void OnOpened(EventArgs e) + protected override void OnOpened(EventArgs e) { + // Fix positions and sizes + if (WindowState == WindowState.Normal) + { + if (Position.X < 0) Position = Position.WithX(0); + if (Position.Y < 0) Position = Position.WithY(0); + + if ((SizeToContent & SizeToContent.Height) == 0) + { + var workingArea = this.GetScreenWorkingArea(); + if (Bounds.Bottom > workingArea.Height) + { + Height = workingArea.Height - Position.Y; + } + } + } + + //Debug.WriteLine("OnOpened"); base.OnOpened(e); - Debug.WriteLine("OnOpened"); - AutoConstainsWindowMaxSize(); - }*/ + } public void ConstainsWindowMaxSize() { - if (WindowStartupLocation == WindowStartupLocation.CenterOwner && Owner is null) + /*if (WindowStartupLocation == WindowStartupLocation.CenterOwner && Owner is null) { WindowStartupLocation = WindowStartupLocation.CenterScreen; - } + }*/ if (!CanResize && WindowState == WindowState.Normal && WindowConstrainMaxSize != WindowConstrainsMaxSizeType.None) { diff --git a/UVtools.WPF/UVtools.WPF.csproj b/UVtools.WPF/UVtools.WPF.csproj index 0f48620..04a3fb7 100644 --- a/UVtools.WPF/UVtools.WPF.csproj +++ b/UVtools.WPF/UVtools.WPF.csproj @@ -12,7 +12,7 @@ <PackageLicenseFile>LICENSE</PackageLicenseFile> <RepositoryUrl>https://github.com/sn4k3/UVtools</RepositoryUrl> <RepositoryType>Git</RepositoryType> - <Version>3.6.5</Version> + <Version>3.6.6</Version> <Platforms>AnyCPU;x64</Platforms> <PackageIcon>UVtools.png</PackageIcon> <PackageReadmeFile>README.md</PackageReadmeFile> diff --git a/UVtools.WPF/Windows/MessageWindow.axaml b/UVtools.WPF/Windows/MessageWindow.axaml index 35be6d5..6b39204 100644 --- a/UVtools.WPF/Windows/MessageWindow.axaml +++ b/UVtools.WPF/Windows/MessageWindow.axaml @@ -7,8 +7,7 @@ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="UVtools.WPF.Windows.MessageWindow" Icon="/Assets/Icons/UVtools.ico" - WindowStartupLocation="CenterOwner" - CanResize="False" + WindowStartupLocation="CenterScreen" SizeToContent="WidthAndHeight" MinWidth="300" MinHeight="200" diff --git a/UVtools.WPF/Windows/MessageWindow.axaml.cs b/UVtools.WPF/Windows/MessageWindow.axaml.cs index da22e4d..98caefd 100644 --- a/UVtools.WPF/Windows/MessageWindow.axaml.cs +++ b/UVtools.WPF/Windows/MessageWindow.axaml.cs @@ -70,10 +70,10 @@ namespace UVtools.WPF.Windows #region Constructor public MessageWindow() { - InitializeComponent(); - CanResize = Settings.General.WindowsCanResize; + InitializeComponent(); + _buttonsRightPanel = this.FindControl<StackPanel>("ButtonsRightPanel"); DataContext = this; } diff --git a/UVtools.WPF/Windows/ToolWindow.axaml b/UVtools.WPF/Windows/ToolWindow.axaml index 9afdc06..71d485a 100644 --- a/UVtools.WPF/Windows/ToolWindow.axaml +++ b/UVtools.WPF/Windows/ToolWindow.axaml @@ -6,8 +6,9 @@ xmlns:i="clr-namespace:Projektanker.Icons.Avalonia;assembly=Projektanker.Icons.Avalonia" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="UVtools.WPF.Windows.ToolWindow" - CanResize="False" SizeToContent="WidthAndHeight" + MinWidth="500" + MinHeight="400" WindowStartupLocation="CenterOwner" Title="Tool" Icon="/Assets/Icons/UVtools.ico"> @@ -23,6 +24,7 @@ IsExpanded="{Binding Settings.Tools.ExpandDescriptions}" HorizontalContentAlignment="Stretch" Header="Description (Click to toggle)"> + <TextBox Classes="TransparentReadOnlyMultiLineNoBorder" MaxWidth="{Binding DescriptionMaxWidth}" FontSize="16" @@ -30,6 +32,7 @@ Watermark="Description:" Padding="5" Text="{Binding Description}"/> + </Expander> </Border> @@ -66,16 +69,14 @@ Grid.Column="0" VerticalAlignment="Center" Text="From:" - Margin="0,0,10,0" - /> + Margin="0,0,10,0"/> <NumericUpDown Grid.Row="0" Grid.Column="1" Classes="ValueLabel ValueLabel_layers" VerticalAlignment="Center" Minimum="0" Maximum="{Binding MaximumLayerIndex}" - Value="{Binding LayerIndexStart}" - /> + Value="{Binding LayerIndexStart}"/> <TextBlock Grid.Row="0" @@ -83,8 +84,7 @@ VerticalAlignment="Center" Text="To:" IsEnabled="{Binding !LayerRangeSync}" - Margin="20,0,10,0" - /> + Margin="20,0,10,0"/> <NumericUpDown Grid.Row="0" Grid.Column="3" Classes="ValueLabel ValueLabel_layers" @@ -109,8 +109,7 @@ Padding="10,0,10,0" Content="Select ⮟" Command="{Binding OpenContextMenu}" - CommandParameter="LayerSelectPreset" - > + CommandParameter="LayerSelectPreset"> <Button.ContextMenu> <ContextMenu Name="LayerSelectPresetContextMenu" PlacementMode="Bottom"> <MenuItem @@ -152,14 +151,12 @@ <MenuItem Header="_First layer" HotKey="Ctrl + Shift + F" InputGesture="Ctrl + Shift + F" - Command="{Binding SelectFirstLayer}" - /> + Command="{Binding SelectFirstLayer}"/> <MenuItem Header="_Last layer" HotKey="Ctrl + Shift + L" InputGesture="Ctrl + Shift + L" - Command="{Binding SelectLastLayer}" - /> + Command="{Binding SelectLastLayer}"/> </ContextMenu> </Button.ContextMenu> @@ -342,6 +339,8 @@ <ScrollViewer Grid.Row="1" Name="ContentScrollViewer" + VerticalScrollBarVisibility="Auto" + HorizontalScrollBarVisibility="Auto" Content="{Binding ContentControl}"/> </Grid> </Border> @@ -351,8 +350,7 @@ <Grid RowDefinitions="Auto" ColumnDefinitions="*"> <StackPanel Spacing="10" Orientation="Horizontal"> - <Button - Command="{Binding #OptionsContextMenu.Open}" + <Button Command="{Binding #OptionsContextMenu.Open}" Padding="10" Content="☰"> <Button.ContextMenu> diff --git a/UVtools.WPF/Windows/ToolWindow.axaml.cs b/UVtools.WPF/Windows/ToolWindow.axaml.cs index 1991b3f..1df71e9 100644 --- a/UVtools.WPF/Windows/ToolWindow.axaml.cs +++ b/UVtools.WPF/Windows/ToolWindow.axaml.cs @@ -575,7 +575,10 @@ public class ToolWindow : WindowEx #region Constructors public ToolWindow() { + CanResize = Settings.General.WindowsCanResize; + InitializeComponent(); + _contentScrollViewer = this.FindControl<ScrollViewer>("ContentScrollViewer"); SelectAllLayers(); @@ -602,8 +605,8 @@ public class ToolWindow : WindowEx ToolControl = toolControl; toolControl.ParentWindow = this; toolControl.Margin = new Thickness(15); - ToolControl.BaseOperation.ROI = ROI; - ToolControl.BaseOperation.MaskPoints = Masks; + toolControl.BaseOperation.ROI = ROI; + toolControl.BaseOperation.MaskPoints = Masks; Title = toolControl.BaseOperation.Title; //LayerRangeVisible = toolControl.BaseOperation.StartLayerRangeSelection != LayerRangeSelection.None; @@ -654,10 +657,10 @@ public class ToolWindow : WindowEx } - if (ToolControl.BaseOperation.CanHaveProfiles) + if (toolControl.BaseOperation.CanHaveProfiles) { _isProfilesVisible = true; - var profiles = OperationProfiles.GetOperations(ToolControl.BaseOperation.GetType()); + var profiles = OperationProfiles.GetOperations(toolControl.BaseOperation.GetType()); _profiles.AddRange(profiles); if (toolControl.BaseOperation.ImportedFrom == Operation.OperationImportFrom.None || |