static void BranchesListViewItemGUI( ViewQueryResult queryResult, float rowHeight, BranchListViewItem item, RowGUIArgs args, bool isBoldText, Action avatarLoadedAction) { for (int visibleColumnIdx = 0; visibleColumnIdx < args.GetNumVisibleColumns(); visibleColumnIdx++) { Rect cellRect = args.GetCellRect(visibleColumnIdx); if (visibleColumnIdx == 0) { cellRect.x += UnityConstants.FIRST_COLUMN_WITHOUT_ICON_INDENT; cellRect.width -= UnityConstants.FIRST_COLUMN_WITHOUT_ICON_INDENT; } BranchesListColumn column = (BranchesListColumn)args.GetColumn(visibleColumnIdx); BranchesListViewItemCellGUI( cellRect, rowHeight, queryResult, item, column, avatarLoadedAction, args.selected, args.focused, isBoldText); } }
static void BranchesListViewItemCellGUI( Rect rect, float rowHeight, ViewQueryResult queryResult, BranchListViewItem item, BranchesListColumn column, Action avatarLoadedAction, bool isSelected, bool isFocused, bool isBoldText) { string columnText = RepObjectInfoView.GetColumnText( queryResult.GetRepositorySpec(item.ObjectInfo), queryResult.GetRepObjectInfo(item.ObjectInfo), BranchesListHeaderState.GetColumnName(column)); if (column == BranchesListColumn.CreatedBy) { DrawTreeViewItem.ForItemCell( rect, rowHeight, -1, GetAvatar.ForEmail(columnText, avatarLoadedAction), null, columnText, isSelected, isFocused, isBoldText, false); return; } if (column == BranchesListColumn.Branch || column == BranchesListColumn.Repository || column == BranchesListColumn.Guid) { DrawTreeViewItem.ForSecondaryLabel( rect, columnText, isSelected, isFocused, isBoldText); return; } DrawTreeViewItem.ForLabel( rect, columnText, isSelected, isFocused, isBoldText); }
internal static string GetColumnName(BranchesListColumn column) { switch (column) { case BranchesListColumn.Name: return(PlasticLocalization.GetString(PlasticLocalization.Name.NameColumn)); case BranchesListColumn.Repository: return(PlasticLocalization.GetString(PlasticLocalization.Name.RepositoryColumn)); case BranchesListColumn.CreatedBy: return(PlasticLocalization.GetString(PlasticLocalization.Name.CreatedByColumn)); case BranchesListColumn.CreationDate: return(PlasticLocalization.GetString(PlasticLocalization.Name.CreationDateColumn)); case BranchesListColumn.Comment: return(PlasticLocalization.GetString(PlasticLocalization.Name.CommentColumn)); default: return(null); } }