Skip to content

Commit

Permalink
Done so far:
Browse files Browse the repository at this point in the history
- [x] Remove from their current "General" location in the designer
- [x] Add new Area and values to the `State###` area with an appropriate named Key: i.e. `RibbonFileAppButton`
  - [ ] Use the existing values as the defaults, but not "Hard Code" them !
- [x] Wire up the usage of Disabled etc usages to use the `##Dark` and `##Light` overrides to follow the correct pattern
- [x] Update the Breaking Changes area to state correct usages of the `RibbonFileAppButton` values
- [ ] Fix Examples
- [ ] Fix Theme Template editor

#1356
  • Loading branch information
Smurf-IV committed Apr 5, 2024
1 parent 7dfd0c3 commit 8bf795a
Show file tree
Hide file tree
Showing 131 changed files with 3,419 additions and 3,394 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 [#1356](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1356), **[Breaking Change]** AppButton colours don't change while switching themes
* Resolved [#1301](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1301), **[Regression]** When Maximised - intergrated KryptonRibbon has titlebar issues
* Resolved [#1383](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1383), Closing last Page in undocked page group prevents addition of further Pages via `KryptonDockingManager.AddToWorkspace` (fix courtesy of [stizler](https://github.com/stigzler))
* Resolved [#1336](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1336), **[Regression]** KryptonForm has "Black Line" under Titlebar when maximised
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

<!-- Start Document Outline -->


* [NuGet Information](#nuget-information)
* [Nightly](#nightly)
* [Canary](#canary)
Expand Down Expand Up @@ -180,6 +179,8 @@ 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
- [#1356](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1356), AppButton colours don't change while switching themes
- - See https://github.com/Krypton-Suite/Standard-Toolkit/issues/1356#issuecomment-2039412890
- [#1206](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1206), Remove the `Font Size` (as it is already covered by the actual font !)
- [#1224](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1224), Move `GlobalPaletteMode` into `GlobalPalette` and rename
- BaseFont is now part of the KryptonManager class, and will override the applied palette font(s)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public ButtonSpecNavRemap(PaletteBase target,
{
Debug.Assert(buttonSpec != null);

_buttonSpec = buttonSpec;
_buttonSpec = buttonSpec!;
_remapTarget = remapTarget;
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#region BSD License
/*
*
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
* Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2024. All rights reserved.
*
*/
#endregion

Expand Down Expand Up @@ -39,7 +37,7 @@ public PaletteRibbonGeneralNavRedirect([DisallowNull] PaletteRedirect redirect,
NeedPaint = needPaint;

// Store the inherit instances
_inherit = new PaletteRibbonGeneralInheritRedirect(redirect);
_inherit = new PaletteRibbonGeneralInheritRedirect(redirect!);

// Set default values
_textFont = null;
Expand Down Expand Up @@ -225,37 +223,15 @@ public Color GetRibbonTabRowBackgroundSolidColor(PaletteState state) =>
public float GetRibbonTabRowGradientRaftingAngle(PaletteState state) =>
_inherit.GetRibbonTabRowGradientRaftingAngle(state);

#endregion

#region RibbonTabRowGradientColor1

/// <inheritdoc />
public Color GetRibbonTabRowGradientColor1(PaletteState state) => _inherit.GetRibbonTabRowGradientColor1(state);

#endregion

#region RibbonAppButtonDarkColor

/// <inheritdoc />
public Color GetRibbonAppButtonDarkColor(PaletteState state) => _inherit.GetRibbonAppButtonDarkColor(state);

#endregion

#region RibbonAppButtonLightColor
#region RibbonTabRowGradientColor1

/// <inheritdoc />
public Color GetRibbonAppButtonLightColor(PaletteState state) => _inherit.GetRibbonAppButtonLightColor(state);

#endregion

#region RibbonAppButtonTextColor

/// <inheritdoc />
public Color GetRibbonAppButtonTextColor(PaletteState state) => _inherit.GetRibbonAppButtonTextColor(state);
public Color GetRibbonTabRowGradientColor1(PaletteState state) => _inherit.GetRibbonTabRowGradientColor1(state);

#endregion


#region GetRibbonShape
/// <summary>
/// Gets the ribbon shape.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#region BSD License
/*
*
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
* Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2024. All rights reserved.
*
* Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2024. All rights reserved.
*/
#endregion

Expand Down Expand Up @@ -46,12 +44,10 @@ public RibbonButtonSpecAnyCollection(KryptonRibbon owner)
#endregion

#region Static Fields

private static readonly MethodInfo _containerSelect;
#endregion

#region Instance Fields
// Private
private NeedPaintHandler _needPaintGroups;
private VisualPopupMinimized? _minimizedPopup;
private KryptonContextMenu? _kcm;
Expand Down Expand Up @@ -100,7 +96,6 @@ public RibbonButtonSpecAnyCollection(KryptonRibbon owner)
private PaletteBackStyle _backInactiveStyle;
private KryptonRibbonTab? _minSelectedTab;
private KryptonRibbonTab? _selectedTab;

#endregion

#region Events
Expand Down Expand Up @@ -698,7 +693,17 @@ public string SelectedContext
[MergableProperty(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Localizable(true)]
public RibbonAppButton RibbonAppButton { get; private set; }
public RibbonFileAppButton RibbonFileAppButton { get; private set; }

/// <summary>
/// Gets the set of ribbon application button display strings.
/// </summary>
[Category(@"Values")]
[Description(@"Collection of ribbon 'File app tab' settings.")]
[MergableProperty(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Localizable(true)]
public RibbonFileAppTab RibbonFileAppTab { get; private set; }

/// <summary>
/// Gets the styles for various ribbon elements.
Expand Down Expand Up @@ -1406,7 +1411,7 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
}

// Check if a shortcut is triggered on the application button context menu
if (RibbonAppButton.AppButtonMenuItems.ProcessShortcut(keyData))
if (RibbonFileAppButton.AppButtonMenuItems.ProcessShortcut(keyData))
{
ActionOccurred();
return true;
Expand Down Expand Up @@ -2563,7 +2568,9 @@ private void CreateStorageObjects()

_ribbonGeneralInherit = new PaletteRibbonGeneralInheritRedirect(Redirector);

RibbonAppButton = new RibbonAppButton(this, _ribbonGeneralInherit);
RibbonFileAppButton = new RibbonFileAppButton(this);
RibbonFileAppTab = new RibbonFileAppTab(this);

RibbonStyles = new PaletteRibbonStyles(this, NeedPaintPaletteDelegate);
StateCommon = new PaletteRibbonRedirect(Redirector, PaletteBackStyle.PanelClient, NeedPaintPaletteDelegate);
StateDisabled = new PaletteRibbonDisabled(StateCommon, NeedPaintPaletteDelegate);
Expand Down Expand Up @@ -2598,7 +2605,7 @@ private void CreateViewManager()
CaptionArea = new ViewDrawRibbonCaptionArea(this, Redirector, NeedPaintDelegate);

// Create tabs area containing the tabs, pendant buttons etc...
TabsArea = new ViewLayoutRibbonTabsArea(this, Redirector, CaptionArea, CaptionArea.ContextTitles!, NeedPaintDelegate);
TabsArea = new ViewLayoutRibbonTabsArea(this, Redirector, CaptionArea, CaptionArea.ContextTitles, NeedPaintDelegate);

// Create groups area containing the groups of the selected tab
GroupsArea = new ViewLayoutRibbonGroupsArea(this, Redirector, _needPaintGroups);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public string Text
[Bindable(true)]
[Category(@"Appearance")]
[Description(@"Color to draw as transparent in the ToolTipImage.")]
[KryptonDefaultColor()]
[KryptonDefaultColor]
[Localizable(true)]
public Color ToolTipImageTransparentColor { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#region BSD License
/*
*
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
* Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
*/
#endregion

Expand All @@ -34,19 +30,18 @@ internal class VisualPopupAppMenu : VisualPopup
#endregion

#region Identity

/// <summary>
/// Initialize a new instance of the VisualPopupAppMenu class.
/// </summary>
/// <param name="ribbon">Owning ribbon instance.</param>
/// <param name="appButton">Originating app button instance.</param>
/// <param name="palette">Local palette setting to use initially.</param>
/// <param name="paletteMode">Palette mode setting to use initially.</param>
/// <param name="redirector">Redirector used for obtaining palette values.</param>
/// <param name="rectAppButtonTopHalf">Screen location of the upper half of the app button.</param>
/// <param name="rectAppButtonBottomHalf">Screen location of the lower half of the app button.</param>
/// <param name="keyboardActivated">Was the context menu activated by a keyboard action.</param>
public VisualPopupAppMenu(KryptonRibbon ribbon,
RibbonAppButton appButton,
PaletteBase? palette,
PaletteMode paletteMode,
PaletteRedirect redirector,
Expand All @@ -72,7 +67,7 @@ public VisualPopupAppMenu(KryptonRibbon ribbon,

// Create provider instance
_provider = new AppButtonMenuProvider((ViewContextMenuManager)ViewManager,
_ribbon.RibbonAppButton.AppButtonMenuItems,
_ribbon.RibbonFileAppButton.AppButtonMenuItems,
_viewColumns, palette, paletteMode,
redirector, NeedPaintDelegate);

Expand All @@ -82,12 +77,12 @@ public VisualPopupAppMenu(KryptonRibbon ribbon,

CreateAppButtonBottom();
CreateButtonSpecView();
CreateContextMenuView(appButton);
CreateContextMenuView(_ribbon.RibbonFileAppButton);
CreateRecentDocumentsView();
CreateInnerBacking(CreateInsideCanvas());
CreateOuterBacking();
CreateOutsideDocker();
CreateButtonManager(appButton);
CreateButtonManager(_ribbon.RibbonFileAppButton);

// With keyboard activate we select the first valid item
if (keyboardActivated)
Expand All @@ -100,7 +95,7 @@ private void CreateButtonSpecView() =>
// Layout docker used to contain the generated button specs
_viewButtonSpecDocker = new ViewLayoutDocker();

private void CreateContextMenuView(RibbonAppButton appButton)
private void CreateContextMenuView(RibbonFileAppButton fileAppButton)
{
// Ask the top level collection to generate the child view elements
var topCollection = new KryptonContextMenuCollection();
Expand All @@ -109,7 +104,7 @@ private void CreateContextMenuView(RibbonAppButton appButton)
ImageColumn = false
};
topCollection.Add(topItems);
foreach (KryptonContextMenuItemBase item in appButton.AppButtonMenuItems)
foreach (KryptonContextMenuItemBase item in fileAppButton.AppButtonMenuItems)
{
topItems.Items.Add(item);
}
Expand All @@ -119,15 +114,15 @@ private void CreateContextMenuView(RibbonAppButton appButton)
private void CreateRecentDocumentsView()
{
// Do we need to add the recent docs view?
if (_ribbon.RibbonAppButton.AppButtonShowRecentDocs)
if (_ribbon.RibbonFileAppButton.AppButtonShowRecentDocs)
{
// Create a dummy vertical menu separator for separating recent documents from menu items
var dummySep1 = new KryptonContextMenuSeparator
{
Horizontal = false
};
_viewColumns.Add(new ViewDrawMenuSeparator(dummySep1, _provider.ProviderStateCommon.Separator));
_viewColumns.Add(new ViewLayoutSeparator(0, _ribbon.RibbonAppButton.AppButtonMinRecentSize.Height));
_viewColumns.Add(new ViewLayoutSeparator(0, _ribbon.RibbonFileAppButton.AppButtonMinRecentSize.Height));

// Use a layout that draws the background color of the recent docs area
var recentDocsBack = new ViewDrawRibbonAppMenuDocs(_ribbon);
Expand All @@ -138,7 +133,7 @@ private void CreateRecentDocumentsView()
recentDocsBack.Add(documentStack);

// Use fixed width separator to enforce a minimum width to column
documentStack.Add(new ViewLayoutSeparator(_ribbon.RibbonAppButton.AppButtonMinRecentSize.Width, 0));
documentStack.Add(new ViewLayoutSeparator(_ribbon.RibbonFileAppButton.AppButtonMinRecentSize.Width, 0));

// Add the recent document title
documentStack.Add(new ViewDrawRibbonRecentDocs(_ribbon));
Expand All @@ -150,9 +145,9 @@ private void CreateRecentDocumentsView()

// Then generate an item per recent document entry
var index = 1;
foreach (KryptonRibbonRecentDoc recentDoc in _ribbon.RibbonAppButton.AppButtonRecentDocs)
foreach (KryptonRibbonRecentDoc recentDoc in _ribbon.RibbonFileAppButton.AppButtonRecentDocs)
{
documentStack.Add(new ViewDrawRibbonAppMenuRecentDec(_ribbon, _provider, recentDoc, _ribbon.RibbonAppButton.AppButtonMaxRecentSize.Width, NeedPaintDelegate, index++));
documentStack.Add(new ViewDrawRibbonAppMenuRecentDec(_ribbon, _provider, recentDoc, _ribbon.RibbonFileAppButton.AppButtonMaxRecentSize.Width, NeedPaintDelegate, index++));
}

// Add separator entry which is then used to fill remained space
Expand Down Expand Up @@ -212,10 +207,10 @@ private void CreateOutsideDocker()
ViewManager!.Root = _drawOutsideDocker;
}

private void CreateButtonManager(RibbonAppButton appButton)
private void CreateButtonManager(RibbonFileAppButton fileAppButton)
{
_buttonManager = new ButtonSpecManagerLayoutAppButton((ViewContextMenuManager)ViewManager!,
this, Redirector, appButton.AppButtonSpecs, null,
this, Redirector, fileAppButton.AppButtonSpecs, null,
[_viewButtonSpecDocker],
[_ribbon.StateCommon],
[PaletteMetricInt.None],
Expand All @@ -235,11 +230,12 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Must unhook from the palette paint event
if (_palette != null)
if (_palette != null!)
{
_palette.PalettePaint -= OnPaletteNeedPaint;
_palette.BasePaletteChanged -= OnBaseChanged;
_palette.BaseRendererChanged -= OnBaseChanged;
_palette = null!;
}

if (_buttonManager != null!)
Expand Down Expand Up @@ -334,7 +330,7 @@ public override bool DoesCurrentMouseDownEndAllTracking(Message m, Point pt)
if (_appButtonBottom.Visible)
{
// If mouse is over the top half of the button (which is in the non-client area of
// the owner ribbon) then we do not want to end all tracking from this method. Otherwise
// the owner ribbon) then we do not want to end all tracking from this method. Otherwise,
// if the mouse is inside the bottom half of the button then we do end tracking!
if (RectangleToClient(_rectAppButtonTopHalf).Contains(pt))
{
Expand Down Expand Up @@ -489,7 +485,7 @@ private void SetPalette(PaletteBase palette)
if (palette != _palette)
{
// Unhook from current palette events
if (_palette != null)
if (_palette != null!)
{
_palette.PalettePaint -= OnPaletteNeedPaint;
_palette.BasePaletteChanged -= OnBaseChanged;
Expand All @@ -500,13 +496,13 @@ private void SetPalette(PaletteBase palette)
_palette = palette;

// Update redirector to use palette as source for obtaining values
if (Redirector != null)
if (Redirector != null!)
{
Redirector.Target = _palette;
}

// Hook to new palette events
if (_palette != null)
if (_palette != null!)
{
// Get the renderer associated with the palette
Renderer = _palette.GetRenderer();
Expand All @@ -519,7 +515,7 @@ private void SetPalette(PaletteBase palette)

private void OnBaseChanged(object sender, EventArgs e) =>
// Change in base renderer or base palette require we fetch the latest renderer
Renderer = _palette?.GetRenderer();
Renderer = _palette.GetRenderer();

private void OnButtonSpecPaint(object sender, NeedLayoutEventArgs e) => OnNeedPaint(sender, new NeedLayoutEventArgs(false));

Expand Down
Loading

0 comments on commit 8bf795a

Please sign in to comment.