Skip to content

Commit

Permalink
Changed Ctrl+H to Ctrl+K as it clashes with Backspace. Fixes #9.
Browse files Browse the repository at this point in the history
  • Loading branch information
darylhjd committed May 15, 2021
1 parent 7a95557 commit a8e9082
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 19 deletions.
18 changes: 11 additions & 7 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,24 @@ This document lays out some general guidelines for contributing. Please take som
Bug reports/fixes will always take priority over feature requests.

When opening a new issue, please include the following:

- Start your title with either a `[BUG]` or `[Feature Request]` tag so I know how to categorise your issue.
- For bug reports, include:
- `Expected Behaviour`
- `Actual Behaviour`
- If possible, `Steps to Reproduce` the problem.
- If you feel any additional information would be helpful, such as screenshots, code snippets etc.., you may include it as well.
- `Expected Behaviour`
- `Actual Behaviour`
- If possible, `Steps to Reproduce` the problem.
- If you feel any additional information would be helpful, such as screenshots, code snippets etc.., you may include it
as well.

## Pull Requests

Always open an issue first before submitting a Pull Request. This way, there is opportunity for discussion before you dedicate your time to writing code.
Always open an issue first before submitting a Pull Request. This way, there is opportunity for discussion before you
dedicate your time to writing code.

- Make sure that your code follows the current structure of the project. I may reject requests that do not follow this.
- Your code should be commented if possible. This way, I know exactly what is going on, and new contributors won't be lost.
- If your Pull Request fixes a bug, plese reference it in the comments so it is closed automatically.
- Your code should be commented if possible. This way, I know exactly what is going on, and new contributors won't be
lost.
- If your Pull Request fixes a bug, plese reference it in the comments so it is closed automatically.
- Consistency is key, and quality is a must.

### Thank you for contributing!
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@
- Responsive UI (kind of)
- Written in Golang :)

Works for Windows/Linux/MacOS.
Works for Windows/Linux/macOS.

## Usage

Simply choose the chapters you want to read to download.

All downloads are stored in a folder titled `downloads`, which you will find in the same directory as where you run the application.
All downloads are stored in a folder titled `downloads`, which you will find in the same directory as where you run the
application.

### Keybindings

- Ctrl + L : Login/Logout
- Ctrl + H : Help
- Ctrl + K : Keybindings/Help
- Ctrl + S : Search
- Ctrl + E : Select multiple chapters
- Esc : Going back
Expand All @@ -46,7 +47,7 @@ go build

## Issues ☠

Check out the Issues page for current issues.
Check out the Issues page for current issues.

## Planning... maybe?

Expand Down
4 changes: 2 additions & 2 deletions pages/help_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func ShowHelpPage(pages *tview.Pages) {
"-----------------------------\n\n" +
"Universal\n" +
fmt.Sprintf("%-15s:%15s\n", "Ctrl + L", "Login/Logout") +
fmt.Sprintf("%-15s:%15s\n", "Ctrl + H", "Show Help") +
fmt.Sprintf("%-15s:%15s\n", "Ctrl + K", "Keybinds/Help") +
fmt.Sprintf("%-15s:%15s\n\n", "Ctrl + S", "Search") +
"Manga Page\n" +
fmt.Sprintf("%-15s:%15s\n", "Ctrl + E", "Select mult.") +
Expand All @@ -35,7 +35,7 @@ func ShowHelpPage(pages *tview.Pages) {
// Create a new grid for the text view so we can align it to the center.
grid := tview.NewGrid().SetColumns(0, 0, 0, 0).SetRows(0, 0, 0, 0).
AddItem(help, 0, 0, 4, 4, 0, 0, false).
AddItem(help, 1, 1, 2, 2, 30, 100, false)
AddItem(help, 1, 1, 2, 2, 35, 100, false)

// Set up input capture for the help page.
grid.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
Expand Down
10 changes: 5 additions & 5 deletions pages/inputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// SetUniversalInputCaptures : Set input handlers for the app.
// List of input captures: Ctrl+L
// List of input captures: Ctrl+L, Ctrl+K, Ctrl+S
func SetUniversalInputCaptures(pages *tview.Pages) {
// Enable mouse.
g.App.EnableMouse(true)
Expand All @@ -21,8 +21,8 @@ func SetUniversalInputCaptures(pages *tview.Pages) {
switch event.Key() {
case tcell.KeyCtrlL: // Login/Logout
ctrlLInput(pages)
case tcell.KeyCtrlH: // Help page.
ctrlHInput(pages)
case tcell.KeyCtrlK: // Help page.
ctrlKInput(pages)
case tcell.KeyCtrlS: // Search page.
ctrlSInput(pages)
}
Expand Down Expand Up @@ -126,9 +126,9 @@ func ctrlEInput(table *tview.Table, sRows *map[int]struct{}) {
}
}

// ctrlHInput : Handler for Ctrl+H input.
// ctrlKInput : Handler for Ctrl+K input.
// This shows the help page to the user.
func ctrlHInput(pages *tview.Pages) {
func ctrlKInput(pages *tview.Pages) {
ShowHelpPage(pages)
}

Expand Down
1 change: 1 addition & 0 deletions pages/main_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func setUpMangaListTable(pages *tview.Pages, table *tview.Table, params *url.Val

// When user presses ENTER on a manga row, they are redirected to the manga page.
table.SetSelectedFunc(func(row, column int) {
// This prevents index out-of-range error when there are no results.
if len(mangaList.Results) != 0 {
ShowMangaPage(pages, &(mangaList.Results[row-1]))
}
Expand Down
2 changes: 1 addition & 1 deletion pages/search_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func ShowSearchPage(pages *tview.Pages) {
SetSeparator('|').
SetBordersColor(tcell.ColorGrey).
SetTitleColor(tcell.ColorLightSkyBlue).
SetTitle("[grey]Press ↓ on search bar to switch to table. Press Tab on table to switch to search bar.").
SetTitle("[yellow]Press ↓ on search bar to switch to table. [green]Press Tab on table to switch to search bar.").
SetBorder(true)

// Create a form for the searching
Expand Down

0 comments on commit a8e9082

Please sign in to comment.