<commit_before>﻿// Copyright (c) 2007-2017 ppy Pty Ltd <<EMAIL>>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using osu.Framework.Configuration;
using osu.Framework.Extensions;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using OpenTK;

namespace osu.Framework.Graphics.UserInterface
{
    /// <summary>
    /// A single-row control to display a list of selectable tabs along with an optional right-aligned dropdown
    /// containing overflow items (tabs which cannot be displayed in the allocated width). Includes
    /// support for pinning items, causing them to be displayed before all other items at the
    /// start of the list.
    /// </summary>
    /// <typeparam name="T">The type of item to be represented by tabs.</typeparam>
    public abstract class TabControl<T> : Container, IHasCurrentValue<T>
    {
        private readonly Bindable<T> current = new Bindable<T>();

        /// <summary>
        /// The currently selected item.
        /// </summary>
        public Bindable<T> Current
        {
            get { return current; }
            set
            {
                current.BindTo(value);
                if (value?.Disabled ?? true)
                    Alpha = 0.3f;
            }
        }

        /// <summary>
        /// A list of items currently in the tab control in the other they are dispalyed.
        /// </summary>
        public IEnumerable<T> Items => TabContainer.Children.Select(tab => tab.Value);

        /// <summary>
        /// When true, tabs selected from the overflow dropdown will be moved to the front of the list (after pinned items).
        /// </summary>
        public bool AutoSort { set; get; }

        /// <summary>
        /// We need a special case here to allow for the dropdown "overflowing" our own bounds.
        /// </summary>
        protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || (Dropdown?.Contains(screenSpacePos) ?? false);<commit_msg>Remove disabled handling from framework for now.<commit_after>﻿// Copyright (c) 2007-2017 ppy Pty Ltd <<EMAIL>>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using osu.Framework.Configuration;
using osu.Framework.Extensions;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using OpenTK;

namespace osu.Framework.Graphics.UserInterface
{
    /// <summary>
    /// A single-row control to display a list of selectable tabs along with an optional right-aligned dropdown
    /// containing overflow items (tabs which cannot be displayed in the allocated width). Includes
    /// support for pinning items, causing them to be displayed before all other items at the
    /// start of the list.
    /// </summary>
    /// <typeparam name="T">The type of item to be represented by tabs.</typeparam>
    public abstract class TabControl<T> : Container, IHasCurrentValue<T>
    {
        private readonly Bindable<T> current = new Bindable<T>();

        /// <summary>
        /// The currently selected item.
        /// </summary>
        public Bindable<T> Current
        {
            get { return current; }
            set { current.BindTo(value); }
        }

        /// <summary>
        /// A list of items currently in the tab control in the other they are dispalyed.
        /// </summary>
        public IEnumerable<T> Items => TabContainer.Children.Select(tab => tab.Value);

        /// <summary>
        /// When true, tabs selected from the overflow dropdown will be moved to the front of the list (after pinned items).
        /// </summary>
        public bool AutoSort { set; get; }

        /// <summary>
        /// We need a special case here to allow for the dropdown "overflowing" our own bounds.
        /// </summary>
        protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || (Dropdown?.Contains(screenSpacePos) ?? false);
{'fraction_non_alphanumeric': 0.1071932299012694, 'fraction_numerical': 0.004701457451810061, 'mean_word_length': 2.5078318219291016, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 49, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5520617', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1087, 'n_words': 400}