Exemplo n.º 1
0
        static void HistoryListViewItemCellGUI(
            Rect rect,
            float rowHeight,
            string wkPath,
            RepositorySpec repSpec,
            HistoryListViewItem item,
            HistoryListColumn column,
            Action avatarLoadedAction,
            bool isSelected,
            bool isFocused,
            bool isBoldText)
        {
            string columnText = HistoryInfoView.GetColumnText(
                wkPath, repSpec, item.Revision,
                HistoryListHeaderState.GetColumnName(column));

            if (column == HistoryListColumn.Changeset)
            {
                DrawTreeViewItem.ForItemCell(
                    rect,
                    rowHeight,
                    0,
                    GetRevisionIcon(item.Revision),
                    null,
                    columnText,
                    isSelected,
                    isFocused,
                    isBoldText,
                    false);

                return;
            }

            if (column == HistoryListColumn.CreatedBy)
            {
                DrawTreeViewItem.ForItemCell(
                    rect,
                    rowHeight,
                    -1,
                    GetAvatar.ForEmail(columnText, avatarLoadedAction),
                    null,
                    columnText,
                    isSelected,
                    isFocused,
                    isBoldText,
                    false);
                return;
            }

            if (column == HistoryListColumn.Branch)
            {
                DrawTreeViewItem.ForSecondaryLabel(
                    rect, columnText, isSelected, isFocused, isBoldText);
                return;
            }

            DrawTreeViewItem.ForLabel(
                rect, columnText, isSelected, isFocused, isBoldText);
        }
Exemplo n.º 2
0
        void BuildComponents(
            WorkspaceInfo wkInfo,
            RepositorySpec repSpec)
        {
            mSearchField = new SearchField();
            mSearchField.downOrUpArrowKeyPressed += SearchField_OnDownOrUpArrowKeyPressed;

            HistoryListHeaderState headerState = HistoryListHeaderState.Default;

            TreeHeaderSettings.Load(headerState,
                                    UnityConstants.HISTORY_TABLE_SETTINGS_NAME,
                                    (int)HistoryListColumn.CreationDate,
                                    false);

            mHistoryListView = new HistoryListView(
                wkInfo.ClientPath,
                repSpec,
                headerState,
                new HistoryListViewMenu(this, this),
                HistoryListHeaderState.GetColumnNames());

            mHistoryListView.Reload();
        }
Exemplo n.º 3
0
        internal HistoryListView(
            string wkPath,
            RepositorySpec repSpec,
            HistoryListHeaderState headerState,
            HistoryListViewMenu menu,
            List <string> columnNames) :
            base(new TreeViewState())
        {
            mWkPath      = wkPath;
            mRepSpec     = repSpec;
            mMenu        = menu;
            mColumnNames = columnNames;

            multiColumnHeader                 = new MultiColumnHeader(headerState);
            multiColumnHeader.canSort         = true;
            multiColumnHeader.sortingChanged += SortingChanged;

            rowHeight = UnityConstants.TREEVIEW_ROW_HEIGHT;
            showAlternatingRowBackgrounds = true;

            mCooldownFilterAction = new CooldownWindowDelayer(
                DelayedSearchChanged, UnityConstants.SEARCH_DELAYED_INPUT_ACTION_INTERVAL);
        }