Skip to content

Commit

Permalink
Replace ShortcutKeys Ctrl+F with Hotkeys
Browse files Browse the repository at this point in the history
  • Loading branch information
mstv committed Apr 2, 2022
1 parent 79df0e6 commit 23e8cf2
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 16 deletions.
10 changes: 5 additions & 5 deletions GitUI/BranchTreePanel/RepoObjectsTree.Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ public partial class RepoObjectsTree
{
public enum Command
{
Delete,
Rename,
Search,
MultiSelect,
MultiSelectWithChildren
Delete = 0,
Rename = 1,
Search = 2,
MultiSelect = 3,
MultiSelectWithChildren = 4,
}
}
}
1 change: 0 additions & 1 deletion GitUI/CommandsDialogs/RevisionDiffControl.Designer.cs

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

6 changes: 4 additions & 2 deletions GitUI/CommandsDialogs/RevisionDiffControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ public enum Command
UnStageSelectedFile = 11,
ShowFileTree = 12,
FilterFileInGrid = 13,
SelectFirstGroupChanges = 14
SelectFirstGroupChanges = 14,
Find = 15,
}

public CommandStatus ExecuteCommand(Command cmd)
Expand Down Expand Up @@ -163,7 +164,7 @@ protected override CommandStatus ExecuteCommand(int cmd)
case Command.ShowFileTree: diffShowInFileTreeToolStripMenuItem.PerformClick(); break;
case Command.FilterFileInGrid: diffFilterFileInGridToolStripMenuItem.PerformClick(); break;
case Command.SelectFirstGroupChanges: return SelectFirstGroupChangesIfFileNotFocused();

case Command.Find: findInDiffToolStripMenuItem.PerformClick(); break;
default: return base.ExecuteCommand(cmd);
}

Expand Down Expand Up @@ -199,6 +200,7 @@ public void ReloadHotkeys()
unstageFileToolStripMenuItem.ShortcutKeyDisplayString = GetShortcutKeyDisplayString(Command.UnStageSelectedFile);
diffShowInFileTreeToolStripMenuItem.ShortcutKeyDisplayString = GetShortcutKeyDisplayString(Command.ShowFileTree);
diffFilterFileInGridToolStripMenuItem.ShortcutKeyDisplayString = GetShortcutKeyDisplayString(Command.FilterFileInGrid);
findInDiffToolStripMenuItem.ShortcutKeyDisplayString = GetShortcutKeyDisplayString(Command.Find);

DiffText.ReloadHotkeys();
}
Expand Down
1 change: 0 additions & 1 deletion GitUI/CommandsDialogs/RevisionFileTreeControl.Designer.cs

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

5 changes: 4 additions & 1 deletion GitUI/CommandsDialogs/RevisionFileTreeControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ public enum Command
OpenAsTempFile = 3,
OpenAsTempFileWith = 4,
EditFile = 5,
FilterFileInGrid = 6
FilterFileInGrid = 6,
Find = 7,
}

public CommandStatus ExecuteCommand(Command cmd)
Expand All @@ -276,6 +277,7 @@ protected override CommandStatus ExecuteCommand(int cmd)
case Command.OpenAsTempFileWith: openFileWithToolStripMenuItem.PerformClick(); break;
case Command.EditFile: editCheckedOutFileToolStripMenuItem.PerformClick(); break;
case Command.FilterFileInGrid: filterFileInGridToolStripMenuItem.PerformClick(); break;
case Command.Find: findToolStripMenuItem.PerformClick(); break;
default: return base.ExecuteCommand(cmd);
}

Expand All @@ -300,6 +302,7 @@ public void ReloadHotkeys()
openFileWithToolStripMenuItem.ShortcutKeyDisplayString = GetShortcutKeyDisplayString(Command.OpenAsTempFileWith);
editCheckedOutFileToolStripMenuItem.ShortcutKeyDisplayString = GetShortcutKeyDisplayString(Command.EditFile);
filterFileInGridToolStripMenuItem.ShortcutKeyDisplayString = GetShortcutKeyDisplayString(Command.FilterFileInGrid);
findToolStripMenuItem.ShortcutKeyDisplayString = GetShortcutKeyDisplayString(Command.Find);
FileText.ReloadHotkeys();
}

