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

Change TabItem.IsRemovable default to true #2425

Merged
merged 2 commits into from
May 21, 2019
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: 0 additions & 2 deletions osu.Framework/Graphics/UserInterface/BasicTabControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public class BasicTabItem : TabItem<T>
{
private readonly SpriteText text;

public override bool IsRemovable => true;

public BasicTabItem(T value)
: base(value)
{
Expand Down
3 changes: 2 additions & 1 deletion osu.Framework/Graphics/UserInterface/TabControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ protected virtual void AddTabItem(TabItem<T> tab, bool addToDropdown = true)
/// <param name="removeFromDropdown">Whether the tab should be removed from the Dropdown if supported by the <see cref="TabControl{T}"/> implementation.</param>
protected virtual void RemoveTabItem(TabItem<T> tab, bool removeFromDropdown = true)
{
if (!tab.IsRemovable) return;
if (!tab.IsRemovable)
throw new InvalidOperationException($"Cannot remove non-removable tab {tab}. Ensure {nameof(TabItem.IsRemovable)} is set appropriately.");

if (tab == SelectedTab)
SelectedTab = null;
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Graphics/UserInterface/TabItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public abstract class TabItem<T> : TabItem

public override bool IsPresent => base.IsPresent && Y == 0;

public override bool IsRemovable => false;
public override bool IsRemovable => true;

/// <summary>
/// When true, this tab can be switched to using PlatformAction.DocumentPrevious and PlatformAction.DocumentNext. Otherwise, it will be skipped.
Expand Down