Skip to content

Commit d9b79f6

Browse files
authored
Revert "* Temporarily disables #331 (#2587)"
This reverts commit 6b898fe.
1 parent 4e7d9f6 commit d9b79f6

File tree

4 files changed

+37
-53
lines changed

4 files changed

+37
-53
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,3 +863,4 @@ jobs:
863863
Invoke-RestMethod -Uri $env:DISCORD_WEBHOOK_NIGHTLY -Method Post -Body $payload -ContentType "application/json"
864864
env:
865865
DISCORD_WEBHOOK_NIGHTLY: ${{ secrets.DISCORD_WEBHOOK_NIGHTLY }}
866+

Documents/Changelog/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Resolved [#2542](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2542), `KryptonForm` cannot be resized by dragging upper corners.
99
* Implemented [#2575](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2575), **[Breaking Change]** `CommonHelper.DesignMode()` behaviour changed, see issue for details.
1010
* Implemented [#2559](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2559), Allow `release.yml` to automatically push packages
11+
* Implemented [#331](https://github.com/Krypton-Suite/Standard-Toolkit/issues/331), Make the "No Tab in a ribbon Solution" An Actual Designer Tool
1112
* Resolved [#2331](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2331), Correction of edges, 3D effect and color adjustment in `KryptonRibbon` in Office 2010 themes.
1213
* Resolved [#2548](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2548), Fixed color assignment for `GroupSeparatorLight`, `QATButtonDarkColor` and `QATButtonLightColor` in `PopulateFromBase`.
1314
* Resolved [#2461](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2461), (feat) Add `KryptonCalcInput` edit+dropdown control.

Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbon.cs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ public RibbonButtonSpecAnyCollection(KryptonRibbon owner)
8383
// Properties
8484
private bool _minimizedMode;
8585
private bool _showMinimizeButton;
86-
87-
// ToDo: Reinvestigate for #331 in the future, see https://github.com/Krypton-Suite/Standard-Toolkit/issues/331 & https://github.com/Krypton-Suite/Standard-Toolkit/issues/2584 for more information
88-
//private bool _showTabs;
89-
86+
private bool _showTabs;
9087
private string _selectedContext;
9188
private Size _hideRibbonSize;
9289
private QATLocation _qatLocation;
@@ -904,8 +901,7 @@ public QATLocation QATLocation
904901
/// </summary>
905902
public void ResetQATUserChange() => QATUserChange = true;
906903

907-
// ToDo: Reinvestigate for #331 in the future, see https://github.com/Krypton-Suite/Standard-Toolkit/issues/331 & https://github.com/Krypton-Suite/Standard-Toolkit/issues/2584 for more information
908-
/*/// <summary>
904+
/// <summary>
909905
/// Gets and sets a value indicating if ribbon tabs are visible.
910906
/// </summary>
911907
[Category(@"Values")]
@@ -929,7 +925,7 @@ public bool ShowTabs
929925
/// <summary>
930926
/// Resets the ShowTabs property to its default value.
931927
/// </summary>
932-
public void ResetShowTabs() => ShowTabs = true;*/
928+
public void ResetShowTabs() => ShowTabs = true;
933929

934930
/// <summary>
935931
/// Gets and sets a value indicating if a minimize/expand button appears on the ribbon tab ara.
@@ -1555,7 +1551,7 @@ protected override void OnGotFocus(EventArgs e)
15551551
{
15561552
newFocus = TabsArea?.LayoutTabs.GetViewForRibbonTab(SelectedTab);
15571553
}
1558-
else if (!RealMinimizedMode /*&& ShowTabs*/)
1554+
else if (!RealMinimizedMode && ShowTabs)
15591555
{
15601556
// Only try to focus first tab if tabs are visible
15611557
newFocus = TabsArea?.LayoutTabs.GetViewForFirstRibbonTab();
@@ -1831,8 +1827,7 @@ internal void UpdateBackStyle()
18311827
}
18321828
}
18331829

1834-
// ToDo: Reinvestigate for #331 in the future, see https://github.com/Krypton-Suite/Standard-Toolkit/issues/331 & https://github.com/Krypton-Suite/Standard-Toolkit/issues/2584 for more information
1835-
/*/// <summary>
1830+
/// <summary>
18361831
/// Updates the visibility of the tabs area and caption area based on the ShowTabs property.
18371832
/// </summary>
18381833
private void UpdateTabVisibility()
@@ -1870,7 +1865,7 @@ private void UpdateTabVisibility()
18701865
_ribbonDocker.Remove(CaptionArea);
18711866
}
18721867
}
1873-
}*/
1868+
}
18741869

18751870
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
18761871
internal ButtonStyle ScrollerStyle
@@ -2606,7 +2601,7 @@ private void AssignDefaultFields()
26062601
MinimizedMode = false;
26072602
ScrollerStyle = ButtonStyle.Standalone;
26082603
ShowMinimizeButton = true;
2609-
//ShowTabs = true;
2604+
ShowTabs = true;
26102605
QATLocation = QATLocation.Above;
26112606
QATUserChange = true;
26122607
LostFocusLosesKeyboard = true;
@@ -2731,14 +2726,13 @@ private void CreateViewManager()
27312726
_ribbonDocker.Add(GroupsArea, ViewDockStyle.Fill);
27322727
_ribbonDocker.Add(_minimizeBar, ViewDockStyle.Bottom);
27332728
_ribbonDocker.Add(_qatBelowRibbon, ViewDockStyle.Bottom);
2734-
2735-
// ToDo: Reinvestigate for #331 in the future, see https://github.com/Krypton-Suite/Standard-Toolkit/issues/331 & https://github.com/Krypton-Suite/Standard-Toolkit/issues/2584 for more information
2729+
27362730
// Add tabs area and caption area only if tabs are visible
2737-
/*if (_showTabs)
2731+
if (_showTabs)
27382732
{
27392733
_ribbonDocker.Add(TabsArea, ViewDockStyle.Top);
27402734
_ribbonDocker.Add(CaptionArea, ViewDockStyle.Top);
2741-
}*/
2735+
}
27422736

27432737
// The root contains the top and fills out with the panel areas
27442738
_rootDocker.Add(MainPanel, ViewDockStyle.Fill);
@@ -2839,7 +2833,7 @@ private void ValidateSelectedTab()
28392833
KryptonRibbonTab? newSelection = null;
28402834

28412835
// If tabs are hidden (toolbar mode), don't auto-select any tab
2842-
/*if (!ShowTabs)
2836+
if (!ShowTabs)
28432837
{
28442838
// In toolbar mode, we allow SelectedTab to remain null
28452839
// Only validate if there's a selected tab that's no longer valid
@@ -2853,7 +2847,7 @@ private void ValidateSelectedTab()
28532847
newSelection = SelectedTab; // Keep current selection (including null)
28542848
}
28552849
}
2856-
else*/ if (!RealMinimizedMode)
2850+
else if (!RealMinimizedMode)
28572851
{
28582852
if ((SelectedTab == null) || // If there is no selection...
28592853
(!SelectedTab.Visible && !InDesignHelperMode) || // Or the selection is no longer visible

Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonDesigner.cs

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@ internal class KryptonRibbonDesigner : ParentControlDesigner
2424
private DesignerVerb _clearTabsVerb;
2525
private DesignerVerb _noTabVerb;
2626
private DesignerVerb _setTabVerb;
27-
28-
// ToDo: Reinvestigate for #331 in the future, see https://github.com/Krypton-Suite/Standard-Toolkit/issues/331 & https://github.com/Krypton-Suite/Standard-Toolkit/issues/2584 for more information
29-
// Disabled ShowTabs feature temporarily due to rendering issues with KryptonRibbonContext
30-
// private DesignerVerb _hideTabsVerb;
31-
// private DesignerVerb _showTabsVerb;
32-
27+
private DesignerVerb _hideTabsVerb;
28+
private DesignerVerb _showTabsVerb;
3329
private bool _lastHitTest;
3430

3531
#endregion
@@ -151,12 +147,9 @@ public override DesignerVerbCollection Verbs
151147
_clearTabsVerb = new DesignerVerb(@"Clear Tabs", OnClearTabs);
152148
_noTabVerb = new DesignerVerb(@"Clear Tab Selection", OnNoTab);
153149
_setTabVerb = new DesignerVerb(@"Select First Tab", OnSetTab);
154-
155-
// ToDo: Reinvestigate for #331 in the future, see https://github.com/Krypton-Suite/Standard-Toolkit/issues/331 & https://github.com/Krypton-Suite/Standard-Toolkit/issues/2584 for more information
156-
// Disabled ShowTabs feature temporarily due to rendering issues with KryptonRibbonContext
157-
// _hideTabsVerb = new DesignerVerb(@"Hide Tab Headers", OnHideTabs);
158-
// _showTabsVerb = new DesignerVerb(@"Show Tab Headers", OnShowTabs);
159-
_verbs.AddRange(new[] { _toggleHelpersVerb, _addTabVerb, _clearTabsVerb, _noTabVerb, _setTabVerb /*, _hideTabsVerb, _showTabsVerb*/ });
150+
_hideTabsVerb = new DesignerVerb(@"Hide Tab Headers", OnHideTabs);
151+
_showTabsVerb = new DesignerVerb(@"Show Tab Headers", OnShowTabs);
152+
_verbs.AddRange(new[] { _toggleHelpersVerb, _addTabVerb, _clearTabsVerb, _noTabVerb, _setTabVerb, _hideTabsVerb, _showTabsVerb });
160153
}
161154

162155
UpdateVerbStatus();
@@ -285,11 +278,9 @@ private void UpdateVerbStatus()
285278
_noTabVerb.Enabled = true;
286279
_setTabVerb.Enabled = false;
287280
}
288-
289-
// ToDo: Reinvestigate for #331 in the future, see https://github.com/Krypton-Suite/Standard-Toolkit/issues/331 & https://github.com/Krypton-Suite/Standard-Toolkit/issues/2584 for more information
290-
// Disabled ShowTabs feature temporarily due to rendering issues with KryptonRibbonContext
281+
291282
// Update the Hide Tabs / Show Tabs verbs based on current state
292-
/*if (_ribbon.ShowTabs)
283+
if (_ribbon.ShowTabs)
293284
{
294285
_hideTabsVerb.Enabled = true;
295286
_showTabsVerb.Enabled = false;
@@ -298,7 +289,7 @@ private void UpdateVerbStatus()
298289
{
299290
_hideTabsVerb.Enabled = false;
300291
_showTabsVerb.Enabled = true;
301-
}*/
292+
}
302293
}
303294
}
304295

@@ -464,15 +455,13 @@ private void OnSetTab(object? sender, EventArgs e)
464455
}
465456
}
466457

