示例#1
0
        static void DoHeader(
            WorkspaceInfo workspaceInfo,
            WorkspaceWindow workspaceWindow,
            IMergeViewLauncher mergeViewLauncher,
            IGluonViewSwitcher gluonSwitcher,
            bool isGluonMode,
            IIncomingChangesNotificationPanel incomingChangesNotificationPanel)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            GUILayout.Label(
                workspaceWindow.HeaderTitle,
                UnityStyles.PlasticWindow.HeaderTitleLabel);

            GUILayout.FlexibleSpace();

            DrawIncomingChangesNotificationPanel.ForMode(
                workspaceInfo, workspaceWindow,
                mergeViewLauncher, gluonSwitcher, isGluonMode,
                incomingChangesNotificationPanel.IsVisible,
                incomingChangesNotificationPanel.Data);

            //TODO: Codice - beta: hide the switcher until the update dialog is implemented
            //DrawGuiModeSwitcher.ForMode(
            //    isGluonMode, plasticClient, changesTreeView, editorWindow);

            EditorGUILayout.EndHorizontal();
        }
示例#2
0
        internal static void For(
            WorkspaceInfo workspaceInfo,
            WorkspaceWindow workspaceWindow,
            IMergeViewLauncher mergeViewLauncher,
            IGluonViewSwitcher gluonSwitcher,
            bool isGluonMode,
            IIncomingChangesNotificationPanel notificationPanel)
        {
            var barStyle = new GUIStyle();

            var barTexture = GetBarTexture();

            barTexture.SetPixel(0, 0, UnityStyles.Colors.BackgroundBar);
            barTexture.Apply();

            barStyle.normal.background = barTexture;

            EditorGUILayout.BeginVertical(barStyle, GUILayout.Height(mBarHeight));
            GUILayout.FlexibleSpace();

            EditorGUILayout.BeginHorizontal();

            if (notificationPanel.IsVisible)
            {
                DrawIncomingChangesNotificationPanel.For(
                    workspaceInfo,
                    workspaceWindow,
                    mergeViewLauncher,
                    gluonSwitcher,
                    isGluonMode,
                    notificationPanel.IsVisible,
                    notificationPanel.Data);
            }

            GUILayout.FlexibleSpace();

            DrawStatusBarIcon();
            DrawStatusBarLabel(workspaceWindow.WorkspaceStatus);

            EditorGUILayout.EndHorizontal();

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();
        }
        internal static void ForMode(
            WorkspaceInfo workspaceInfo,
            bool isGluonMode,
            bool isIncomingChangesVisible,
            bool isVisible,
            NotificationPanelData notificationPanelData)
        {
            if (!isVisible)
            {
                return;
            }

            if (isIncomingChangesVisible)
            {
                return;
            }

            if (isGluonMode)
            {
                return;
            }

            GUIContent labelContent = new GUIContent(
                notificationPanelData.InfoText, notificationPanelData.TooltipText);
            GUIContent buttonContent = new GUIContent(
                notificationPanelData.ActionText, notificationPanelData.TooltipText);

            float panelWidth = DrawIncomingChangesNotificationPanel.GetPanelWidth(
                labelContent, buttonContent,
                UnityStyles.Notification.Label, EditorStyles.miniButton);

            EditorGUILayout.BeginHorizontal(
                UnityStyles.Notification.GreenNotification,
                GUILayout.Width(panelWidth));

            GUILayout.Label(labelContent, UnityStyles.Notification.Label);

            DoActionButton(workspaceInfo, buttonContent, EditorStyles.miniButton);

            EditorGUILayout.EndHorizontal();
        }