Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* Updates #152

Merged
merged 6 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ These packages only support .NET Framework >= 4.5, .NET Core 3.1 and .NET 6.
=======

## 2021-08-01 Build 2108 - August 2021 (Canary)
* Implement [#154](https://github.com/Krypton-Suite/Standard-Toolkit/issues/154), Ability to alter both a `KryptonManager` and a `KryptonPalette` from within a `KryptonForm`
* Implement [#149](https://github.com/Krypton-Suite/Standard-Toolkit/issues/149), Change the default theme from `Office 2010 - Blue` to `Office 365 - Blue`
* Implement [#147](https://github.com/Krypton-Suite/Standard-Toolkit/issues/147), Update `csproj` files to handle `AssemblyInfo` data
* New `KryptonInputBoxManager` control, now you can configure a `KryptonInputBox` through the designer
* Improved the `KryptonInputBox` to take advantage of the `KryptonTextBox` ***CueHint*** features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public FormFixedButtonSpecCollection(KryptonForm owner)
private Icon _cacheIcon;
private int _cornerRoundingRadius;
private Control _activeControl;
private KryptonManager _internalKryptonManager;
private KryptonPalette _internalKryptonPalette;
#endregion

#region Identity
Expand Down Expand Up @@ -179,7 +181,7 @@ public KryptonForm()
ToolTipManager.CancelToolTip += OnCancelToolTip;
_buttonManager.ToolTipManager = ToolTipManager;

// Hook into globalstatic events
// Hook into global static events
KryptonManager.GlobalAllowFormChromeChanged += OnGlobalAllowFormChromeChanged;
KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged;

Expand All @@ -201,6 +203,10 @@ public KryptonForm()

// Set the CornerRoundingRadius to '-1', default value
CornerRoundingRadius = -1;

_internalKryptonManager = new KryptonManager();

_internalKryptonPalette = new KryptonPalette();
}

/// <summary>
Expand Down Expand Up @@ -624,6 +630,16 @@ public Control ActiveControl
}
}
}

/// <summary>Gets the internal krypton manager.</summary>
/// <value>The internal krypton manager.</value>
[Description("Manages the current theme.")]
public KryptonManager KryptonManager { get => _internalKryptonManager; private set => _internalKryptonManager = value; }

/// <summary>Gets the internal krypton palette.</summary>
/// <value>The internal krypton palette.</value>
[Description("Create a custom theme palette.")]
public KryptonPalette KryptonPalette { get => _internalKryptonPalette; private set => _internalKryptonPalette = value; }
#endregion

#region Public Chrome
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace Krypton.Toolkit
{
//// <summary>
/// <summary>
/// Displays an input box for the user.
/// </summary>
[ToolboxItem(false)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ public KryptonPalette()
_needTMSPaintDelegate = OnMenuToolStatusPaint;

// Set the default palette/palette mode
_basePalette = KryptonManager.GetPaletteForMode(PaletteMode.Office2010Blue);
_basePaletteMode = PaletteMode.Office2010Blue;
_basePalette = KryptonManager.GetPaletteForMode(PaletteMode.Office365Blue);
_basePaletteMode = PaletteMode.Office365Blue;

// Set the default renderer
_baseRenderer = null;
Expand Down Expand Up @@ -3076,7 +3076,7 @@ public void ResetCustomisedKryptonPaletteFilePath()
[KryptonPersist(false, false)]
[Category("Visuals")]
[Description("Base palette used to inherit from.")]
[DefaultValue(typeof(PaletteMode), "Office2010Blue")]
[DefaultValue(typeof(PaletteMode), "Office365Blue")]
public PaletteMode BasePaletteMode
{
get => _basePaletteMode;
Expand Down Expand Up @@ -3134,15 +3134,15 @@ public PaletteMode BasePaletteMode

private bool ShouldSerializeBasePaletteMode()
{
return (BasePaletteMode != PaletteMode.Office2010Blue);
return (BasePaletteMode != PaletteMode.Office365Blue);
}

/// <summary>
/// Resets the BasePaletteMode property to its default value.
/// </summary>
public void ResetBasePaletteMode()
{
BasePaletteMode = PaletteMode.Office2010Blue;
BasePaletteMode = PaletteMode.Office365Blue;
}

/// <summary>
Expand All @@ -3165,7 +3165,7 @@ public IPalette BasePalette
IPalette tempPalette = _basePalette;

// Find the new palette mode based on the incoming value
_basePaletteMode = (value == null) ? PaletteMode.Office2010Blue : PaletteMode.Custom;
_basePaletteMode = (value == null) ? PaletteMode.Office365Blue : PaletteMode.Custom;
_basePalette = value;

// If the new value creates a circular reference
Expand Down Expand Up @@ -3209,7 +3209,7 @@ public IPalette BasePalette
/// </summary>
public void ResetBasePalette()
{
BasePaletteMode = PaletteMode.Office2010Blue;
BasePaletteMode = PaletteMode.Office365Blue;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ namespace Krypton.Toolkit
/// </summary>
internal class PaletteModeConverter : StringLookupConverter
{
#region Static Fields
#region Static Fields
/// <summary>Converts the <see cref="PaletteMode"/> values into a human readable format.</summary>
private Pair[] _pairs = new Pair[] { new(PaletteMode.ProfessionalSystem, "Professional - System"),
new(PaletteMode.ProfessionalOffice2003,"Professional - Office 2003"),
new(PaletteMode.Office2007Blue, "Office 2007 - Blue"),
Expand All @@ -37,7 +38,10 @@ internal class PaletteModeConverter : StringLookupConverter
new(PaletteMode.Office365White, "Office 365 - White"),
new(PaletteMode.SparkleBlue, "Sparkle - Blue"),
new(PaletteMode.SparkleOrange, "Sparkle - Orange"),
new(PaletteMode.SparklePurple, "Sparkle - Purple") };
new(PaletteMode.SparklePurple, "Sparkle - Purple"),
//new(PaletteMode.VisualStudioDark, "Visual Studio Dark"),
//new(PaletteMode.VisualStudioLight, "Visual Studio Light")
};
#endregion

#region Identity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2169,6 +2169,16 @@ public enum PaletteMode
/// </summary>
SparklePurple,

/// <summary>
/// Specifies the visual studio dark palette theme.
/// </summary>
VisualStudioDark,

/// <summary>
/// Specifies the visual studio light palette theme.
/// </summary>
VisualStudioLight,

/// <summary>
/// Specifies a custom palette be used.
/// </summary>
Expand Down Expand Up @@ -2276,6 +2286,16 @@ public enum PaletteModeManager
/// </summary>
SparklePurple,

/// <summary>
/// Specifies the visual studio dark palette theme.
/// </summary>
VisualStudioDark,

/// <summary>
/// Specifies the visual studio light palette theme.
/// </summary>
VisualStudioLight,

/// <summary>
/// Specifies a custom palette be used.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Krypton.Toolkit
/// Provides a base for Visual Studio 2020 palettes.
/// </summary>
/// <seealso cref="Krypton.Toolkit.PaletteBase" />
public abstract class PaletteVisualStudio2020Base : PaletteBase
public abstract class PaletteVisualStudioBase : PaletteBase
{
#region Static Fields
private static readonly Padding _contentPaddingGrid = new(2, 1, 2, 1);
Expand Down