コード例 #1
0
ファイル: TabView.cs プロジェクト: NotAdvisable/Puppeteer
        public void AddTab(PuppeteerView _puppeteerView)
        {
            _puppeteerView.AddToClassList("puppeteerTab");
            _puppeteerView.AddToClassList("topRounded");

            TextElement textElement = new TextElement
            {
                name        = "text",
                text        = _puppeteerView.GetLabel(),
                pickingMode = PickingMode.Ignore,
            };

            textElement.AddToClassList("puppeteerTabText");

            _puppeteerView.Add(textElement);
            _puppeteerView.OnMouseDown      += SwitchSelected;
            _puppeteerView.OnListItemDeleted = TabListItemDeleted;

            _puppeteerView.RegisterTabViewCallbacks(this);

            _puppeteerView.UpdateEntryName += _newTabName => textElement.text = _newTabName;

            Add(_puppeteerView);
            m_Tabs.Add(_puppeteerView);
        }
コード例 #2
0
ファイル: TabView.cs プロジェクト: NotAdvisable/Puppeteer
        private void SwitchSelected(PuppeteerView _selected)
        {
            if (_selected == null || _selected == m_SelectedTab)
            {
                return;
            }

            if (m_SelectedTab != null)
            {
                m_SelectedTab.CloseView();
                m_SelectedTab.RemoveFromClassList("tabSelected");
            }

            m_SelectedTab = _selected;
            OnTabListItemSelected?.Invoke(_selected != null ? _selected.GetType().AssemblyQualifiedName : string.Empty);
            m_SelectedTab.AddToClassList("tabSelected");
            m_SelectedTab.OpenView(m_ConfiguratorWindow.GetConfiguratorStates());
        }