Commit Graph

69 Commits (24424e505eab617949ed34e8d4bf8c1a2d4097cc)

Author SHA1 Message Date
poire-z 24424e505e Update UI layout code to use new SVG icons
- Add IconWidget, use it for icons instead of ImageWidget.
  Specify icons by name only, look for them (with either
  .svg or .png suffixes) in multiple directories (including
  koreader/settings/icons/ to allow customizing them).
  Don't crash when icon name not found, shown a black
  background warning icon instead.
- Don't trust the icons' native sizes: replace
  scale_for_dpi=true with width/height=DGENERIC_ICON_SIZE,
  so all icons get the same (tunable) size - except in
  a few specific use cases.
- Top and bottom menu bars: normalize, and have icons
  properly centered in them, extend vertical line
  separators up to the edges.
- TOC: adjust expand/collapse icons size to items size
3 years ago
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.
3 years ago
Jellby f892d4559f Fix typos 3 years ago
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
4 years ago
NiLuJe ec3ec8dc21
Show full ToC entry on hold (#6729)
Fix #6728
4 years ago
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`).
4 years ago
NiLuJe 0e27963ae7
Minor flash tweaks after #6528 (#6540)
* Boundaries are now detected both when paging forward and backward.

Fixes potential false-negatives in the chapter boundary heuristic code, as mentioned in https://github.com/koreader/koreader/pull/6528#issuecomment-678610188 ;).

* Tweaked ReaderFooter to not repaint ReaderUI when it's unnecessary. (toggling/cycling it on a page with significant image content would flash the full screen).

* Only flash the first time a page w/ significant image content is shown. (Menus, among other things, could otherwise re-trip the flash).
4 years ago
NiLuJe b5d3305876
A few e-Ink flash rate QoL tweaks (#6528)
* Add an option to *always* flash on chapter boundaries

* Optionally, in flash on chapter boundaries mode, also flash on the *second* page of a chapter.

(There's often a large river at the top of the page on a chapter's first page)

* In CRe, request a flashing update when there is significant image content on the page.

* Register all refresh rate related options in Dispatcher, making them available in Gestures & Profiles.
4 years ago
yparitcher 6671d984ed
SetNightMode event & Night Mode refresh rate (#6386)
If the user has not set a separate refresh rate for night mode
the default one will be used, as was the previous behavior

Closes: #5019
Closes: #6094
4 years ago
yparitcher 70f89c4df1
ReaderGesture: cleanup (#6292)
convert all gesture actions to use events for better modularity
add network event handlers and device event handlers
4 years ago
poire-z 9385728769
Bookmarks prev/next via gestures: add location to stack (#6306)
Was correctly done when jumping bookmarks via the Bookmarks
menu and the SkimTo widget, but not from gestures.
Also prevent fillToc() on each page turn when book has no TOC.
4 years ago
Galunid cd440acdc4
Add chapter title when exporting notes in Evernote (JSON/HTML, remote) (#6146)
closes #4566
closes #6138
4 years ago
poire-z 5536ce996a CRE: use same marks in top and bottom progress bars
Feed to crengine the same ticks (build from the TOC
entries) that we use in the bottom status bar.
(crengine otherwise builds a tick for each DocFragment,
which most often is really different than what's seen
in the bottom bar.)
4 years ago
poire-z 026140f809 Adds ReaderPageMap, to optionally show source pages numbers
bump crengine: support for EPUB3 nav toc and page maps
Includes:
- Fix lvRect:isRectInside(rc) with 0-width or 0-height rect
- TOC: parse EPUB3 nav toc, fallback to spine when no toc
- Parse and cache various hardcopy page list maps
- epub.css: hide EPUB3 <span epub:type="pagebreak"> content
cre.cpp: add a few PageMap helper functions.

Adds ReaderPageMap which will add a new menu (under TOC and
Bookmarks) that will allow:
- to list source page numbers (like a TOC)
- to show visible page labels in the right margin
- to use these source page numbers in the footer, the TOC,
  the GoTo and SkimTo widgets, and to use the source page
  number in the standard bookmark and highlight initial text.
4 years ago
poire-z 8a3d4a1d25
TOC: validate and fix misordered page numbers (#5907)
Our code expects (rightfully) the TOC items to be ordered
and to have increasing page numbers, but we may occasionally
not get that from the engines (usually, because of bugs or
duplicated IDs in the document).
Check for that and fix page numbers (possibly making them
wrong) to have a working TOC.
4 years ago
poire-z 7952fa2c09 [RTL UI] update widgets and apps for UI mirroring
Small tweaks all around to handle UI mirroring:
- swap existing symbols like arrows, or use alternative ones
- rotate some images, like chevrons and dogear icons
- flip some left and right swipe handling
- flip some geometry arithmetic like tap on left or right
  side of page or dict window
- use new ProgressWidget:getPercentageFromPosition() instead
  of geometry arithmetic
- BD.wrap() some concatenated string bits, like in reader
  and menu footers
- flip inverse_reading_order when UI is mirrored

More specific tweaks:
- ReaderGesture: reset some specific gestures when UI direction
  has changed (tap on top/bottom left/right corners, for
  bookmarks and FileManager "Plus menu").
- ReaderRolling: show markers on the correct side of page,
  in single or dual page mode.
- KoptOptions: swap left and right icons in Alignment toggle
- CheckMark: proper rendering in all 4 mirroring/rtl combinations.
- VirtualKeyboard: forbid any mirroring
- Move util.getMenuText into Menu.lua
4 years ago
poire-z 0f3f2b660b TOC: baseline align chapter name and page number 5 years ago
Frans de Jonge 728bb187fa
[UX] Gesture manager: add two-finger swipe left and right (#4815)
Also add Device:hasMultitouch() to control whether the configuration menu is shown.

Cf. #4727.
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
poire-z 850be52177
Keep some menus open when Tap or Hold (#4189)
TouchMenu: added options to menu items with the following defaults:
    keep_menu_open = false
    hold_keep_menu_open = true
So, default for Tap callback is to close menu, and for Hold callback
to keep menu open.
In both cases, provide the TouchMenu instance as the 1st argument to
the callback functions (instead of a refresh_menu_func I added in #3941)
so the callback can do more things, like closing, refreshing,
changing menu items text and re-ordering...

ReaderZooming: show symbol for default (like it was done for
ReaderFont, ReaderHyphenation...)
TextEditor plugin: update the previously opened files list in real
time, so the menu can be kept open and used as the TextEditor main
interface.
SSH plugin: keep menu open and update the Start/Stop state in real time
ReadTimer plugin: tried to do what feels right (but I don't use it)

Also remove forgotten cp in the move/paste file code
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
Robert 6abc1262dd Screen refresh between chapters (#3989) 6 years ago
poire-z 5e47a83e6a
UIManager: avoid painting widgets covered by a full screen widget (#3770)
Navigating the TOC, viewing a full screen image, browsing
reading stats... would call paintTo() on ReaderUI (so, asking
the engine to render the page) or FileManager (so, rendering cover
images) even though their content is hidden.
Widgets registering to UIManager have to explicitely states
they cover the full screen (UIManager can't know, parts of their
dimen may be transparent, e.g. if it is a CenterContainer).
6 years ago
poire-z e615345ffa TOC, bookmarks: remember current page so we can go back to it 6 years ago
Robert d163f8281d Menu: configure number of items per page, wrap entries (#3589)
Configure number of items per page (from 6 to 24) - default is 14
Allow filenames to wrap so that we can see the full name
Used by File browser, History, Search Result, Bookmarks, Table of contents (only single line), File chooser, OPDS catalog
6 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
Frans de Jonge e1aa57f27e Font: unify font styling 7 years ago
Frans de Jonge a970a1f034 MenuSorter: fix outside testability (for potential unit tests) 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
Hzj_jie f91ad679d9 swithItemTable -> switchItemTable 7 years ago
poire-z bbba2799a5 Fix: unexpendable TOC in some cases (#2394)
When on a page in a 2nd level section, after switching orientation,
TOC was stuck with the section we're in unexpandable.
8 years ago
Hzj_jie 3df363165a Fix crash in readertoc.lua
This issue has been mentioned in https://github.com/koreader/koreader/issues/2186.
8 years ago
Qingping Hou 59c17ef420 minor: more luacheck fixes 8 years ago
chrox 3a0960d391 goto current toc entry automatically when open TOC window 9 years ago
chrox 1894e71b07 don't expand toc node when it's parent node is collapsed 9 years ago
chrox e25ca27db3 auto expand the parent TOC node of current page
and fix current item of item not updated when in the last node
This should fix #1396.
9 years ago
chrox 720ab191ab fix crash when opening TOC window in scroll mode of EPUB 9 years ago
chrox 1e8f07629f don't pop-up TOC window 9 years ago
Hans-Werner Hilse 22697adf20 switch from scaleByDPI() to scaleBySize() 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
chrox 91400f8fef expand/collapse for the left one third region should be more resonable 10 years ago
chrox c994e30cff fix #1024
if toc item has expand/collapse state and tap select on the left side
the state switch action is triggered, otherwise goto the
linked page.
10 years ago
HW 3a42557b19 Merge pull request #1020 from chrox/fix_1013
fix #1013
10 years ago
chrox 1462d382d9 fix #1013 10 years ago
chrox 2ad63fc1a3 expand/collapse TOC only by tap on the icon 10 years ago
chrox c99288f3ad fix #995 by reseting readertoc on init 10 years ago
chrox 7c9130744c add collapsable TOC menu 10 years ago
chrox de38ea1199 count only leaf nodes of toc tree when level is zero 10 years ago