private void DrawBrowserTopbar()
        {
            GUILayout.Space(2);
            using (new SA_GuiBeginHorizontal()) {
                var width   = m_backLink.CalcSize().x + 5f;
                var clicked = m_backLink.Draw(GUILayout.Width(width));
                if (clicked)
                {
                    m_history.RemoveAt(m_history.Count - 1);
                }
                GUILayout.FlexibleSpace();
                using (new SA_GuiBeginVertical()) {
                    GUILayout.Space(-1);
                    var currentSelectedButton = m_pluginsToolbar.Buttons[m_pluginsToolbar.SelectionIndex];
                    width = currentSelectedButton.CalcSize().x + TOOLBAR_BUTTONS_SPACE;

                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.Space();
                        currentSelectedButton.Draw(GUILayout.Width(width), GUILayout.Height(TOOLBAR_BUTTONS_HEIGHT));
                        EditorGUILayout.Space();
                    }
                    EditorGUILayout.EndHorizontal();
                }
            }
            GUILayout.Space(5);
        }
예제 #2
0
        public bool OnGUI()
        {
            GUILayout.Space(5);
            using (new SA_GuiBeginHorizontal()) {
                GUILayout.Space(10);

                float headerWidth = m_header.CalcSize().x;
                bool  click       = m_header.Draw(GUILayout.Width(headerWidth));
                GUILayout.FlexibleSpace();
                bool labelClick = m_stateLabel.Draw(GUILayout.Width(40));
                if (click || labelClick)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
        protected override void OnLayoutGUI() {

            var selectedService = m_servicesTab.SelectedService;
            if(selectedService == null) {
                base.OnLayoutGUI();
                return;
            }

            DrawTopbar(() => {
                bool backClick =  m_baclLink.Draw();
                if(backClick) {
                    selectedService.UnSelect();
                }

            });
            selectedService.DrawHeaderUI();
            DrawScrollView(() => {
                selectedService.DrawServiceUI();
            });

        }
예제 #4
0
        protected override void OnAfterHeaderGUI()
        {
            var capability = m_getCapability();

            if (capability.Enabled)
            {
                m_stateLabel.SetContent(m_on);
                m_stateLabel.SetColor(SA_PluginSettingsWindowStyles.SelectedElementColor);
            }
            else
            {
                m_stateLabel.SetContent(m_off);
                m_stateLabel.SetColor(m_normalColor);
            }

            GUILayout.FlexibleSpace();
            bool click = m_stateLabel.Draw(GUILayout.Width(40));

            if (click)
            {
                capability.Enabled = !capability.Enabled;
            }
        }