aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs30
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj4
3 files changed, 35 insertions, 1 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml
index 6b2bbaaec..6d8d86a8c 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml
@@ -15,7 +15,7 @@
<ImageBrush ImageSource="/Images/White-Abstract.png" Stretch="Fill"></ImageBrush>
</Grid.Background>
<Viewbox Stretch="Fill">
- <Grid Width="1920" Height="1145">
+ <Grid x:Name="grid" Width="1920" Height="1100">
<Grid>
<sharedControls:MultiTransitionControl AlwaysFade="True" TransitionType="Zoom" x:Name="TransitionControl" x:FieldModifier="public">
<sharedControls:MultiTransitionControl.Controls>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs
index c4d9b4a28..48de019e8 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs
@@ -48,6 +48,36 @@ namespace Tango.MachineStudio.UI
}
this.Loaded += MainWindow_Loaded;
+ this.SizeChanged += MainWindow_SizeChanged;
+ }
+
+ private void MainWindow_SizeChanged(object sender, SizeChangedEventArgs e)
+ {
+ var screen = System.Windows.Forms.Screen.FromHandle(new WindowInteropHelper(this).Handle);
+
+ double scr_width = screen.Bounds.Width;
+ double scr_height = screen.Bounds.Height;
+
+ double ratio = scr_width / scr_height;
+
+ List<double> ratios = new List<double>() { 16d / 9d, 16d / 10d, 4d / 3d };
+ ratio = ratios.Closest(ratio);
+
+ switch (ratio)
+ {
+ case 16d / 9d:
+ grid.Height = 1100;
+ break;
+ case 16d / 10d:
+ grid.Height = 1145;
+ break;
+ case 4d / 3d:
+ grid.Height = 1280;
+ break;
+ default:
+ grid.Height = 1145;
+ break;
+ }
}
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
index 0a92f2c91..07b1f44fe 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
@@ -367,6 +367,10 @@
<Project>{69db0564-268c-4b3c-b5d6-a3cdc7d14eae}</Project>
<Name>Tango.MachineStudio.HardwareDesigner</Name>
</ProjectReference>
+ <ProjectReference Include="..\Modules\Tango.MachineStudio.Logging\Tango.MachineStudio.Logging.csproj">
+ <Project>{1674f726-0e66-414f-b9fd-c6f20d7f07c7}</Project>
+ <Name>Tango.MachineStudio.Logging</Name>
+ </ProjectReference>
<ProjectReference Include="..\Modules\Tango.MachineStudio.MachineDesigner\Tango.MachineStudio.MachineDesigner.csproj">
<Project>{d0ce8122-077d-42a2-9490-028ae4769b52}</Project>
<Name>Tango.MachineStudio.MachineDesigner</Name>