Skip to content

Commit

Permalink
Merge pull request #1950 from Krypton-Suite/1946-alpha-ButtonSpecs-Sc…
Browse files Browse the repository at this point in the history
…aling

 - Put the code in to scale the ButtonSpec image
  • Loading branch information
PWagner1 authored Dec 16, 2024
2 parents a9ae09f + fcfd0e1 commit 2eed7de
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 98 deletions.
3 changes: 3 additions & 0 deletions Documents/Changelog/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
=======

## 2025-11-xx - Build 2511 - November 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 [#1928](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1928), A proper exception dialog
- To invoke, use `KryptonExceptionDialog`
Expand Down Expand Up @@ -36,6 +37,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
* Resolved [#1905](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1905), `Sparkle` Themes have an issue with the Background
Expand Down Expand Up @@ -218,6 +220,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
Loading

0 comments on commit 2eed7de

Please sign in to comment.