Commit Graph

153 Commits (37a01100b7a4733ae26871c4d929114aff8ea143)

Author SHA1 Message Date
NiLuJe 33946aa732
Some FL regression fixes after #4901 (#4921)
* Make hasNaturalLight* caps safe to call without a device check. (fix #4919)
Make it clear that it's expecting the NTX implementation, though.
* Don't turn the FL on on resume if it was off on suspend
* Make sure turnOn/turnOff actually updates hw_intensity in the process where it matters, instead of just in a short lived fork ;). (fix #4923)
5 years ago
poire-z 7396abebf2 [chore] reformat all gestures "overrides" to be diff friendly 5 years ago
NiLuJe b72a2000b1
A few minor fixes after #4847 (#4850)
* Add a toggle to disable the C blitter in the Dev menu (depends on https://github.com/koreader/koreader-base/pull/882) (never shown if the JIT is disabled, grayed out if the C blitter is not installed)
* Fix a few sizeUtf8Text call sites that were doing a nil check in order to account for the new return type.
* Tweak statusbar handling to avoid spurious sizeUtf8Text warnings when it's hidden, and unify its behavior between being hidden via toggle, and hidden on book open (at least when all-at-once is not enabled).
* c.f., https://github.com/koreader/koreader-base/pull/882 (Android, PB, RGB32 & Legacy Kindle regression fixes).
5 years ago
Frans de Jonge 614cbb509d
[fix] ReaderFooter: Don't hide progressbar if it's the only ticked option (#4648)
Fixes #3914.

Cf. #3056.
5 years ago
NiLuJe b274080846
Some more repaint/refresh tweaks (#4578)
* ReaderView & ReaderPaging panning should *probably* keep using "partial" ;). (Fix #4575)
* Try to avoid unnecessary footer repaints (mini status bar)
5 years ago
NiLuJe 812e595608
Enable HW dithering in a few key places (#4541)
* Enable HW dithering on supported devices (Clara HD, Forma; Oasis 2, PW4)
  * FileManager and co. (where appropriate, i.e., when covers are shown)
  * Book Status
  * Reader, where appropriate:
    * CRe: on pages whith image content (for over 7.5% of the screen area, should hopefully leave stuff like bullet points or small scene breaks alone).
    * Other engines: on user-request (in the gear tab of the bottom menu), via the new "Dithering" knob (will only appear on supported devices).
  * ScreenSaver
  * ImageViewer
* Minimize repaints when flash_ui is enabled (by, almost everywhere, only repainting the flashing element, and not the toplevel window which hosts it).
  (The first pass of this involved fixing a few Button instances whose show_parent was wrong, in particular, chevrons in the FM & TopMenu).
* Hunted down a few redundant repaints (unneeded setDirty("all") calls),
  either by switching the widget to nil when only a refresh was needed, and not a repaint,
  or by passing the appropritate widget to setDirty.
  (Note to self: Enable *verbose* debugging to catch broken setDirty calls via its post guard).
  There were also a few instances of 'em right behind a widget close.
* Don't repaint the underlying widget when initially showing TopMenu & ConfigDialog.
  We unfortunately do need to do it when switching tabs, because of their variable heights.
* On Kobo, disabled the extra and completely useless full refresh before suspend/reboot/poweroff, as well as on resume. No more double refreshes!
* Fix another debug guard in Kobo sysfs_light
* Switch ImageWidget & ImageViewer mostly to "ui" updates, which will be better suited to image content pretty much everywhere, REAGL or not.

PS: (Almost 💯 commits! :D)
5 years ago
poire-z f8199dd493
Fix a few edge cases crashes and issues (#4334)
- ReaderConfig does not need to call again self:initGesListener() on
  screen rotation/resize, as it uses the TouchZone infrastructure
  that deals itself with rotation. So, it was adding new gestures
  that were overriding tap on footer and preventing it from working.
- ReaderFooter: fix refresh area (which was too small when toggling
  from hidden to visible)
- ReaderToc: fix crash when showing TOC in scroll mode after rotation
- Menu: fix crash when no onReturn defined (could happen when tap on
  bottom left corner when showing an empty TOC)
6 years ago
Martín Fernández 1e69fae7bc [feat] Add support for BQ/Fnac devices (#4294)
Adds support for devices found in https://blog.bq.com/es/bq-ereaders-developers-program/. Tested on BQ Cervantes 4 (last BQ device from 2017).

It adds a new touch input event handler (discussed in #4275) which should work on other single touch devices (ie: Kobo Touch, Mini, Glo, Aura HD) but wasn't tested.

Includes base bump with: [feat] Add BQ/Fnac device support (https://github.com/koreader/koreader-base/pull/745)
6 years ago
poire-z 233f375af4 Cleanup onSetStatusLine()
Follow up to fa0117bb (#4268), to make things a bit clearer:
Only ReaderRolling get the 'SetStatusLine' event, and tells
crengine about the change, and then send the 'UpdatePos' event.
ReaderFooter now just gets a :setVisible() method.

Now, all the code that calls a self.ui.document:set* method, that
most probably triggers a full re-rendering by crengine, do signal
'UpdatePos' immediately after. This event signals that all page
number, pages count, positions... are no more valid and must be
queried or computed again.
This could also be used if we ever want to cache Page Links or
Screen Boxes: this event will have us dropped these caches.
6 years ago
poire-z fa0117bb2a Fix default not being used for View mode and Progress bar
Default setting set by holding on the bottom config buttons
for "View mode" (scroll/page) and "Progress bar" (full/mini)
were not used.

Also, when switching Progress bar from 'full' to 'mini',
show the mini bar again.
6 years ago
Robert a8e4ce8b01 Footer: launch SkimTo (instead of GoTo) on long-press (#4097) 6 years ago
poire-z c3a938aad6
bump crengine: alternative TOC, no page break on borders (#4011)
Includes:
- Avoid page break between a node and its borders
- Allow building an alternative TOC from document headings

On CRE documents, allows toggling between original TOC and an
alternative TOC with long-press on the "Table of content" menu
item.

Also update the Wikipedia stylesheet to further avoid
page-breaks between images and their caption, so a full
bordered wikipedia thumbnail is always full on a single page.
6 years ago
poire-z 82b13a64b0
Fix overlap in scroll mode for cre documents (#3870)
Use a setting 'copt_overlap_lines' (default to 1) for the
number of text lines from previous page to show on next
page (instead of a hardcoded and unscaled 20).
Take footer height into account for overlap calculation
and dim area.
Show overlap only when changing pages (not when panning).

Also fix ReaderFooter:getHeight() which was returning
a higher height than the real one since footer refactoring.
6 years ago
Frans de Jonge 96242648c8
[UX] apps/reader/modules/readerfooter: also redraw progressbar on height change (#3780) 6 years ago
mwoz123 a01271b8a6 [Android] Wifi status in footer (#3396)
Implemented through the Android API so it's reasonably cheap.
7 years ago
poire-z 2fc8076139 Better vertical centering of text in its box
Decide baseline vertical position according to font metrics, instead
of the hardcoded 0.7 (in textwidget, which made the text a little
bit up in its box), and 0.75 (in toggleswitch, which made the text a
little bit down in its box). This usually gives a value around 0.72
or 0.73 with our ui fonts, which looks about right.
ReaderFooter: add bottom padding, now that our text goes a few pixels lower
7 years ago
poire-z b483c54be8 Fix footer, stats, TOC position with cre in scroll mode (#3304)
This gives the page position to these modules even in scroll mode.
Also, in readerrolling: don't query battery/charging status
when crengine does not need it (used only when it shows its top
progress bar).
7 years ago
Robert 2c3936ddb4 Refactoring readerfooter statistics - TB and TC (#3223) 7 years ago
Robert 40ec848098 Remove % from frontlight level on devices other than Kobo (#3162) 7 years ago
Robert 0e2d20353a Statistics plugin v2 (SQLite) (#2893) 7 years ago
Robert 1bfad22af0 Fix: Footer hides text (#3056)
This patch should resolve issue #2257 (Footer hides text)
Sometimes, depending on an epub style, some text is hidden by the progress bar (the mini one at the bottom).
7 years ago
Robert 21c63a297e Gesture to show only config menu (#3051)
* Gesture to show only config menu

* Show config menu from bottom
7 years ago
poire-z 64f699ba36 Store book metadata and nb of pages in new settings
They may already be available (with other statistics stuff) under
the 'stats' key, but not if Statistics plugin is disabled. As this
plugin may be migrated to SQLite, readerui and readerfooter will now
set two new properties: doc_props (containing all and only the metadata
returned by document:getDocumentProps()) and doc_pages (updated
by readerfooter on any display or font change).

PDF document: returns additional PDF properties: Keywords
and Subject (as Description).
7 years ago
Hzj_jie d83de47204 Add onFrontlightStateChanged event (#2966)
So we do not need the hacky solution in KoboLight plugin anymore. PageFooter can receive and process the event itself.
7 years ago
Hzj_jie 53eb4dee50 AutoFrontlight plugin (#2941)
* Add AutoFrontlight plugin

* Add configuration to control autofrontlight feature
7 years ago
Frans de Jonge 89099e2c94 Swipe for menu and quickstart guide (#2761)
* Swipe for menu and quickstart guide

Because swiping for the menu is a big change from what we're used to, this commit includes a new quickstart guide.

Fixes #2608.

* add some dev docs
* add FileConverter spec
* add QuickStart spec
* add Version module
* add Version spec
7 years ago
robert00s 7872bd3bc1 Fix: Frontlight level in Status bar in Kobos without light 7 years ago
Qingping Hou 15fd7fc0ff bring back support for disabling progressbar in footer (#2753)
* footer(optimize): remove dead code

* footer(fix): disable auto refresh time option when current time is not checked

* fix: support disable progress bar again
7 years ago
Frans de Jonge 92b9139294 ReaderFooter (lang): "Show toc markers" to "Show chapter markers"
I think it sounds more natural as chapter than as table of content, which is an implementation detail (i.e., the chapter markers are shown based on what's in the TOC).

Also removed redundant "this" from "Remaining pages in this chapter"
7 years ago
robert00s ba74921c4b Fix showing footer on Kindle with Special Offers screensaver 7 years ago
Frans de Jonge b076ca1c29 ReaderFooter: fix quick browsing by tapping footer in flipping mode
Fixes #2649.
7 years ago
Frans de Jonge 8f31a81601 MenuSorter: some documentation
MenuSorter: forgot to add plugin style change

MenuSorter: worked out the final quirks

* Menu always compressed into tables without missing indexes for ipairs compatibility
* Orphans attached
* Separators no longer count as items
7 years ago
Frans de Jonge b7b5950e98 MenuSorter: review comments and various bug fixes
* fixed wrongful retention of submenus variable and added return to MenuSorter:findById
* fixed readerfooter_spec.lua error
* fixed review comments
7 years ago
Frans de Jonge 5b20106db7 MenuSorter: initial implementation
* Menus are now sanely configurable
* Custom separator placement for clearer menus
7 years ago
robert00s a2bfc3858d changes after comments 7 years ago
Qingping Hou fc12ee6537 decouple reader footer from dictquicklookup widget & translation fix (#2664)
* chore: fix strings for translations

* dictionary(chore): decouple reader footer from dictquicklookup widget
7 years ago
poire-z 39d1afe37d Update footer when refreshing screen with diagonal swipe
And added diagonal swipe support to readerrolling.
7 years ago
poire-z 4316284260 Footer: added "memory usage" item
Helps following KOReader memory usage (and memory leaks).
7 years ago
Qingping Hou 9b7aba3fba fix: override readerhighlight hold in readerfooter
Also fix touch zone dependency graph generation code.

ReaderHighlight has now been migrated to use touch zone

Inputcontainer's touch event handling logic changed to only stop
propagation when handler returns `true`. Previously, it stops
propagation when a handler is found. This is needed to support
both readerhighlight_tap and tap_forward touch zones.
7 years ago
Qingping Hou ead5dfd9b4 readerview(feat): add registerViewModule method 7 years ago
Qingping Hou d2743b6f15 fix: migrate readermenu to use touch zone 8 years ago
Qingping Hou 0c49b915de refactor: add touch zone subsystem to inputcontainer
Touch zone decouples screen size from gesture event registration.

The win here is each individual widget does not need to update
gesture range on screen rotate/resize anymore.

Another advantage is we now have a centralized ordered array to handle
all registered touch event listeners, makes it much easier to resolve
gesture range conflicts between multiple widgets.

This patch also includes the following changes:

* migrate readerpaging to use readerui's touch zone
* migrate readerfooter to use readerui's touch zone
* move inverse read direction setting to touch menu's setting tab
* moved kobolight widget from readerview into readerui
* various dead code cleanups and comments
8 years ago
Qingping Hou 8799b4b6b1 doc: geometry module 8 years ago
Dimitrios Semitsoglou-Tsiapos b87ce7fe12 footer: update when toggling markers 8 years ago
Qingping Hou 558754e9b5 footer(refactor): various bug fixes and optimizations 8 years ago
ycrichard f3149b0b2c add frontlight information in the footer including context menu 8 years ago
Qingping Hou 1c5543358c readerfooter(fix): avoid setting mini footer to invisible when full progress bar is on
Our previous assumption is user will only choose between full or min
bar. The does not hold anymore as many more info has been added to the
mini bar and sometimes user might want to have both of them on. This
patch makes the reader behavior consistent when both bars are set to be
on for a document.
8 years ago
chrox ad88192d85 fix #2054 by removing ticks max limitation 8 years ago
Qingping Hou f71534e399 readerfooter(fix): only populate footer info after document is loaded 8 years ago
Zijie He 882a815f6c Use default font if settings.reader.lua does not provide one. Provide a Toggle button if readerfooter gesture actions are disabled. 8 years ago
Qingping Hou 0f3eeb24c9 progressbar(fix): persist progressbar visibility 8 years ago
Qingping Hou 0226efc4cd readerfooter(minor): just incase self.pages is nil 8 years ago
Qingping Hou f48d9bd6d9 fix(readerfooter): marker ticks initialization 8 years ago
Qingping Hou adc7ddccfc test: start every test suit with a clean reader setting 8 years ago
Qingping Hou 1683023f2c refactor(readerfooter): optimization and bug fixes
* avoid unnecessary initialization
* really fix the crash caused by autoRefreshTime....
* responsive progress bar layout
8 years ago
Qingping Hou 1ede9d03f1 fix: avoid initializing readerfooter multiple times
This will create multiple autoRefreshTime function and crash the reader on exit
8 years ago
Qingping Hou d4254e5266 fix: unschedule auto refresh footer task on document close 8 years ago
Qingping Hou 11ee8d6fcc refactor: use new KeyValuePage widget for displaying statistics 8 years ago
chrox 41d3642467 add auto refresh time option for status bar, close #1769 8 years ago
Qingping Hou e19f73bdba style(util): rename tablelength to tableSize 8 years ago
Qingping Hou 55234ef899 fix: read stats crashes pdf/djvu documents 9 years ago
Qingping Hou ffd438de18 fix(ReaderFooter:getDataFromStatistics): return na if book has no stats history 9 years ago
Alex Pletnev 6bf9d75807 #1750 TB feature/statistics issue
Change time to read book formula to: ((total_read_time / read_pages) * (all_pages - current_page))
9 years ago
Alex Pletnev ce4e32e01c #1723 Add time to read into the status bar
Add new statuses:
TB - book time to read
TC - chapter time to read

Fix backward compatible in statistics plugin
9 years ago
NiLuJe ce5f66ccbc Prefix battery percentage w/ a + when charging.
Adresses comments on MR.
Add a comment explaining the magic behind CRe's charging icon when using
CRE's full (top) status bar.
9 years ago
NiLuJe 50dbf6b581 Switch a few widgets to ui refresh modes
More closely matches native behavior on REAGL devices.
Closing those widgets should still trigger a partial refresh though,
because we usually get back to the reader, and text, so we want REAGL
;).
9 years ago
chrox 0788709f26 Popup goto dialog only when holding on visible status bar 9 years ago
chrox ff3a42e503 typo fix of #1462 9 years ago
chrox 3224eb1797 fix inproper variable name for pages left 9 years ago
chrox 35abf4bfaf move minibar configurations to reader menu
and fix #1446 by adding progress percentage in minibar.
9 years ago
chrox eea6f97796 fix #1319 10 years ago
Hans-Werner Hilse 745e3837e0 updating the screen in tap handler of readerfooter is not needed
Was a hack anyway, c.f.
https://github.com/koreader/koreader/pull/1306#discussion_r21057461

Seems to be not needed anymore. If some areas are now not refreshed
anymore, that ought to be fixed in another place.

This also gets rid of redundant screen flashes.
10 years ago
Hans-Werner Hilse 82c26b1f18 adapt widgets to new refresh/repaint API 10 years ago
Hans-Werner Hilse 22697adf20 switch from scaleByDPI() to scaleBySize() 10 years ago
chrox a65dcb4c0d find the finest toc ticks by sorting out the largest one 10 years ago
chrox 3e7ca5706e fix #1121 10 years ago
NiLuJe 1063ee74e5 Fix flipping mode refreshes
Don't do regional footer refreshes when we're in flipping mode.
There's probably a more elegant/correct way to handle this, but this
does the job ;).
Fix #1140
10 years ago
NiLuJe 041f11cba0 Tweak some comments 10 years ago
NiLuJe e2e99e5d99 make RedaerFooter updates regional 10 years ago
Hans-Werner Hilse 3066c86e38 Refactoring hardware abstraction
This is a major overhaul of the hardware abstraction layer.
A few notes:

General platform distinction happens in
  frontend/device.lua
which will delegate everything else to
  frontend/device/<platform_name>/device.lua
which should extend
  frontend/device/generic/device.lua

Screen handling is implemented in
  frontend/device/screen.lua
which includes the *functionality* to support device specifics.
Actually setting up the device specific functionality, however,
is done in the device specific setup code in the relevant
device.lua file.

The same goes for input handling.
10 years ago
Hans-Werner Hilse 5982e24d57 unify color specification
colors were a mixture of 4bpp integers (0=white, 15=black) and
fractional blackness levels (0=white, 1.0=black) before. This is
now unified to use the color specification of the Blitbuffer API.
10 years ago
chrox 0a863f07c7 show 50 ticks on the mini progress bar at most 10 years ago
chrox b09bb87d4e refactoring readertoc and readerfooter
so that they don't repeat themselves.
10 years ago
Ebrehem 44ecf74ba3 Update readerfooter.lua 10 years ago
NiLuJe e2efb230a6 Make the geometry of the minibar user-configurable
As well as the width of the toc notches
Lower the default value of the container size a bit to avoid eating into
the last line on small borders setup (I checked on 167 & 212 DPI
devices, Feel free to revert to the previous value (19) if that causes
trouble).
10 years ago
WS64 844ae29fe5 Send TOC parameters to progressbar 10 years ago
WS64 969734931b progressbar can be turned off in mini bar 10 years ago
chrox 51ba4f987a fix no battery info on minibar for PDF documents
This should fix #757.
10 years ago
chrox beaf768250 recalculate footer sizes when document page count is updated 10 years ago
chrox ce266bffb8 add minibar height into overlap height 10 years ago
WS64 af400bbe1e Added battery info to mini bar 10 years ago
WS64 79f1b027f0 Minor optimizings (elseif) 10 years ago
WS64 0429325c5f removed "next chapter" for PDFs
Should actually also be done for EPUBs without TOC, but somehow I can't get it to work
10 years ago
WS64 00c050f279 Update readerfooter.lua 10 years ago
WS64 c50a0f701b Update readerfooter.lua 10 years ago
WS64 ec16a3f745 Update readerfooter.lua
Add "pages left to next chapter" to minibar
10 years ago
chrox 1fd45c3903 add tap zone configuration for the minibar 10 years ago
chrox 53a41c0ce8 adapt reader footer for small screen 10 years ago
chrox 1d292f16a9 remove full screen option in koptoption
since we can now switch progress bar status simply by tap
10 years ago
chrox 6938b54346 enlarge touch zone for readerfooter 10 years ago