467-
// ToDo: Reinvestigate for #331 in the future, see https://github.com/Krypton-Suite/Standard-Toolkit/issues/331 & https://github.com/Krypton-Suite/Standard-Toolkit/issues/2584 for more information
468-
/*//Disabled ShowTabs feature temporarily due to rendering issues with KryptonRibbonContext
469-
/// <summary>
470-
/// Handles the "Hide Tabs" designer verb click.
471-
/// Hides the ribbon tabs to create a toolbar-like interface.
472-
/// </summary>
473-
/// <param name="sender">The source of the event.</param>
474-
/// <param name="e">An EventArgs that contains the event data.</param>
475-
private void OnHideTabs(object? sender, EventArgs e)
458+
/// <summary>
459+
/// Handles the "Hide Tabs" designer verb click.
460+
/// Hides the ribbon tabs to create a toolbar-like interface.
461+
/// </summary>
462+
/// <param name="sender">The source of the event.</param>
463+
/// <param name="e">An EventArgs that contains the event data.</param>
464+
private void OnHideTabs(object? sender, EventArgs e)
476465
{
477466
if (_ribbon is null)
478467
{
@@ -503,14 +492,13 @@ private void OnHideTabs(object? sender, EventArgs e)
503492
}
504493
}
505494

506-
// Disabled ShowTabs feature temporarily due to rendering issues with KryptonRibbonContext
507-
/// <summary>
508-
/// Handles the "Show Tabs" designer verb click.
509-
/// Shows the ribbon tabs to restore normal ribbon interface.
510-
/// </summary>
511-
/// <param name="sender">The source of the event.</param>
512-
/// <param name="e">An EventArgs that contains the event data.</param>
513-
private void OnShowTabs(object? sender, EventArgs e)
495+
/// <summary>
496+
/// Handles the "Show Tabs" designer verb click.
497+
/// Shows the ribbon tabs to restore normal ribbon interface.
498+
/// </summary>
499+
/// <param name="sender">The source of the event.</param>
500+
/// <param name="e">An EventArgs that contains the event data.</param>
501+
private void OnShowTabs(object? sender, EventArgs e)
514502
{
515503
if (_ribbon is null)
516504
{
@@ -539,7 +527,7 @@ private void OnShowTabs(object? sender, EventArgs e)
539527

540528
UpdateVerbStatus();
541529
}
542-
}*/
530+
}
543531

544532
private void OnRibbonMouseUp(object? sender, MouseEventArgs e)
545533
{

0 commit comments

Comments
 (0)