Skip to content

Commit

Permalink
add windows shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
jafl committed Dec 11, 2023
1 parent 87138d8 commit 1809ec2
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion code/FileTreeTable-File.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ enum {
#endif

static void ConfigureFileMenu(JXTextMenu* menu, const int offset = 0) {
if (menu->IsEmpty() && JXMenu::GetDisplayStyle() == JXMenu::kWindowsStyle) {
if (offset == 0 && JXMenu::GetDisplayStyle() == JXMenu::kWindowsStyle) {
menu->SetShortcuts(JString("#f", JString::kNoCopy));
}
menu->SetItemImage(kNewDirCmd + offset, jx_folder_small);
Expand Down
2 changes: 1 addition & 1 deletion code/FileTreeTable-Git.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ enum {
#endif

static void ConfigureGitMenu(JXTextMenu* menu, const int offset = 0) {
if (menu->IsEmpty() && JXMenu::GetDisplayStyle() == JXMenu::kWindowsStyle) {
if (offset == 0 && JXMenu::GetDisplayStyle() == JXMenu::kWindowsStyle) {
menu->SetShortcuts(JString("#g", JString::kNoCopy));
}
menu->SetItemImage(kGitStatusCmd + offset, git_status);
Expand Down
3 changes: 3 additions & 0 deletions code/FileTreeTable-Shortcuts.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ enum {


static void ConfigureShortcutsMenu(JXTextMenu* menu, const int offset = 0) {
if (offset == 0 && JXMenu::GetDisplayStyle() == JXMenu::kWindowsStyle) {
menu->SetShortcuts(JString("#s", JString::kNoCopy));
}
};

#endif
8 changes: 4 additions & 4 deletions code/FileTreeTable-Shortcuts.jxm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jx_menu_editor 0
670 300
"FileTreeTable"
"Shortcuts"
'
's
40
40
100
Expand All @@ -18,7 +18,7 @@ jx_menu_editor 0
0 ""
"Add Shortcut"
"Ctrl-plus"
'
'a
"AddShortcut"
"kAddShortcutCmd"
0
Expand All @@ -28,7 +28,7 @@ jx_menu_editor 0
0 ""
"Remove Shortcut"
"Ctrl-minus"
'
'r
"RemoveShortcut"
"kRemoveShortcutCmd"
0
Expand All @@ -38,7 +38,7 @@ jx_menu_editor 0
0 ""
"Remove All Shortcuts"
""
'
'l
"RemoveAllShortcuts"
"kRemoveAllShortcutsCmd"
1
Expand Down
2 changes: 1 addition & 1 deletion code/FileTreeTable-View.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ enum {
#endif

static void ConfigureViewMenu(JXTextMenu* menu, const int offset = 0) {
if (menu->IsEmpty() && JXMenu::GetDisplayStyle() == JXMenu::kWindowsStyle) {
if (offset == 0 && JXMenu::GetDisplayStyle() == JXMenu::kWindowsStyle) {
menu->SetShortcuts(JString("#v", JString::kNoCopy));
}
menu->SetItemImage(kShowFilterCmd + offset, filter);
Expand Down
2 changes: 1 addition & 1 deletion code/TreeDir-Help.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ enum {
#endif

static void ConfigureHelpMenu(JXTextMenu* menu, const int offset = 0) {
if (menu->IsEmpty() && JXMenu::GetDisplayStyle() == JXMenu::kWindowsStyle) {
if (offset == 0 && JXMenu::GetDisplayStyle() == JXMenu::kWindowsStyle) {
menu->SetShortcuts(JString("#h", JString::kNoCopy));
}
menu->SetItemImage(kTOCCmd + offset, jx_help_toc);
Expand Down
2 changes: 1 addition & 1 deletion code/TreeDir-Preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enum {


static void ConfigurePreferencesMenu(JXTextMenu* menu, const int offset = 0) {
if (menu->IsEmpty() && JXMenu::GetDisplayStyle() == JXMenu::kWindowsStyle) {
if (offset == 0 && JXMenu::GetDisplayStyle() == JXMenu::kWindowsStyle) {
menu->SetShortcuts(JString("#p", JString::kNoCopy));
}
};
Expand Down
6 changes: 3 additions & 3 deletions strings/FileTreeTable-Shortcuts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

MenuTitle::FileTreeTable_Shortcuts "Shortcuts"

AddShortcut::FileTreeTable "Add Shortcut %k Ctrl-plus"
RemoveShortcut::FileTreeTable "Remove Shortcut %k Ctrl-minus"
RemoveAllShortcuts::FileTreeTable "Remove All Shortcuts"
AddShortcut::FileTreeTable "Add Shortcut %k Ctrl-plus %h a"
RemoveShortcut::FileTreeTable "Remove Shortcut %k Ctrl-minus %h r"
RemoveAllShortcuts::FileTreeTable "Remove All Shortcuts %h l"

0 comments on commit 1809ec2

Please sign in to comment.