From 5459ff78cfc00133bdcc6d670e0302087e24bfbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 6 Mar 2021 18:02:41 +0100 Subject: [PATCH 1/5] Disable close button as the default when pressing enter It can be triggered using ESC --- YACReaderLibrary/comic_vine/comic_vine_dialog.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp index f922fa83..036d494d 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp +++ b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp @@ -57,6 +57,9 @@ void ComicVineDialog::doLayout() searchButton = new QPushButton(tr("search")); closeButton = new QPushButton(tr("close")); + closeButton->setDefault(false); + closeButton->setAutoDefault(false); + skipButton->setStyleSheet(dialogButtonsStyleSheet); backButton->setStyleSheet(dialogButtonsStyleSheet); nextButton->setStyleSheet(dialogButtonsStyleSheet); From f98ce43465eeeac2d73228d5b41be71209e6b066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 6 Mar 2021 18:03:04 +0100 Subject: [PATCH 2/5] Add a shortcut to going back --- YACReaderLibrary/comic_vine/comic_vine_dialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp index 036d494d..1ca259d9 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp +++ b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp @@ -57,6 +57,8 @@ void ComicVineDialog::doLayout() searchButton = new QPushButton(tr("search")); closeButton = new QPushButton(tr("close")); + backButton->setShortcut(QKeySequence(Qt::Key_Backspace)); + closeButton->setDefault(false); closeButton->setAutoDefault(false); From 5303e247b71c04a32bbc55262c46e50c420a89f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 6 Mar 2021 18:06:05 +0100 Subject: [PATCH 3/5] Always use toggleSkipButton --- YACReaderLibrary/comic_vine/comic_vine_dialog.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp index 1ca259d9..dec7140a 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp +++ b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp @@ -308,10 +308,7 @@ void ComicVineDialog::showSeriesQuestion() searchButton->setHidden(true); closeButton->setVisible(true); - if (mode == SingleComicInList) - skipButton->setVisible(true); - else - skipButton->setHidden(true); + toggleSkipButton(); } void ComicVineDialog::showSearchSingleComic() @@ -324,10 +321,7 @@ void ComicVineDialog::showSearchSingleComic() searchButton->setVisible(true); closeButton->setVisible(true); - if (mode == SingleComicInList) - skipButton->setVisible(true); - else - skipButton->setHidden(true); + toggleSkipButton(); } void ComicVineDialog::showSearchVolume() From c5de729635e60c97c8ba12a1f5709a7b44883e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 6 Mar 2021 18:07:29 +0100 Subject: [PATCH 4/5] Set the default button based on the current context --- .../comic_vine/comic_vine_dialog.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp index dec7140a..237519b9 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp +++ b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp @@ -308,6 +308,8 @@ void ComicVineDialog::showSeriesQuestion() searchButton->setHidden(true); closeButton->setVisible(true); + nextButton->setDefault(true); + toggleSkipButton(); } @@ -321,6 +323,8 @@ void ComicVineDialog::showSearchSingleComic() searchButton->setVisible(true); closeButton->setVisible(true); + searchButton->setDefault(true); + toggleSkipButton(); } @@ -332,6 +336,9 @@ void ComicVineDialog::showSearchVolume() nextButton->setHidden(true); searchButton->setVisible(true); closeButton->setVisible(true); + + searchButton->setDefault(true); + toggleSkipButton(); } @@ -351,6 +358,9 @@ void ComicVineDialog::showSelectVolume() nextButton->setVisible(true); searchButton->setHidden(true); closeButton->setVisible(true); + + nextButton->setDefault(true); + toggleSkipButton(); } @@ -365,6 +375,9 @@ void ComicVineDialog::showSelectComic(const QString &json) nextButton->setVisible(true); searchButton->setHidden(true); closeButton->setVisible(true); + + nextButton->setDefault(true); + toggleSkipButton(); } @@ -380,6 +393,9 @@ void ComicVineDialog::showSortVolumeComics(const QString &json) nextButton->setVisible(true); searchButton->setHidden(true); closeButton->setVisible(true); + + nextButton->setDefault(true); + toggleSkipButton(); } From f4112e1190b4f3035cd2c1f934b27d03be6c8298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 6 Mar 2021 21:24:53 +0100 Subject: [PATCH 5/5] Update what's new + CHANGELOG --- CHANGELOG.md | 1 + custom_widgets/whats_new_dialog.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e0e53f4..089d71f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Version counting is based on semantic versioning (Major.Feature.Patch) * New search engine. * New `manga` field added to comics and folders to tag content as manga, any content added to a manga folder will become manga automatically. * Support for HTML in comic synopsis, this fixes the synopsis when it comes from Comic Vine with HTML tags. +* Improve keyboard navigation in Comic Vine dialog. ## 9.7.1 ### YACReader diff --git a/custom_widgets/whats_new_dialog.cpp b/custom_widgets/whats_new_dialog.cpp index 2fad753b..c80cceb8 100644 --- a/custom_widgets/whats_new_dialog.cpp +++ b/custom_widgets/whats_new_dialog.cpp @@ -57,6 +57,7 @@ YACReader::WhatsNewDialog::WhatsNewDialog(QWidget *parent) " • New fuzzy search engine. Type to search into any field of the database, or target specific content \"read:false manga:true filename:3x3\", read more about how it works in the web site.
" " • New `manga` field added to comics and folders to tag content as manga, any content added to a manga folder will become manga automatically.
" " • Support for HTML in comic synopsis, this fixes the synopsis when it comes from Comic Vine with HTML tags.
" + " • Improve keyboard navigation in Comic Vine dialog. Enter will trigger next or search and Backspace will go back to the previous section.
" "
" "Server
" " • New `manga` field is sent to YACReader for iOS, so comics tagged as manga will be recognized as such when reading remotely or importing comics.
"