Skip to content

Commit

Permalink
- Put the code in to scale the ButtonSpec image
Browse files Browse the repository at this point in the history
- TestForm designer changes..

#1946
  • Loading branch information
Smurf-IV committed Dec 16, 2024
1 parent fd00918 commit 45322ef
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 135 deletions.
2 changes: 2 additions & 0 deletions Documents/Changelog/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
=======

## 2025-02-01 - Build 2502 (Version 95 - Patch 1) - February 2025
* Resolved [#1946](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1946), ButtonSpecs do not scale anymore!
* Resolved [#1940](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1940), In V95 KContextMenuItem no longer stores the Text value in the designer !!
* Resolved [#1938](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1938), `KryptonTextBox` CueHint Text
* Implemented [#519](https://github.com/Krypton-Suite/Standard-Toolkit/issues/519), `PaletteDataGridViewAll` does not expose the border value of the `private readonly PaletteDouble _background`
Expand Down Expand Up @@ -189,6 +190,7 @@
=======

# 2025-02-01 - Build 2502 (Patch 5) - February 2025
* Resolved [#1946](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1946), ButtonSpecs do not scale anymore!
* Resolved [#1905](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1905), `Sparkle` Themes have an issue with the Background
* Resolved [#980](https://github.com/Krypton-Suite/Standard-Toolkit/issues/980), `KryptonDockableNavigator` with pages without `AllowConfigSave` flag are incorrectly saved
* Resolved [#1910](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1910), `Workspace Persistence` -> "Save to array" Causes an exception in `Toolkit.XmlHelper.Image.Save`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,12 @@ protected virtual void OnFinishDelegate(object? sender, EventArgs? e) =>
public Image? GetImage(PaletteState state)
{
// Get value from button spec passing inheritance redirector
var baseImage = ButtonSpec.GetImage(_redirector, state);
Image? baseImage = ButtonSpec.GetImage(_redirector, state);

// 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;
return (baseImage != null)
? CommonHelper.ScaleImageForSizedDisplay(baseImage, baseImage.Width * _controller!.Target.FactorDpiX,
baseImage.Height * _controller!.Target.FactorDpiY)
: null;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Krypton.Toolkit
public class KryptonContextMenuHeading : KryptonContextMenuItemBase
{
#region Instance Fields
private string? _extraText;
private string _extraText;
private Image? _image;
private Color _imageTransparentColor;
private readonly PaletteRedirectTriple _redirectHeading;
Expand Down Expand Up @@ -165,17 +165,17 @@ public string Text
[Description(@"Heading menu item extra text.")]
[Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
[Localizable(true)]
[DefaultValue(null)]
[DefaultValue("")]
[AllowNull]
public string ExtraText
{
get => _extraText ?? string.Empty;
get => _extraText;

set
{
if (_extraText != value)
{
_extraText = value;
_extraText = value ?? string.Empty;
OnPropertyChanged(new PropertyChangedEventArgs(nameof(ExtraText)));
}
}
Expand Down Expand Up @@ -224,7 +224,7 @@ public Color ImageTransparentColor
}
}

private bool ShouldSerializeImageTransparentColor() => (_imageTransparentColor == null) || !_imageTransparentColor.Equals(GlobalStaticValues.EMPTY_COLOR);
private bool ShouldSerializeImageTransparentColor() => !_imageTransparentColor.Equals(GlobalStaticValues.EMPTY_COLOR);

/// <summary>
/// Gets access to the header instance specific appearance values.
Expand Down
123 changes: 71 additions & 52 deletions Source/Krypton Components/TestForm/Bug833Test.Designer.cs

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Source/Krypton Components/TestForm/ButtonsTest.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Source/Krypton Components/TestForm/Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Source/Krypton Components/TestForm/RibbonTest.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 45322ef

Please sign in to comment.