Option to reverse the top and bottom of the (landscape) view
There are times when it'd be useful to be able to switch which side of the phone is the bottom in the landscape mode. Currently the left side of the screen is always the bottom, which can be highly invconvenient at times.
For example one can plug in the charger only to find that the limited cable length now causes you to stay in an unergonomical position to read. Or one might just prefer to hold the phone in the right hand without accidentally touching the home and back buttons.
This should be a per-book boolean option, displayed under Force landscape, before Day/Night. After implementing #206 the user can be given the possibility to set the default. The option name can be simply Reverse, and all it would do is to switch the bottom and top of the view. It should also work in portrait mode.
Just implemented this, there is a "Reverse orientation" checkbox below "Force landscape" now, seems to work nicely!
This setting works great, thanks! The only issue I noticed is when you set a global setting to be "Force landscape", and open a new document, this "Reverse orientation" setting is not clickable. The root cause seems to be that the global "Force landscape" setting is taken into effect, but it is not reflected in the per-document "Force landscape" setting (it incorrectly appears unchecked, which makes "Reverse orientation" untouchable, which is correct behavior).
Glad to hear!
I reproduced that bug... Yes, the problem is that the settings in the toolbar for "Reverse orientation", "Force landscape", and "Force portrait" only read/write the per-document setting. When you open a book for the first time, the per-document setting defaults to "unspecified", which means "use the global setting".
The workaround for now is to check the "Force Landscape" menu item in the toolbar, this will set the per-document setting to "landscape" and then you'll be able to choose "reverse orientation".
I'm not sure what the right way to fix it is. Maybe the toolbar controls for portrait/landscape/reverse should affect the global setting, as long as the book setting is unset. This would probably need to be part of a UI redesign of this menu (https://github.com/SufficientlySecure/document-viewer/issues/240 )
Nice work! I see two options.
- Start by keeping the current way
- Check for book setting
- If not found, default to "unspecified"
- If "unspecified":
- Use global setting, but
- Don't indicate this in the UI (why? this is unexpected)
If keeping things this way, either modify the if clause that checks when to show "Reverse orientation" to be available also when "unspecified" and using global setting that says force landscape, or alternatively consider whether that button could be shown all the time.
or
- Simplify things
- Check for book setting
- If not found, default to global setting
I don't currently see the benefit in using "unspecified". If it happens to be redundant, removing it will make the code cleaner and also remove the bug in question :)