diff --git a/OnTopReplica/AspectRatioForm.cs b/OnTopReplica/AspectRatioForm.cs index 7643eab..a937ab6 100644 --- a/OnTopReplica/AspectRatioForm.cs +++ b/OnTopReplica/AspectRatioForm.cs @@ -60,7 +60,6 @@ namespace OnTopReplica { /// Forces the form to update its height based on the current aspect ratio setting. /// public void RefreshAspectRatio() { - Console.WriteLine("Refreshing, size " + ClientSize.ToString() + " padding " + ExtraPadding.ToString()); ClientSize = new Size(ClientSize.Width, (int)((ClientSize.Width - ExtraPadding.Horizontal) / AspectRatio) + ExtraPadding.Vertical); } @@ -74,8 +73,20 @@ namespace OnTopReplica { RefreshAspectRatio(); } + protected override void OnResizeEnd(EventArgs e) { + base.OnResizeEnd(e); + + //Ensure that the ClientSize of the form is always respected (not ensured by the WM_SIZING message alone) + if (KeepAspectRatio) { + //Since WM_SIZING already fixes up the size almost correctly, + //simply set the height to the correct value + var newHeight = (int)((ClientSize.Width - ExtraPadding.Horizontal) / AspectRatio + ExtraPadding.Vertical); + ClientSize = new Size(ClientSize.Width, newHeight); + } + } + /// - /// Override WM_SIZING message. + /// Override WM_SIZING message to restrict resizing. /// Taken from: http://www.vcskicks.com/maintain-aspect-ratio.php /// protected override void WndProc(ref Message m) { diff --git a/OnTopReplica/Assets/about.html b/OnTopReplica/Assets/about.html deleted file mode 100644 index 1018d95..0000000 --- a/OnTopReplica/Assets/about.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - -

License

- -

OnTopReplica is licensed under the Microsoft Reciprocal License (Ms-RL).

-

The original source code can be found on the project's homepage on CodePlex.

- -

Credits

- -

OnTopReplica was inspired by Switcher and other DWM based applications.

- -

All Vista controls are part of the WindowsFormsAero library for .NET.

- -

Some example code taken from Ookii on Channel9.

- -

NativeToolstripRenderer class taken from asztal.net.

- -

Some icons from VistaICO.com and the Xiao icon set.

- - - \ No newline at end of file diff --git a/OnTopReplica/MainForm.Designer.cs b/OnTopReplica/MainForm.Designer.cs index 676d4da..6e8981c 100644 --- a/OnTopReplica/MainForm.Designer.cs +++ b/OnTopReplica/MainForm.Designer.cs @@ -466,7 +466,7 @@ this.ControlBox = false; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MinimumSize = new System.Drawing.Size(200, 205); + this.MinimumSize = new System.Drawing.Size(200, 210); this.Name = "MainForm"; this.ShowInTaskbar = false; this.TopMost = true; diff --git a/OnTopReplica/MainForm.cs b/OnTopReplica/MainForm.cs index 4ac98e0..45d1a5a 100644 --- a/OnTopReplica/MainForm.cs +++ b/OnTopReplica/MainForm.cs @@ -92,6 +92,7 @@ namespace OnTopReplica void RegionBox_RequestRegionReset(object sender, EventArgs e) { _thumbnailPanel.ResetShownRegion(); + SetAspectRatio(_thumbnailPanel.ThumbnailOriginalSize); } void Thumbnail_RegionDrawn(object sender, Rectangle region) { @@ -151,6 +152,7 @@ namespace OnTopReplica X = (value) ? (ClientSize.Width - _regionBox.Width) : ClientSize.Width, Y = 0 }; + _regionBox.Size = new Size(_regionBox.Width, ClientSize.Height); //Check form boundaries and move form if necessary if (value) { diff --git a/OnTopReplica/OnTopReplica.csproj b/OnTopReplica/OnTopReplica.csproj index 441580d..02aaa6e 100644 --- a/OnTopReplica/OnTopReplica.csproj +++ b/OnTopReplica/OnTopReplica.csproj @@ -49,8 +49,8 @@ true publish.htm false - 3 - 2.9.1.%2a + 2 + 2.9.2.%2a false true true @@ -254,7 +254,6 @@ - diff --git a/OnTopReplica/Properties/AssemblyInfo.cs b/OnTopReplica/Properties/AssemblyInfo.cs index 6886f8d..59b1ff9 100644 --- a/OnTopReplica/Properties/AssemblyInfo.cs +++ b/OnTopReplica/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.9.1.0")] -[assembly: AssemblyFileVersion("2.9.1.0")] +[assembly: AssemblyVersion("2.9.2.0")] +[assembly: AssemblyFileVersion("2.9.2.0")] diff --git a/OnTopReplica/Properties/Resources.Designer.cs b/OnTopReplica/Properties/Resources.Designer.cs index 827df20..a83560d 100644 --- a/OnTopReplica/Properties/Resources.Designer.cs +++ b/OnTopReplica/Properties/Resources.Designer.cs @@ -60,49 +60,6 @@ namespace OnTopReplica.Properties { } } - /// - /// Looks up a localized string similar to <html> - /// <head> - /// <style type="text/css"> - ///body { - /// font-family: Segoe UI, Arial, sans-serif; - /// font-size: 0.8em; - /// margin: 0; - /// padding: 0.75em; - ///} - ///h1 { - /// font-size: 1.4em; - /// font-weight: bold; - /// - /// margin: 0 0 1em 0; - /// padding: 0; - ///} - ///p { - /// margin: 0.5em 0 0.5em 1em; - /// padding: 0; - ///} - ///a { - /// font-weight: bold; - /// color: blue; - ///} - ///a:hover { - /// color: red; - ///} - /// </style> - /// </head> - /// - /// <body> - /// - /// <h1>License</h1> - /// - /// <p><b>OnTopReplica</b> is licensed under the <a href="http://opensource.org/licenses/m [rest of string was truncated]";. - /// - internal static string about { - get { - return ResourceManager.GetString("about", resourceCulture); - } - } - internal static System.Drawing.Bitmap back { get { object obj = ResourceManager.GetObject("back", resourceCulture); diff --git a/OnTopReplica/Properties/Resources.resx b/OnTopReplica/Properties/Resources.resx index 6e0e814..be33031 100644 --- a/OnTopReplica/Properties/Resources.resx +++ b/OnTopReplica/Properties/Resources.resx @@ -169,9 +169,6 @@ ..\Assets\pos_topright.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Assets\about.html;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - ..\Assets\window_border16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/OnTopReplica/Strings.Designer.cs b/OnTopReplica/Strings.Designer.cs index 260444d..a1682a0 100644 --- a/OnTopReplica/Strings.Designer.cs +++ b/OnTopReplica/Strings.Designer.cs @@ -110,7 +110,7 @@ namespace OnTopReplica { /// font-size: 1.4em; /// font-weight: bold; /// - /// margin: 0 0 1em 0; + /// margin: 1em 0 0.4em 0; /// padding: 0; ///} ///p { @@ -131,7 +131,7 @@ namespace OnTopReplica { /// /// <h1>License</h1> /// - /// <p><b>OnTopReplica</b> is licensed under the <a href="http://opensource.org/licenses/ms- [rest of string was truncated]";. + /// <p><b>OnTopReplica</b> is licensed under the <a href="http://opensource.org/licenses [rest of string was truncated]";. /// internal static string AboutDetails { get { diff --git a/OnTopReplica/Strings.it.resx b/OnTopReplica/Strings.it.resx index 41fa4bf..a3dbe1f 100644 --- a/OnTopReplica/Strings.it.resx +++ b/OnTopReplica/Strings.it.resx @@ -489,7 +489,7 @@ h1 { font-size: 1.4em; font-weight: bold; - margin: 0 0 1em 0; + margin: 1em 0 0.4em 0; padding: 0; } p { diff --git a/OnTopReplica/Strings.resx b/OnTopReplica/Strings.resx index 89f46d3..437be69 100644 --- a/OnTopReplica/Strings.resx +++ b/OnTopReplica/Strings.resx @@ -489,7 +489,7 @@ h1 { font-size: 1.4em; font-weight: bold; - margin: 0 0 1em 0; + margin: 1em 0 0.4em 0; padding: 0; } p {