Skip to content

Commit

Permalink
update theme and help menu controller
Browse files Browse the repository at this point in the history
  • Loading branch information
yorukot committed Apr 27, 2024
1 parent b50e99a commit 31e86fc
Show file tree
Hide file tree
Showing 14 changed files with 279 additions and 225 deletions.
194 changes: 193 additions & 1 deletion src/components/default_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,196 @@ footer_panel_list = ['processessssssssssss', 'metadata', 'clipboard']
#
# Show more detailed metadata, please install exiftool before enabling this plugin!
metadata = false
`
`

func getHelpMenuData() []helpMenuModalData {
data := []helpMenuModalData{
{
subTitle: "General",
},
{
hotkey: hotkeys.Quit,
description: "Quit",
hotkeyWorkType: globalType,
},
{
subTitle: "Panel navigation",
},
{
hotkey: hotkeys.PinnedDirectory,
description: "Pin or Unpin folder to sidebar (can be auto saved)",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.CreateNewFilePanel,
description: "Create new file panel",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.CloseFilePanel,
description: "Close the focused file panel",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.NextFilePanel,
description: "Focus on the next file panel",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.PreviousFilePanel,
description: "Focus on the previous file panel",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FocusOnProcessBar,
description: "Focus on the processbar panel",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FocusOnSideBar,
description: "Focus on the sidebar",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FocusOnMetaData,
description: "Focus on the metadata panel",
hotkeyWorkType: globalType,
},
{
subTitle: "Panel movement",
},
{
hotkey: hotkeys.ChangePanelMode,
description: "Change between selection mode or normal mode",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.ListUp,
description: "Up",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.ListDown,
description: "Down",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.SelectItem,
description: "Go to folder",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.ParentDirectory,
description: "Return to parent folder",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FilePanelSelectAllItem,
description: "Select all items in focused file panel",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FilePanelSelectModeItemSelectUp,
description: "Select with your course",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.SelectItem,
description: "Select with your course",
hotkeyWorkType: selectType,
},
{
hotkey: hotkeys.FilePanelSelectModeItemSingleSelect,
description: "Select the item where the current cursor is located",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.ToggleDotFile,
description: "Toggle dot file display",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.SearchBar,
description: "Toggle active search bar",
hotkeyWorkType: globalType,
},
{
subTitle: "File operations",
},
{
hotkey: hotkeys.FilePanelDirectoryCreate,
description: "Create a new folder",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FilePanelFileCreate,
description: "Create a new file",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FilePanelItemRename,
description: "Rename file or folder",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.ExtractFile,
description: "Extract zip file",
hotkeyWorkType: normalType,
},
{
hotkey: hotkeys.CompressFile,
description: "Zip file or folder to .zip file",
hotkeyWorkType: normalType,
},
{
hotkey: hotkeys.DeleteItem,
description: "Delete file or folder (or both)",
hotkeyWorkType: normalType,
},
{
hotkey: hotkeys.CopySingleItem,
description: "Copy file or folder (or both)",
hotkeyWorkType: normalType,
},
{
hotkey: hotkeys.FilePanelSelectModeItemCut,
description: "Cut file or folder (or both)",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.PasteItem,
description: "Paste all items in your clipboard",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.SelectItem,
description: "Open file with your default application",
hotkeyWorkType: selectType,
},
{
hotkey: hotkeys.OpenFileWithEditor,
description: "Open file with your default editor",
hotkeyWorkType: normalType,
},
{
hotkey: hotkeys.OpenCurrentDirectoryWithEditor,
description: "Open current directory with default editor",
hotkeyWorkType: normalType,
},
{
subTitle: "Special",
},
{
hotkey: hotkeys.Confirm,
description: "Confirm rename or create item or exit search bar",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.Cancel,
description: "Cancel rename or create item or exit search bar and clear search bar value",
hotkeyWorkType: globalType,
},
}

return data
}
182 changes: 0 additions & 182 deletions src/components/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,185 +780,3 @@ func moveElement(src, dst string) error {
}
return nil
}

