2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
Commit Graph

205 Commits

Author SHA1 Message Date
git-help-eng
0d231cbbef
Footer: maybe shouldn't be visible on resume (#8289) 2021-10-10 20:51:50 +02:00
hius07
1e47cd7e5f
SpinWidget: similar size in portrait and landscape (#8226) 2021-09-25 10:40:04 +02:00
zwim
debf5dc550
Footer: add Warmth as footer item (#8060) 2021-09-02 22:44:22 +02:00
poire-z
4e65b74b73
Footer: add "Include current page in pages left" setting (#8093) 2021-08-17 22:51:54 +02:00
Brian Hughes
ba65dc155b
Adds time left for chapter and document to the screensaver message options (#7897) 2021-06-30 01:45:34 +02:00
hius07
c4f4190ad4
ReaderFooter settings menu: keep upper menu page (#7903) 2021-06-29 14:10:21 +02:00
hius07
c6ccc73d55
Status bar: hide battery if level higher than threshold (#7876)
closes #7242
2021-06-22 19:03:05 +02:00
Jason Benwell
682f7561a0
Use smaller symbols for pages_left_book in compact_items (#7828)
Use the (smaller) "‹" or "›" symbols in pages_left_book, to match pages_left, in compact_items
2021-06-21 18:48:33 +02:00
NiLuJe
ba070c24de ReaderFooter: Add a chapter_progress widget
(i.e., in-chapter num / total).

Fix #7792
2021-06-08 03:27:45 +02:00
NiLuJe
0d1325cc83 ReaderFooter: Make pages_left_book use an actual prefix icon
Instead of baking in a hyphen, so as to avoid signed zeroes, or
confusion with page progress if page maps are enabled.

Also, made compact itemps RTL friendly.
2021-06-08 03:27:45 +02:00
poire-z
d0165f8bd1 Fix scrolling, add inertial scroll on non-eInk devices
Add a new reader module: ReaderScrolling, that exposes
some Scrolling options to the menu (which are to be used
by and implemented in ReaderPaging and ReaderRolling
themselves) and implement some inertial scrolling logic
used by both of them.
Default to "Classic scrolling" which is the expected
behaviour on phones and tablets.
The old CreDocument buggy behaviour is available as
"Turbo scrolling" for both Paging and Rolling documents.
Added a "On release scrolling" option that might be
useful on eInk to avoid dynamic pan/scrolling.

Try to avoid bad interactions between pan and swipe,
cancelling unwanted panning if we ended up doing a
swipe or multiswipe.
2021-05-19 23:55:07 +02:00
NiLuJe
6dc1c1efca Unbreak ReaderFooter test
Tests: Update the ffi.metatype wrapper

(Better idea: move to busted master).
2021-05-19 20:55:00 +02:00
NiLuJe
189035cafc ReaderFooter: Get rid of magic nil settings
And go through one-time-migration to ensure the settings are properly
filled.

Also, disable hold-to-skim by default.
2021-05-19 20:55:00 +02:00
NiLuJe
8d3aacbac3 ReaderFooter: Fix the madness related to its hold footer
Namely, instead of making it lower priority than readerhighlight and
hoping for the best, make it higher priority, as it should (ReaderFooter
itself is *above* Reader, after all), with a sane set of fallthroughs:

* No footer
* No hold-to-skim
* Held outside the footer (but inside the footer tap zone)

This made the crap workaround from #7466 unnecessary, and actually fixes
the behavior in PDFs (because readerhighlight will match the *physical*
page, which may include off-screen content) and ePubs w/r eclaim bar
height (in which case, there's actual content behind the footer that
readerhighlight could have matched on).

Fix #7697
2021-05-19 20:55:00 +02:00
hius07
9d9667c226
Status bar: do not hide alone empty indicators (#7602) 2021-04-26 17:40:06 +02:00
NiLuJe
079418d3cd ReaderFooter: Smarter hardware event handlers
Make sure we don't repaint the footer over anything else than ReaderUI,
as some events are fired without direct UI interaction, so we can't be
assured of the actual state of the UI.

Fix #7556

Exposed since #7379, but could arguably happen with other existing
handlers before.
2021-04-18 01:03:33 +02:00
zwim
10922561dd
Add update of the top and bottom status bars, on +/-Charging (#7379) 2021-04-04 12:17:09 +02:00
NiLuJe
766ec91a84
ReaderFooter: Workaround a bad interaction with ReaderHighlight (#7466)
Related to hold handlers.

Fix #7464
2021-03-30 20:01:38 +02:00
NiLuJe
bf6c0cdd6c
LuaSettings: Add a method to initialize a setting properly (#7371)
* LuaSettings/DocSettings: Updated readSetting API to allow proper initialization to default.
Use it to initialize tables, e.g., fixing corner-cases in readerFooter that could prevent settings from being saved.
(Fixes an issue reported on Gitter).
* LuaSettings/DocSettings: Add simpler API than the the flip* ones to toggle boolean settings.
* Update LuaSettings/DocSettigns usage throughout the codebase to use the dedicated boolean methods wher appropriate, and clean up some of the more mind-bending uses.
* FileChooser: Implement an extended default exclusion list (fix #2360)
* ScreenSaver: Refactor to avoid the pile of kludges this was threatening to become. Code should be easier to follow and use, and fallbacks now behave as expected (fix #4418).
2021-03-06 22:44:18 +01:00
NiLuJe
b75ea3da03
ReaderFooter: Fix some interactions between margins and text width (#7391) 2021-03-06 19:23:12 +01:00
NiLuJe
d243097d75
ScreenSaver: Delay footer/header repaint if screensaver_delay is enabled (#7334)
Fix #7327
2021-02-24 00:36:05 +01:00
poire-z
a192a335f1 Footer: tweak auto refresh code
Make it similar to how it's been done recently for CRe
alt status bar, avoiding scheduling when not needed.
2021-01-31 22:39:01 +01:00
poire-z
49e2d91afb Don't toggle the footer when toggling the top status bar 2021-01-30 19:07:12 +01:00
NiLuJe
df0bbc9db7
Tame some ButtonTable users into re-using Buttontable instances if possible (#7166)
* QuickDictLookup, ImageViewer, NumberPicker: Smarter `update` that will re-use most of the widget's layout instead of re-instantiating all the things.
* SpinWidget/DoubleSpinWidget: The NumberPicker change above renders a hack to preserve alpha on these widgets almost unnecessary. Also fixed said hack to also apply to the center, value button.

* Button: Don't re-instantiate the frame in setText/setIcon when unnecessary (e.g., no change at all, or no layout change).
* Button: Add a refresh method that repaints and refreshes a *specific* Button (provided it's been painted once) all on its lonesome.

* ConfigDialog: Free everything that's going to be re-instatiated on update
 
* A few more post #7118 fixes:
  * SkimTo: Always flag the chapter nav buttons as vsync
  * Button: Fix the highlight on rounded buttons when vsync is enabled (e.g., it's now entirely visible, instead of showing a weird inverted corner glitch).
  * Some more heuristic tweaks in Menu/TouchMenu/Button/IconButton
* ButtonTable: fix the annoying rounding issue I'd noticed in #7054 ;).

* Enable dithering in TextBoxWidget (e.g., in the Wikipedia full view). This involved moving the HW dithering align fixup to base, where it always ought to have been ;).

* Switch a few widgets that were using "partial" on close to "ui", or, more rarely, "flashui". The intent being to limit "partial" purely to the Reader, because it has a latency cost when mixed with other refreshes, which happens often enough in UI ;).

* Minor documentation tweaks around UIManager's `setDirty` to reflect that change.

* ReaderFooter: Force a footer repaint on resume if it is visible (otherwise, just update it).
* ReaderBookmark: In the same vein, don't repaint an invisible footer on bookmark count changes.
2021-01-29 00:20:15 +01:00
Jason Benwell
41ab04b49e
Fix crash attempting to set compact items in status bar (#7172) 2021-01-19 21:07:56 +01:00
Jason Benwell
cd6e2d9975
Make status bar prefix compact items a bit more compact (#7153)
For battery level, show icon only
Reduce separator between items to " " from "  "
2021-01-16 15:30:43 +01:00
NiLuJe
dffe86dfe9
Cleanup eye-gouging madness around io.read calls (#7149)
* Don't reinvent the wheel when reading a one-line int or string from sysfs

* Simplify a whole other bunch of read calls
2021-01-16 04:41:46 +01:00
Jason Benwell
f53fa1d323
[UX] Footer: add prefix option "Compact items" (#7127)
For a compact layout, with removed/shortened spaces.
2021-01-12 02:04:15 +01:00
zwim
8991ec1372
Align wording of AltStatusBar menu to the bottom one (#7130)
Also change to "Font size (%1)"
2021-01-10 19:37:51 +01:00
zwim
1a61e79a2c
Add menu to configure the top/alt status bar in crengine (#7107)
Allows toggling from the UI some crengine settings
related to the top status bar (which previously could
be done by editing cr3.ini).
2021-01-07 21:22:40 +01:00
NiLuJe
1925f6e653 ReaderFooter:
* Flush mode to settings ASAP when an unrelated option updates the mode.
    Fixes, among other things, *enabling* the progress bar while the status
    bar is hidden: this showed it, but kept mode as "off".
  * Don't stomp on the current mode when toggling the progress bar.
    And *always* pop the status bar back up to see the difference, even if
    it's hidden.
    This used to be done only when *enabling* the progress bar.
2021-01-06 20:14:21 +01:00
Jason Benwell
32b28c0b80
Footer: add "Pages left in book" as footer item (#7047) 2020-12-31 23:48:16 +01:00
NiLuJe
32bf53cfdf
ReaderFooter: Don't duplicate a 12h clock time format option (#6973)
* ReaderFooter:
	* Honor the global twelve_hour_clock setting, instead of
	  duplicating a local one.
	  (Re #6969)

* os.date is a thin wrapper around strftime, so we might be able to get
away with some not-quite-standard extensions...

These are *definitely* supported on Linux, but are *NOT* the glibc
extension (that'd be e.g., %-I), so, hopefully, they're somewhat
portable...

They are also supported on BSD/macOS.
They are *not* supported by the MS UCRT. That means MinGW-w64, too.
This *appears* to be supported on current Bionic (it might even support
said glibc format altering extensions).

* And of course, Windows is terrible, so, make this terribly ugly to not
break it there...

* Turns out BSD also supports the dash trim format extension, so, leave
the trimming to the libc, and handle the special-casing in a way that
doesn't create stupid locals.

* Random unrelated cleanup ^^.

(https://gitter.im/koreader/koreader?at=5fd24be492aa1c4ef5d11f31)

* Update the testsuite

(Because the default used to be 24h clock).

Changed the default to 24h clock ;p.

* Explain why we don't try to fix it in Lua
2020-12-12 10:44:35 +01:00
NiLuJe
493eab92c9
[RFC] Make default UI tapzones more generous (#6918)
* Top menu & bottom menu tapzones are now full-width, thanks to the now sane override system.
* A separate, extra tapzone was also created for each of them to provide a taller, but narrower tapzone extension (one that doesn't clash with the prev/next tapzones).
* The footer tapzone was made much taller.
2020-12-03 17:33:54 +01:00
NiLuJe
0ae86fc0ec
ReaderFooter: Cleanup some more messy dimensions handling (#6898)
Some stuff was still hacked on manually instead of trusting the widget system to do things right, which it does, if you update the right stuff at the right time the right way ;). *This Is The Way*.

Fix #6893 (and address https://github.com/koreader/koreader/pull/6878#discussion_r523411883, because it was indeed redundant ^^).

Includes a bonus fix for a number of (footer) settings not being applied immediately in PDFs.
2020-11-22 04:52:03 +01:00
Jellby
5e3c554dd7 Hide non-linear fragments
Add option to hide (skip) non-linear fragments, only working
in 1-page mode. Tweaks mostly to footer, toc and skim code
to make it clear(er) which pages belong to linear or non-linear
fragments.
2020-11-18 18:28:47 +01:00
Jellby
dba7112390
Footer: ensure minimum height for the in-fill in progress bar (#6878) 2020-11-18 13:06:36 +01:00
Galunid
25cfef3f6d
Fix wording in previous commit (#6862) 2020-11-09 22:45:27 +01:00
Galunid
8a5c2e3af6
Add menu item allowing users to disable "hold on footer to show Skim Widget" (#6852) 2020-11-09 20:16:53 +01:00
NiLuJe
a393137273
Another round of ReaderFooter fixes (#6830)
* When auto_refresh_time is enabled, don't actually refresh anything when the footer is hidden.
* Fix a bunch of state tracking related to height computations, meaning `getHeight()` is now actually accurate, always, and we don't need shitty workarounds anymore.
  * `footer_container.dimen.h` *includes* the progress bar, so, never reset it to 0 unless the progress bar is disabled (some `settings.progress_bar_position` codepaths were mistakenly doing just that).
  * More aggressively set/reset `footer_text.height` (not sure this one makes much of a difference, and/or if it's actually useful at all, but, the tracking was already there, but hella inconsistent, so, just fix it).
* Honor `settings.reclaim_height` in other bits of code that were only checking `footer_visible` to figure out the visible page area.
* Ask ReaderView to update the `visible_area` *now* when toggling the footer's visibility (for ReaderPaging).
2020-10-27 16:48:34 +01:00
NiLuJe
dfe3502b91
ReaderStatistics: Data collection improvements (#6778)
* Update the data collection format & handler to make it much less tortuous
* Update the pagecount & resync the stats on document layout changes
* Update the database schema to allow doing most queries against a SQL view that rescales the collected data to be accurate regardless of document layout (thanks to @marek-g for the SQL magic ;)).
* Add a "reset stats for current book" entry in the list of reset options, one that won't horribly break stats in said book ;).
* Fixed a couple of resource (SQL connection) leaks (in ReaderStatistics:getCurrentBookStats & ReaderStatistics:getCurrentBookStats).
* Flush stats to the DB on periodical metadata saves.
* Minor cosmetic tweaks to the code
2020-10-15 05:31:21 +02:00
NiLuJe
0295bfa124
ReaderFooter: Make the wonky "hide me if I'm off" behavior consistent and user-configurable. (#6754)
* ReaderFooter:
	* Make the wonky "hide me if I'm off" behavior consistent and user-configurable.
2020-10-06 05:25:37 +02:00
NiLuJe
e17a0d4068
Don't generate separators for empty generators (#6752) 2020-10-05 16:18:31 +02:00
NiLuJe
e169b34577
Fancier Wi-Fi status icons in ReaderFooter (#6725)
* In icons mode, just use two different icons to display Wi-Fi status

* Enable Wi-Fi status icon on Kobo & Cervantes, too

* Refresh footer on (dis)connect if the Wi-Fi status item is enabled
2020-09-29 01:06:41 +02:00
NiLuJe
1ac5846eff
Revamp ToC ticks handling (#6716)
Replace the level `0` `getTocTicks` heuristic with a simple sorted, deduped flat listing of *every* ToC node (via `getTocTicksFlattened`).
2020-09-27 22:25:16 +02:00
Frans de Jonge
a5089f0272
[i18n] Add missing bookmark count translation (#6692)
Cf. <https://www.mobileread.com/forums/showpost.php?p=4037153&postcount=8>.
2020-09-21 20:52:40 +02:00
NiLuJe
592e4f42df
Hilariously simpler fix for #6616 (#6650)
* Hilariously simpler fix for #6616

Reverts #6648 for a much, much simpler solution, that will actually
cover every possible situation automagically.
2020-09-13 19:00:03 +02:00
NiLuJe
e0546d0fc8
Prevent automatic footer refreshes from drawing the footer on top of stuff that isn't ReaderUI (#6648)
* Prevent refreshing the footer automatically where it doesn't make sense to.

Issue exposed by #6540
Fix #6616
2020-09-12 22:57:53 +02:00
smartscripts-nl
16ece06d45
[UX] Add bookmark count as footer item (#6629)
Optionally display number of bookmarks in footer. If no bookmarks defined, don't show this item
2020-09-05 14:54:53 +02:00
poire-z
bafc52afd1 util: adds util.secondsToHour(), util.secondsToDate() 2020-08-29 20:07:26 +02:00