babluboy / bookworm

A simple ebook reader for Elementary OS
GNU General Public License v3.0
1.32k stars 100 forks source link

Pagination Bug #263

Closed ghost closed 5 years ago

ghost commented 5 years ago

I have currently added only one book in .epub format and a next page button was available.

Since there was only one book, both pagination buttons should have been grayed out.

When I pressed that next page button, it got me to a blank page and going back to where my book was became impossible.

babluboy commented 5 years ago

Good catch...I had not tested for the scenario with books less than the page items. I know why the blank page came for the next button, but the prev button should have returned to the initial page after two clicks.

Anyways will test and fix. Many thanks for your testing efforts.

babluboy commented 5 years ago

@infosisio Just pushed a fix. The prev page button will be disabled on the first page but the next page button will be enabled, however if you click on the next page button it will go disabled if there are no further books to load. When you click on the next button the prev button will be enabled but click on it will disable it when there are no previous page to go to. With one book (or books less than the item per page number) user cannot go back or forward from the first page displaying the books in the library. Hopefully this will be fine to start with until I figure out a better way to disable the button if there are no further pages in that direction.

Will be great if you can build from source and test to check you are not getting the blank page.

ghost commented 5 years ago

@babluboy Thanks for taking care of this, will do. Would it be very hard to make both grayed out if it's just one page? That's much better UX wise.

babluboy commented 5 years ago

@infosisio It won’t be that hard. But will need some extra checks. The current checks take care of all situations: 1-books less than page limit 2-books exact multiple of page limit 3-last page having less than page limit

The only improvement is to do an addition check and disable enable buttons after the user based query - basically look ahead.

Will try to do that soon

babluboy commented 5 years ago

@infosisio This was easier than I realised and as you mentioned its better UX to set the button status without the user having to click them. Just pushed the fix, you can build from source to test and let me know if any bug persists