diff --git a/Documents/Help/Changelog.md b/Documents/Help/Changelog.md index 8201f5f33..32a3afb1e 100644 --- a/Documents/Help/Changelog.md +++ b/Documents/Help/Changelog.md @@ -4,6 +4,7 @@ * Resolved [#611](https://github.com/Krypton-Suite/Standard-Toolkit/issues/611), `KryptonContextMenu`: Cannot add `ComboBoxItem` * Implemented [#610](https://github.com/Krypton-Suite/Standard-Toolkit/issues/610), `KryptonContextMenuRadioButton` - no way to assign a method/event through the item editor * Resolved [#607](https://github.com/Krypton-Suite/Standard-Toolkit/issues/607), `KryptonMessageBox` Certain length of the first line of text can push the text on the following out of the visible area (thanks to [giduac](https://github.com/giduac)) +* Some fixes for [#603](https://github.com/Krypton-Suite/Standard-Toolkit/issues/603), Title Bar Images Stretched/Cropped * Resolved [#596](https://github.com/Krypton-Suite/Standard-Toolkit/issues/596), ActionLists do not reflect the recommended or possible settings in the designer properties * Resolved [#590](https://github.com/Krypton-Suite/Standard-Toolkit/issues/590), Button text colour in certain themes is unreadable * Resolved [#587](https://github.com/Krypton-Suite/Standard-Toolkit/issues/587), `KryptonLabel` adds the `Paint` method by default diff --git a/Source/Krypton Components/Krypton Components Suite 2019.sln.DotSettings b/Source/Krypton Components/Krypton Components Suite 2019.sln.DotSettings deleted file mode 100644 index 28d11b952..000000000 --- a/Source/Krypton Components/Krypton Components Suite 2019.sln.DotSettings +++ /dev/null @@ -1,21 +0,0 @@ - - QAT - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True \ No newline at end of file diff --git a/Source/Krypton Components/Krypton Toolkit Suite 2019.sln.DotSettings b/Source/Krypton Components/Krypton Toolkit Suite 2019.sln.DotSettings deleted file mode 100644 index 819fc9614..000000000 --- a/Source/Krypton Components/Krypton Toolkit Suite 2019.sln.DotSettings +++ /dev/null @@ -1,8 +0,0 @@ - - SUGGESTION - DC - RI - UAC - True - True - True \ No newline at end of file diff --git a/Source/Krypton Components/Krypton.Navigator/Page/KryptonPage.cs b/Source/Krypton Components/Krypton.Navigator/Page/KryptonPage.cs index c540a776f..f1a2556bb 100644 --- a/Source/Krypton Components/Krypton.Navigator/Page/KryptonPage.cs +++ b/Source/Krypton Components/Krypton.Navigator/Page/KryptonPage.cs @@ -131,7 +131,7 @@ public class KryptonPage : VisualPanel /// Initialize a new instance of the KryptonPage class. /// public KryptonPage() - : this("Page", null) + : this(@"Page", null) { } @@ -166,9 +166,9 @@ public KryptonPage(string text, Bitmap imageSmall, string uniqueName) // Default properties Text = text; MinimumSize = new Size(50, 50); - _textTitle = "Page Title"; - _textDescription = "Page Description"; - _toolTipTitle = "Page ToolTip"; + _textTitle = @"Page Title"; + _textDescription = @"Page Description"; + _toolTipTitle = @"Page ToolTip"; _toolTipBody = string.Empty; _toolTipImage = null; _toolTipStyle = LabelStyle.ToolTip; diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecView.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecView.cs index d017e92e8..7cedc217c 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecView.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecView.cs @@ -307,9 +307,6 @@ protected virtual void OnFinishDelegate(object sender, EventArgs e) => #region IContentValues - private float _lastFactorDpiX; - private float _lastFactorDpiY; - private readonly Dictionary _cachedImages = new(); /// /// Gets the content image. /// @@ -319,33 +316,10 @@ public Image GetImage(PaletteState state) { // Get value from button spec passing inheritance redirector var baseImage = ButtonSpec.GetImage(_redirector, state); - if (baseImage == null) - { - return null; - } - - // Currently the `ViewButton.FactorDpi#`'s do _NOT_ change whilst the app is running - if (/*(ViewButton.FactorDpiX != _lastFactorDpiX) - || (ViewButton.FactorDpiY != _lastFactorDpiY) - ||*/ !_cachedImages.ContainsKey(baseImage) - ) - { - // Image needs to be regenerated - _lastFactorDpiX = ViewButton.FactorDpiX; - _lastFactorDpiY = ViewButton.FactorDpiY; - var currentWidth = baseImage.Width * _lastFactorDpiX; - var currentHeight = baseImage.Height * _lastFactorDpiY; - if ((int)currentHeight == baseImage.Height) - { - // Need to workaround the image drawing off the bottom of the form title bar when scaling @ 100% - currentHeight -= 2; // Has to be even to ensure that horizontal lines are still drawn. - } - - _cachedImages[baseImage] = CommonHelper.ScaleImageForSizedDisplay(baseImage, currentWidth, currentHeight); - } - - //return baseImage; - return _cachedImages[baseImage]; + // No need to perform scaling as it will be done @ + // $\Standard-Toolkit\Source\Krypton Components\Krypton.Toolkit\Rendering\RenderStandard.cs + // line 5779: memento.Image = CommonHelper.ScaleImageForSizedDisplay(memento.Image, currentWidth, currentHeight); + return baseImage; } /// diff --git a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderStandard.cs b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderStandard.cs index 2f3b46786..7584952e3 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderStandard.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderStandard.cs @@ -5773,11 +5773,10 @@ private static void AllocateImageSpace(StandardContentMemento memento, if ((displayRect.Width < memento.Image.Width) || (displayRect.Height < memento.Image.Height)) { + var ratio = 1.0f * Math.Min(memento.Image.Width, memento.Image.Height) / + Math.Max(memento.Image.Width, memento.Image.Height); // Resize image to fit display area - var currentWidth = Math.Min(displayRect.Width, memento.Image.Width); - var currentHeight = Math.Min(displayRect.Height, memento.Image.Height); - - memento.Image = CommonHelper.ScaleImageForSizedDisplay(memento.Image, currentWidth, currentHeight); + memento.Image = CommonHelper.ScaleImageForSizedDisplay(memento.Image, displayRect.Width*ratio, displayRect.Height*ratio); } // Cache the size of the image