提交 23d6239f 编写于 作者: J Joao Moreno

dnd in git

fixes #12311
上级 e058bde3
......@@ -218,6 +218,10 @@ interface IStatusGroupTemplateData {
actionBar: actionbar.ActionBar;
}
const STAGED_CHANGES = nls.localize('stagedChanges', "Staged Changes");
const CHANGES = nls.localize('allChanges', "Changes");
const MERGE_CHANGES = nls.localize('mergeChanges', "Merge Changes");
export class Renderer implements tree.IRenderer {
constructor(
......@@ -268,9 +272,9 @@ export class Renderer implements tree.IRenderer {
data.root = dom.append(container, $('.status-group'));
switch (statusType) {
case git.StatusType.INDEX: data.root.textContent = nls.localize('stagedChanges', "Staged Changes"); break;
case git.StatusType.WORKING_TREE: data.root.textContent = nls.localize('allChanges', "Changes"); break;
case git.StatusType.MERGE: data.root.textContent = nls.localize('mergeChanges', "Merge Changes"); break;
case git.StatusType.INDEX: data.root.textContent = STAGED_CHANGES; break;
case git.StatusType.WORKING_TREE: data.root.textContent = CHANGES; break;
case git.StatusType.MERGE: data.root.textContent = MERGE_CHANGES; break;
}
const wrapper = dom.append(container, $('.count-badge-wrapper'));
......@@ -536,6 +540,27 @@ export class DragAndDrop extends ActionContainer implements tree.IDragAndDrop {
return null;
}
getDragLabel(tree: tree.ITree, elements: any[]): string {
if (elements.length > 1) {
return String(elements.length);
}
const element = elements[0];
if (element instanceof gitmodel.StatusGroup) {
const group = element as gitmodel.StatusGroup;
switch (group.getType()) {
case git.StatusType.INDEX: return STAGED_CHANGES;
case git.StatusType.WORKING_TREE: return CHANGES;
case git.StatusType.MERGE: return MERGE_CHANGES;
}
}
const status = element as gitmodel.FileStatus;
return paths.basename(status.getPath());
}
public onDragStart(tree: tree.ITree, data: tree.IDragAndDropData, originalEvent:mouse.DragMouseEvent):void {
// no-op
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册