Expand Down
1 change: 0 additions & 1 deletion GitUI/Editor/FileViewer.Designer.cs

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

1 change: 1 addition & 0 deletions GitUI/Editor/FileViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ public void ClearBlameGutter()
public void ReloadHotkeys()
{
Hotkeys = HotkeySettingsManager.LoadHotkeys(HotkeySettingsName);
findToolStripMenuItem.ShortcutKeyDisplayString = GetShortcutKeyDisplayString(Command.Find);
stageSelectedLinesToolStripMenuItem.ShortcutKeyDisplayString = GetShortcutKeyDisplayString(Command.StageLines);
unstageSelectedLinesToolStripMenuItem.ShortcutKeyDisplayString = GetShortcutKeyDisplayString(Command.UnstageLines);
resetSelectedLinesToolStripMenuItem.ShortcutKeyDisplayString = GetShortcutKeyDisplayString(Command.ResetLines);
Expand Down
12 changes: 7 additions & 5 deletions GitUI/Hotkey/HotkeySettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ public static HotkeySettings[] CreateDefaultSettings()
new HotkeySettings(
RepoObjectsTree.HotkeySettingsName,
Hk(RepoObjectsTree.Command.Delete, Keys.Delete),
Hk(RepoObjectsTree.Command.Rename, Keys.F2),
Hk(RepoObjectsTree.Command.Search, Keys.F3),
Hk(RepoObjectsTree.Command.MultiSelect, Keys.Control | Keys.Space),
Hk(RepoObjectsTree.Command.MultiSelectWithChildren, Keys.Control | Keys.Shift | Keys.Space)),
Hk(RepoObjectsTree.Command.MultiSelectWithChildren, Keys.Control | Keys.Shift | Keys.Space),
Hk(RepoObjectsTree.Command.Rename, Keys.F2),
Hk(RepoObjectsTree.Command.Search, Keys.F3)),
new HotkeySettings(
RevisionGridControl.HotkeySettingsName,
Hk(RevisionGridControl.Command.CompareSelectedCommits, Keys.None),
Expand Down Expand Up @@ -378,6 +378,7 @@ public static HotkeySettings[] CreateDefaultSettings()
Hk(RevisionDiffControl.Command.DeleteSelectedFiles, Keys.Delete),
Hk(RevisionDiffControl.Command.EditFile, EditFileHotkey),
Hk(RevisionDiffControl.Command.FilterFileInGrid, Keys.F),
Hk(RevisionDiffControl.Command.Find, Keys.Control | Keys.F),
Hk(RevisionDiffControl.Command.OpenAsTempFile, OpenAsTempFileHotkey),
Hk(RevisionDiffControl.Command.OpenAsTempFileWith, OpenAsTempFileWithHotkey),
Hk(RevisionDiffControl.Command.OpenWithDifftool, OpenWithDifftoolHotkey),
Expand All @@ -393,11 +394,12 @@ public static HotkeySettings[] CreateDefaultSettings()
RevisionFileTreeControl.HotkeySettingsName,
Hk(RevisionFileTreeControl.Command.Blame, BlameHotkey),
Hk(RevisionFileTreeControl.Command.EditFile, EditFileHotkey),
Hk(RevisionFileTreeControl.Command.FilterFileInGrid, Keys.F),
Hk(RevisionFileTreeControl.Command.Find, Keys.Control | Keys.F),
Hk(RevisionFileTreeControl.Command.OpenAsTempFile, OpenAsTempFileHotkey),
Hk(RevisionFileTreeControl.Command.OpenAsTempFileWith, OpenAsTempFileWithHotkey),
Hk(RevisionFileTreeControl.Command.OpenWithDifftool, OpenWithDifftoolHotkey),
Hk(RevisionFileTreeControl.Command.ShowHistory, ShowHistoryHotkey),
Hk(RevisionFileTreeControl.Command.FilterFileInGrid, Keys.F)),
Hk(RevisionFileTreeControl.Command.ShowHistory, ShowHistoryHotkey)),
new HotkeySettings(
FormStash.HotkeySettingsName,
Hk(FormStash.Command.NextStash, Keys.Control | Keys.N),
Expand Down

0 comments on commit 23e8cf2

Please sign in to comment.