Skip to content

Commit

Permalink
File Tree: Make "Expand" and "Collapse" based on selected node
Browse files Browse the repository at this point in the history
Renaming menu items to be consistent with left panel
  • Loading branch information
pmiossec committed Feb 28, 2021
1 parent 43a6f1b commit 33a7b27
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 48 deletions.
43 changes: 16 additions & 27 deletions GitUI/CommandsDialogs/RevisionFileTreeControl.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 6 additions & 10 deletions GitUI/CommandsDialogs/RevisionFileTreeControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,6 @@ private void blameMenuItem_Click(object sender, EventArgs e)
}
}

private void collapseAllToolStripMenuItem_Click(object sender, EventArgs e)
{
tvGitTree.CollapseAll();
}

private void copyFilenameToClipboardToolStripMenuItem_Click(object sender, EventArgs e)
{
if (tvGitTree.SelectedNode?.Tag is GitItem gitItem)
Expand Down Expand Up @@ -498,14 +493,14 @@ private void editCheckedOutFileToolStripMenuItem_Click(object sender, EventArgs
}
}

private void expandAllStripMenuItem_Click(object sender, EventArgs e)
private void expandToolStripMenuItem_Click(object sender, EventArgs e)
{
tvGitTree.ExpandAll();
tvGitTree.SelectedNode?.ExpandAll();
}

private void expandSubtreeToolStripMenuItem_Click(object sender, EventArgs e)
private void collapseToolStripMenuItem_Click(object sender, EventArgs e)
{
tvGitTree.SelectedNode?.ExpandAll();
tvGitTree.SelectedNode?.Collapse();
}

private void fileTreeArchiveToolStripMenuItem_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -614,7 +609,8 @@ private void FileTreeContextMenu_Opening(object sender, System.ComponentModel.Ca
toolStripSeparatorGitTrackingActions.Visible = isFile;

findToolStripMenuItem.Enabled = tvGitTree.Nodes.Count > 0;
expandSubtreeToolStripMenuItem.Visible = isFolder;
expandToolStripMenuItem.Visible = isFolder;
collapseToolStripMenuItem.Visible = isFolder;
}

private void fileTreeOpenContainingFolderToolStripMenuItem_Click(object sender, EventArgs e)
Expand Down
18 changes: 7 additions & 11 deletions GitUI/Translation/English.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -8166,7 +8166,7 @@ To show all branches, right click the revision grid, select 'view' and then the
<source>Collapse</source>
<target />
</trans-unit>
<trans-unit id="mnubtnCollapseAll.ToolTipText">
<trans-unit id="mnubtnCollapse.ToolTipText">
<source>Collapse all subnodes</source>
<target />
</trans-unit>
Expand Down Expand Up @@ -8210,7 +8210,7 @@ To show all branches, right click the revision grid, select 'view' and then the
<source>Expand</source>
<target />
</trans-unit>
<trans-unit id="mnubtnExpandAll.ToolTipText">
<trans-unit id="mnubtnExpand.ToolTipText">
<source>Expand all subnodes</source>
<target />
</trans-unit>
Expand Down Expand Up @@ -8357,7 +8357,7 @@ To show all branches, right click the revision grid, select 'view' and then the
<target />
</trans-unit>
<trans-unit id="tsbCollapseAll.ToolTipText">
<source>Collapse all nodes</source>
<source>Collapse all subnodes</source>
<target />
</trans-unit>
<trans-unit id="tsbShowBranches.Text">
Expand Down Expand Up @@ -8622,8 +8622,8 @@ See the changes in the commit form.</source>
<source>Blame</source>
<target />
</trans-unit>
<trans-unit id="collapseAllToolStripMenuItem.Text">
<source>Collapse all</source>
<trans-unit id="collapseToolStripMenuItem.Text">
<source>Collapse</source>
<target />
</trans-unit>
<trans-unit id="copyFilenameToClipboardToolStripMenuItem.Text">
Expand All @@ -8634,12 +8634,8 @@ See the changes in the commit form.</source>
<source>Edit working directory file</source>
<target />
</trans-unit>
<trans-unit id="expandAllToolStripMenuItem.Text">
<source>Expand all (takes a while on large trees)</source>
<target />
</trans-unit>
<trans-unit id="expandSubtreeToolStripMenuItem.Text">
<source>Expand subtree (takes a while on large subtrees)</source>
<trans-unit id="expandToolStripMenuItem.Text">
<source>Expand</source>
<target />
</trans-unit>
<trans-unit id="fileHistoryToolStripMenuItem.Text">
Expand Down

0 comments on commit 33a7b27

Please sign in to comment.