static void IncomingChangeTreeViewItemCellGUI( string wkPath, Rect rect, float rowHeight, UnityIncomingChangesTree incomingChangesTree, IncomingChangesTreeView treeView, ChangeTreeViewItem item, Action onCheckedNodeChanged, IncomingChangesTreeColumn column, bool isSelected, bool isFocused, bool isCurrentConflict, bool isSolvedConflict) { IncomingChangeInfo incomingChange = item.ChangeInfo; string label = incomingChange.GetColumnText( IncomingChangesTreeHeaderState.GetHeaderContent(column)); if (column == IncomingChangesTreeColumn.Path) { if (incomingChangesTree.HasMeta(item.ChangeInfo)) { label = string.Concat(label, UnityConstants.TREEVIEW_META_LABEL); } Texture icon = GetIcon(wkPath, incomingChange); GetOverlayIcon.Data overlayIconData = GetOverlayData( incomingChange, isSolvedConflict); bool wasChecked = incomingChange.IsChecked(); bool isChecked = DrawTreeViewItem.ForCheckableItemCell( rect, rowHeight, item.depth, icon, overlayIconData, label, isSelected, isFocused, isCurrentConflict, wasChecked); incomingChange.UpdateCheckedState(isChecked); if (wasChecked != isChecked) { UpdateCheckStateForSelection(treeView, item); onCheckedNodeChanged(); } return; } if (column == IncomingChangesTreeColumn.Size) { DefaultGUI.LabelRightAligned(rect, label, isSelected, isFocused); return; } DefaultGUI.Label(rect, label, isSelected, isFocused); }
static void IncomingChangeTreeViewItemCellGUI( string wkPath, Rect rect, float rowHeight, UnityIncomingChangesTree incomingChangesTree, IncomingChangesTreeView treeView, ChangeTreeViewItem item, IncomingChangesTreeColumn column, bool isSelected, bool isFocused, bool isCurrentConflict, bool isSolvedConflict) { IncomingChangeInfo incomingChange = item.ChangeInfo; string label = incomingChange.GetColumnText( IncomingChangesTreeHeaderState.GetColumnName(column)); if (column == IncomingChangesTreeColumn.Path) { if (incomingChangesTree.HasMeta(item.ChangeInfo)) { label = string.Concat(label, UnityConstants.TREEVIEW_META_LABEL); } Texture icon = GetIcon(wkPath, incomingChange); GetOverlayIcon.Data overlayIconData = GetOverlayData( incomingChange, isSolvedConflict); DrawTreeViewItem.ForItemCell( rect, rowHeight, item.depth, icon, overlayIconData, label, isSelected, isFocused, isCurrentConflict); return; } if (column == IncomingChangesTreeColumn.Size) { DefaultGUI.LabelRightAligned(rect, label, isSelected, isFocused); return; } DefaultGUI.Label(rect, label, isSelected, isFocused); }
static void ChangeTreeViewItemCellGUI( Rect rect, float rowHeight, PendingChangesTreeView treeView, UnityPendingChangesTree pendingChangesTree, ChangeTreeViewItem item, PendingChangesTreeColumn column, bool isSelected, bool isFocused) { PendingChangeInfo changeInfo = item.ChangeInfo; string label = changeInfo.GetColumnText( PendingChangesTreeHeaderState.GetColumnName(column)); if (column == PendingChangesTreeColumn.Item) { if (pendingChangesTree.HasMeta(changeInfo.ChangeInfo)) { label = string.Concat(label, UnityConstants.TREEVIEW_META_LABEL); } Texture icon = GetIcon(changeInfo); GetOverlayIcon.Data overlayIconData = GetOverlayIcon.ForChange(changeInfo.ChangeInfo); bool wasChecked = changeInfo.IsChecked(); bool isChecked = DrawTreeViewItem.ForCheckableItemCell( rect, rowHeight, item.depth, icon, overlayIconData, label, isSelected, isFocused, false, wasChecked); changeInfo.UpdateCheckedState(isChecked); if (wasChecked != isChecked) { UpdateCheckStateForSelection(treeView, item); } return; } if (column == PendingChangesTreeColumn.Size) { DefaultGUI.LabelRightAligned(rect, label, isSelected, isFocused); return; } DefaultGUI.Label(rect, label, isSelected, isFocused); }