Skip to content

Commit

Permalink
Merge pull request #1209 from Krypton-Suite/alpha-1206-RemoveFontSize
Browse files Browse the repository at this point in the history
- Remove the Font Size specific designer fields
  • Loading branch information
PWagner1 authored Dec 2, 2023
2 parents a70c4dd + cfdce9f commit d47a842
Show file tree
Hide file tree
Showing 9 changed files with 419 additions and 425 deletions.
1 change: 1 addition & 0 deletions Documents/Help/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
=======

## 2024-11-xx - Build 2411 - November 2024
* Resolved [#1206](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1206), Remove the Font Size (as it is already covered by the actual font !)
* Resolved [#1197](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1197), `KryptonTaskDialog` Footer Images
* Resolved [#1189](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1189), The Context and Next/Pervious buttons of the `KryptonDockableNavigator` cannot be used
* Implement [#1187](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1187), Bring over the `KryptonCommandLinkButtons`
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ Follow the links to see the different objects and layouts that this framework al

## V90.## (2024-11-xx - Build 2411 - November 2024)
There are list of changes that have occurred during the development of the V90.## version
- [#1206](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1206), Remove the Font Size (as it is already covered by the actual font !)

### Support for .NET 7
As of V90.##, support for .NET 7 has been removed due to their release cadences.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2929,24 +2929,26 @@ public IRenderer? BaseRenderer
[Browsable(false)]
public override KryptonColorTable ColorTable => ToolMenuStatus.InternalKCT;

/// <inheritdoc />
[Browsable(false)]
public new bool UseKryptonFileDialogs
{ get => _basePalette!.UseKryptonFileDialogs; set => _basePalette!.UseKryptonFileDialogs = value; }

[Browsable(false)]
public new float BaseFontSize
{ get => _basePalette!.BaseFontSize; set => _basePalette!.BaseFontSize = value; }

/// <inheritdoc />
[Browsable(false)]
[DisallowNull]
public new Font BaseFont
{ get => _basePalette!.BaseFont; set => _basePalette!.BaseFont = value; }
private void ResetBaseFont() => _basePalette!.ResetBaseFont();
private bool ShouldSerializeBaseFont() => _basePalette!.ShouldSerializeBaseFont();

/// <inheritdoc />
[Browsable(false)]
[DisallowNull]
public new string ThemeName
{ get => _basePalette!.ThemeName; set => _basePalette!.ThemeName = value; }

/// <inheritdoc />
[Browsable(false)]
public new BasePaletteType BasePaletteType
{ get => _basePalette!.BasePaletteType; set => _basePalette!.BasePaletteType = value; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ public PaletteBase? GlobalPalette
}
}

private bool ShouldSerializeGlobalPalette() => GlobalPalette != null;
private bool ShouldSerializeGlobalPalette() => GlobalPalette != CurrentGlobalPalette;

private void ResetGlobalPalette() => GlobalPaletteMode = PaletteMode.Microsoft365Blue;
private void ResetGlobalPalette() => GlobalPalette = CurrentGlobalPalette;

/// <summary>
/// Gets or sets a value indicating if the palette colors are applied to the tool-strips.
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -1084,9 +1084,6 @@ public virtual PaletteBase? Target

#region ColorTable

/// <inheritdoc />
protected override void DefineFonts() => throw new NotImplementedException();

/// <summary>
/// Gets access to the color table instance.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ public abstract class PaletteBase : Component
{
#region Instance Fields

private bool _useKryptonFileDialogs;
private BasePaletteType _basePaletteType;
private Padding? _inputControlPadding;
private PaletteDragFeedback _dragFeedback;
private string _themeName;

private readonly Font _defaultFontStyle = new Font("Segoe UI", 9f, FontStyle.Regular);

Expand Down Expand Up @@ -91,11 +88,11 @@ protected PaletteBase()
// Inherit means we need to calculate the value next time it is requested
_dragFeedback = PaletteDragFeedback.Inherit;

_themeName = string.Empty;
ThemeName = string.Empty;

_useKryptonFileDialogs = true;
UseKryptonFileDialogs = true;

_baseFont = _defaultFontStyle;
BaseFont = _defaultFontStyle;
}
#endregion

Expand Down Expand Up @@ -1698,28 +1695,7 @@ public virtual PaletteDragFeedback GetDragDropFeedback()
/// <summary>Gets or sets a value indicating whether [use krypton file dialogs].</summary>
/// <value><c>true</c> if [use krypton file dialogs]; otherwise, <c>false</c>.</value>
[DefaultValue(false), Description(@"Use Krypton style file dialogs for exporting/importing palettes.")]
public bool UseKryptonFileDialogs { get => _useKryptonFileDialogs; set => _useKryptonFileDialogs = value; }

/// <summary>Gets and sets the base font size used when defining fonts.</summary>
[Description(@"Gets and sets the base font size used when defining fonts.")]
public float BaseFontSize
{
get => _baseFont.Size;

set
{
if (value <= 0)
{
value = _defaultFontStyle.Size;
}

// Is there a change in value?
if (_baseFont.Size != value)
{
BaseFont = new Font(_baseFont.Name, value, _baseFont.Style);
}
}
}
public bool UseKryptonFileDialogs { get; set; }

/// <summary>Gets or sets the base palette font.</summary>
/// <value>The base palette font.</value>
Expand All @@ -1736,16 +1712,18 @@ public Font BaseFont
OnPalettePaint(this, new PaletteLayoutEventArgs(true, false));
}
}
internal void ResetBaseFont() => BaseFont = _defaultFontStyle;
internal bool ShouldSerializeBaseFont() => !Equals(BaseFont, _defaultFontStyle);

/// <summary>Gets or sets the name of the theme.</summary>
/// <value>The name of the theme.</value>
[DisallowNull, Description(@"Gets or sets the name of the theme.")]
public string ThemeName { get => _themeName; set => _themeName = value; }
public string ThemeName { get; set; }

/// <summary>Gets or sets the type of the base palette.</summary>
/// <value>The type of the base palette.</value>
[Description(@"Gets or sets the type of the base palette.")]
public BasePaletteType BasePaletteType { get => _basePaletteType; set => _basePaletteType = value; }
public BasePaletteType BasePaletteType { get; set; }

#endregion

Expand Down
Loading

0 comments on commit d47a842

Please sign in to comment.