Esempio n. 1
0
        private static void DrawSettingsSearchSectionHeader(SettingsSearchSection section, string caption)
        {
            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Space(10);

                GUILayout.Label(caption, UIHelpers.richLabel, GUILayout.Width(100));

                GUILayout.FlexibleSpace();
                using (new GUILayout.VerticalScope())
                {
                    //GUILayout.Space(-3);
                    using (new GUILayout.HorizontalScope())
                    {
                        if (UIHelpers.IconButton(CSIcons.SelectAll, "Select all"))
                        {
                            SettingsSectionGroupSwitch(section, true);
                        }

                        if (UIHelpers.IconButton(CSIcons.SelectNone, "Clear selection"))
                        {
                            SettingsSectionGroupSwitch(section, false);
                        }
                    }
                }
                GUILayout.Space(10);
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Space(10);
                UIHelpers.Separator();
                GUILayout.Space(10);
            }
        }
Esempio n. 2
0
        private static bool DrawSettingsFoldoutSectionHeader(SettingsSearchSection section, ref bool foldout)
        {
            GUILayout.Space(5);
            using (new GUILayout.HorizontalScope())
            {
                foldout = EditorGUI.Foldout(EditorGUILayout.GetControlRect(true, GUILayout.Width(100)), foldout, ObjectNames.NicifyVariableName(section.ToString()), true, UIHelpers.richFoldout);
                GUILayout.FlexibleSpace();

                if (UIHelpers.IconButton(CSIcons.SelectAll, "Select all"))
                {
                    SettingsSectionGroupSwitch(section, true);
                }

                if (UIHelpers.IconButton(CSIcons.SelectNone, "Clear selection"))
                {
                    SettingsSectionGroupSwitch(section, false);
                }

                GUILayout.Space(5);
            }

            /*if (foldout)
             * {
             *      UIHelpers.Separator();
             * }*/

            return(foldout);
        }
Esempio n. 3
0
        private static void SettingsSectionGroupSwitch(SettingsSearchSection section, bool enable)
        {
            switch (section)
            {
            case SettingsSearchSection.Common:
                MaintainerSettings.Issues.SwitchCommon(enable);
                break;

            case SettingsSearchSection.Neatness:
                MaintainerSettings.Issues.SwitchNeatness(enable);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Esempio n. 4
0
        private bool DrawSettingsSearchSectionHeader(SettingsSearchSection section, ref bool foldout)
        {
            GUILayout.Space(5);
            using (UIHelpers.Horizontal())
            {
                foldout = EditorGUI.Foldout(EditorGUILayout.GetControlRect(), foldout, "<b>" + ObjectNames.NicifyVariableName(section.ToString()) + "</b>", true, UIHelpers.richFoldout);
                if (GUILayout.Button("V", UIHelpers.compactButton, GUILayout.Width(20)))
                {
                    typeof(IssuesFinderSettings).InvokeMember("Switch" + section, BindingFlags.InvokeMethod | BindingFlags.NonPublic, null, MaintainerSettings.Issues, new[] { (object)true });
                }
                if (GUILayout.Button("X", UIHelpers.compactButton, GUILayout.Width(20)))
                {
                    typeof(IssuesFinderSettings).InvokeMember("Switch" + section, BindingFlags.InvokeMethod | BindingFlags.NonPublic, null, MaintainerSettings.Issues, new[] { (object)false });
                }
                GUILayout.Space(5);
            }
            UIHelpers.Separator();

            return(foldout);
        }
Esempio n. 5
0
        private bool DrawSettingsSearchSectionHeader(SettingsSearchSection section, ref bool foldout)
        {
            GUILayout.Space(5);
            using (layout.Horizontal())
            {
                foldout = EditorGUI.Foldout(EditorGUILayout.GetControlRect(true, GUILayout.Width(145)), foldout, ObjectNames.NicifyVariableName(section.ToString()), true, UIHelpers.richFoldout);

                if (UIHelpers.IconButton(CSIcons.SelectAll))
                {
                    typeof(IssuesFinderSettings).InvokeMember("Switch" + section, BindingFlags.InvokeMethod | BindingFlags.NonPublic, null, MaintainerSettings.Issues, new[] { (object)true });
                }

                if (UIHelpers.IconButton(CSIcons.SelectNone))
                {
                    typeof(IssuesFinderSettings).InvokeMember("Switch" + section, BindingFlags.InvokeMethod | BindingFlags.NonPublic, null, MaintainerSettings.Issues, new[] { (object)false });
                }
            }
            UIHelpers.Separator();

            return(foldout);
        }