func getHelpMenuData() []helpModalData {
data := []helpModalData{
{
hotkey: hotkeys.Quit,
description: "Quit",
hotkeyWorkType: globalType,
previousSubTitle: "General",
},
{
hotkey: hotkeys.PinnedDirectory,
description: "Pin or Unpin folder to sidebar (can be auto saved)",
hotkeyWorkType: globalType,
previousSubTitle: "Panel navigation",
},
{
hotkey: hotkeys.CreateNewFilePanel,
description: "Create new file panel",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.CloseFilePanel,
description: "Close the focused file panel",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.NextFilePanel,
description: "Focus on the next file panel",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.PreviousFilePanel,
description: "Focus on the previous file panel",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FocusOnProcessBar,
description: "Focus on the processbar panel",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FocusOnSideBar,
description: "Focus on the sidebar",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FocusOnMetaData,
description: "Focus on the metadata panel",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.ChangePanelMode,
description: "Change between selection mode or normal mode",
hotkeyWorkType: globalType,
previousSubTitle: "Panel movement",
},
{
hotkey: hotkeys.ListUp,
description: "Up",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.ListDown,
description: "Down",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.SelectItem,
description: "Go to folder",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.ParentDirectory,
description: "Return to parent folder",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FilePanelSelectAllItem,
description: "Select all items in focused file panel",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FilePanelSelectModeItemSelectUp,
description: "Select with your course",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.SelectItem,
description: "Select with your course",
hotkeyWorkType: selectType,
},
{
hotkey: hotkeys.FilePanelSelectModeItemSingleSelect,
description: "Select the item where the current cursor is located",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.ToggleDotFile,
description: "Toggle dot file display",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.SearchBar,
description: "Toggle active search bar",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FilePanelDirectoryCreate,
description: "Create a new folder",
hotkeyWorkType: globalType,
previousSubTitle: "File operations",
},
{
hotkey: hotkeys.FilePanelFileCreate,
description: "Create a new file",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.FilePanelItemRename,
description: "Rename file or folder",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.ExtractFile,
description: "Extract zip file",
hotkeyWorkType: normalType,
},
{
hotkey: hotkeys.CompressFile,
description: "Zip file or folder to .zip file",
hotkeyWorkType: normalType,
},
{
hotkey: hotkeys.DeleteItem,
description: "Delete file or folder (or both)",
hotkeyWorkType: normalType,
},
{
hotkey: hotkeys.CopySingleItem,
description: "Copy file or folder (or both)",
hotkeyWorkType: normalType,
},
{
hotkey: hotkeys.FilePanelSelectModeItemCut,
description: "Cut file or folder (or both)",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.PasteItem,
description: "Paste all items in your clipboard",
hotkeyWorkType: globalType,
},
{
hotkey: hotkeys.SelectItem,
description: "Open file with your default application",
hotkeyWorkType: selectType,
},
{
hotkey: hotkeys.OpenFileWithEditor,
description: "Open file with your default editor",
hotkeyWorkType: normalType,
},
{
hotkey: hotkeys.OpenCurrentDirectoryWithEditor,
description: "Open current directory with default editor",
hotkeyWorkType: normalType,
},
{
hotkey: hotkeys.Confirm,
description: "Confirm rename or create item or exit search bar",
hotkeyWorkType: globalType,
previousSubTitle: "Special",
},
{
hotkey: hotkeys.Cancel,
description: "Cancel rename or create item or exit search bar and clear search bar value",
hotkeyWorkType: globalType,
},
}

return data
}
3 changes: 0 additions & 3 deletions src/components/global_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,5 @@ func openHelpMenu(m model) model {
}

m.helpMenu.open = true
m.helpMenu.cursor = 0
m.helpMenu.renderIndex = 0
m.helpMenu.data = getHelpMenuData()
return m
}
Loading

0 comments on commit 31e86fc

Please sign in to comment.