Skip to content

Commit

Permalink
- Rename KryptonPalette to KryptonCustomPaletteBase to make it ob…
Browse files Browse the repository at this point in the history
…vious what it is.

- Add designer code to allow the `KryptonThemeComboBox` to add a `KryptonCustomPalette`

#827
  • Loading branch information
Smurf-IV committed Jan 21, 2023
1 parent ef71f33 commit d8dd136
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2704,7 +2704,7 @@ public IRenderer BaseRenderer

protected override void DefineFonts()
{
throw new NotImplementedException();
// This class has no font fields
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ public int ThemeSelectedIndex

private bool ShouldSerializeThemeSelectedIndex() => _selectedIndex != 25;

/// <summary>
/// Gets and sets the ThemeSelectedIndex.
/// </summary>
[Category(@"Visuals")]
[Description(@"Custom Theme to use when `Custom` is selected")]
[DefaultValue(null)]
public KryptonCustomPaletteBase KryptonCustomPalette { get; set; }

[EditorBrowsable(EditorBrowsableState.Never)]
public KryptonManager Manager
Expand Down Expand Up @@ -98,6 +105,12 @@ protected override void OnSelectedIndexChanged(EventArgs e)
ThemeSelectedIndex = SelectedIndex;

base.OnSelectedIndexChanged(e);
if ((ThemeManager.GetThemeManagerMode(Text) == PaletteMode.Custom)
&& (KryptonCustomPalette != null)
)
{
Manager.GlobalPalette = KryptonCustomPalette;
}
}

#endregion
Expand Down

0 comments on commit d8dd136

Please sign in to comment.