Skip to content

Commit c0bca34

Browse files
committed
331-V100-revert-pr-2501
- manually revert pr 2501
1 parent 239f06f commit c0bca34

File tree

6 files changed

+30
-316
lines changed

6 files changed

+30
-316
lines changed

Documents/Changelog/Changelog.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
====
44

5-
## 2025-11-11 - Build 2511 (V10 RTM) - November 2025
5+
## 2025-11-11 - Build 2511 (V100 RTM) - November 2025
66

77
* Resolved [#2593](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2593), Scrolling over `KryptonForm` results in OverflowException in `KryptonSystemMenuListener`
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
1211
* 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.
1312
* Resolved [#2548](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2548), Fixed color assignment for `GroupSeparatorLight`, `QATButtonDarkColor` and `QATButtonLightColor` in `PopulateFromBase`.
1413
* 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: 8 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ public RibbonButtonSpecAnyCollection(KryptonRibbon owner)
8383
// Properties
8484
private bool _minimizedMode;
8585
private bool _showMinimizeButton;
86-
private bool _showTabs;
8786
private string _selectedContext;
8887
private Size _hideRibbonSize;
8988
private QATLocation _qatLocation;
@@ -582,11 +581,10 @@ public KryptonRibbonTab? SelectedTab
582581

583582
set
584583
{
585-
// Allow setting to null for "no tab" mode, or validate the tab if not null
586-
if ((value == null) || // Allow null for "no tab" mode
587-
((value.Visible || InDesignHelperMode) && // Tab must be visible
584+
if ((value != null) && // Cannot remove selection
585+
(value.Visible || InDesignHelperMode) && // Tab must be visible
588586
RibbonTabs.Contains(value) && // Tab must be in our collection
589-
TabIsContextValid(value))) // Context tab must be in current context selection
587+
TabIsContextValid(value)) // Context tab must be in current context selection
590588
{
591589
if (_selectedTab != value)
592590
{
@@ -901,32 +899,6 @@ public QATLocation QATLocation
901899
/// </summary>
902900
public void ResetQATUserChange() => QATUserChange = true;
903901

904-
/// <summary>
905-
/// Gets and sets a value indicating if ribbon tabs are visible.
906-
/// </summary>
907-
[Category(@"Values")]
908-
[Description(@"Determines if ribbon tabs are visible.")]
909-
[DefaultValue(true)]
910-
public bool ShowTabs
911-
{
912-
get => _showTabs;
913-
914-
set
915-
{
916-
if (_showTabs != value)
917-
{
918-
_showTabs = value;
919-
UpdateTabVisibility();
920-
PerformNeedPaint(true);
921-
}
922-
}
923-
}
924-
925-
/// <summary>
926-
/// Resets the ShowTabs property to its default value.
927-
/// </summary>
928-
public void ResetShowTabs() => ShowTabs = true;
929-
930902
/// <summary>
931903
/// Gets and sets a value indicating if a minimize/expand button appears on the ribbon tab ara.
932904
/// </summary>
@@ -1551,9 +1523,8 @@ protected override void OnGotFocus(EventArgs e)
15511523
{
15521524
newFocus = TabsArea?.LayoutTabs.GetViewForRibbonTab(SelectedTab);
15531525
}
1554-
else if (!RealMinimizedMode && ShowTabs)
1526+
else if (!RealMinimizedMode)
15551527
{
1556-
// Only try to focus first tab if tabs are visible
15571528
newFocus = TabsArea?.LayoutTabs.GetViewForFirstRibbonTab();
15581529
}
15591530

@@ -1827,46 +1798,6 @@ internal void UpdateBackStyle()
18271798
}
18281799
}
18291800

1830-
/// <summary>
1831-
/// Updates the visibility of the tabs area and caption area based on the ShowTabs property.
1832-
/// </summary>
1833-
private void UpdateTabVisibility()
1834-
{
1835-
if (_ribbonDocker == null || TabsArea == null || CaptionArea == null)
1836-
{
1837-
return;
1838-
}
1839-
1840-
if (_showTabs)
1841-
{
1842-
// Add tabs area if not already present
1843-
if (!_ribbonDocker.Contains(TabsArea))
1844-
{
1845-
_ribbonDocker.Add(TabsArea, ViewDockStyle.Top);
1846-
}
1847-
1848-
// Add caption area if not already present
1849-
if (!_ribbonDocker.Contains(CaptionArea))
1850-
{
1851-
_ribbonDocker.Add(CaptionArea, ViewDockStyle.Top);
1852-
}
1853-
}
1854-
else
1855-
{
1856-
// Remove tabs area if present
1857-
if (_ribbonDocker.Contains(TabsArea))
1858-
{
1859-
_ribbonDocker.Remove(TabsArea);
1860-
}
1861-
1862-
// Remove caption area if present
1863-
if (_ribbonDocker.Contains(CaptionArea))
1864-
{
1865-
_ribbonDocker.Remove(CaptionArea);
1866-
}
1867-
}
1868-
}
1869-
18701801
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
18711802
internal ButtonStyle ScrollerStyle
18721803
{
@@ -2601,7 +2532,6 @@ private void AssignDefaultFields()
26012532
MinimizedMode = false;
26022533
ScrollerStyle = ButtonStyle.Standalone;
26032534
ShowMinimizeButton = true;
2604-
ShowTabs = true;
26052535
QATLocation = QATLocation.Above;
26062536
QATUserChange = true;
26072537
LostFocusLosesKeyboard = true;
@@ -2726,13 +2656,8 @@ private void CreateViewManager()
27262656
_ribbonDocker.Add(GroupsArea, ViewDockStyle.Fill);
27272657
_ribbonDocker.Add(_minimizeBar, ViewDockStyle.Bottom);
27282658
_ribbonDocker.Add(_qatBelowRibbon, ViewDockStyle.Bottom);
2729-
2730-
// Add tabs area and caption area only if tabs are visible
2731-
if (_showTabs)
2732-
{
2733-
_ribbonDocker.Add(TabsArea, ViewDockStyle.Top);
2734-
_ribbonDocker.Add(CaptionArea, ViewDockStyle.Top);
2735-
}
2659+
_ribbonDocker.Add(TabsArea, ViewDockStyle.Top);
2660+
_ribbonDocker.Add(CaptionArea, ViewDockStyle.Top);
27362661

27372662
// The root contains the top and fills out with the panel areas
27382663
_rootDocker.Add(MainPanel, ViewDockStyle.Fill);
@@ -2832,22 +2757,8 @@ private void ValidateSelectedTab()
28322757
{
28332758
KryptonRibbonTab? newSelection = null;
28342759

2835-
// If tabs are hidden (toolbar mode), don't auto-select any tab
2836-
if (!ShowTabs)
2837-
{
2838-
// In toolbar mode, we allow SelectedTab to remain null
2839-
// Only validate if there's a selected tab that's no longer valid
2840-
if (SelectedTab != null &&
2841-
(!SelectedTab.Visible || !RibbonTabs.Contains(SelectedTab) || !TabIsContextValid(SelectedTab)))
2842-
{
2843-
newSelection = null; // Clear invalid selection
2844-
}
2845-
else
2846-
{
2847-
newSelection = SelectedTab; // Keep current selection (including null)
2848-
}
2849-
}
2850-
else if (!RealMinimizedMode)
2760+
// If not minimized...
2761+
if (!RealMinimizedMode)
28512762
{
28522763
if ((SelectedTab == null) || // If there is no selection...
28532764
(!SelectedTab.Visible && !InDesignHelperMode) || // Or the selection is no longer visible

0 commit comments

Comments
 (0)