Commit Graph

36 Commits (ce624be8b83e880b1a81106a143e1440eeda4aab)

Author SHA1 Message Date
NiLuJe ce624be8b8 Cache: Fix a whole lot of things.
* Minor updates to the min & max cache sizes (16 & 64MB). Mostly to satisfy my power-of-two OCD.
  * Purge broken on-disk cache files
  * Optimize free RAM computations
  * Start dropping LRU items when running low on memory before pre-rendring (hinting) pages in non-reflowable documents.
  * Make serialize dump the most recently *displayed* page, as the actual MRU item is the most recently *hinted* page, not the current one.
  * Use more accurate item size estimations across the whole codebase.

TileCacheItem:

  * Drop lua-serialize in favor of Persist.

KoptInterface:

  * Drop lua-serialize in favor of Persist.
  * Make KOPTContext caching actually work by ensuring its hash is stable.
3 years ago
NiLuJe f0f69e9a7a
ReaderZooming: Fix defaults handling (#7463)
It appears the fancy split settings from #6885 were not being honored at all.

Also:

* Made sure "pagewidth" is actually the default zoom mode again, "full" had sneaked in as the default state of the zoom type toggle).
* Display human-readable values in the "Make as default" popup, instead of the raw, meaningless numerical setting.
* Disable zoom options when reflow is enabled, and restore 'em properly when it's disabled.

Fix #7461, #7228, #7192
3 years ago
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).
3 years ago
poire-z 9b11497652 KOPT bottom menu: hide it when applying Zoom options 3 years ago
John Beard 096b3176dc
Add columns to ReaderZooming paged_modes (#6970)
This means it will warn when changing to continuous mode while
zoom to columns is active.
3 years ago
Frans de Jonge 575b86593f
[chore, i18n] Remove extra quotation marks (#6927)
@jperon Did my review comment about this get lost? :-/
3 years ago
jperon 8eeb010dc9
Paged documents: rework zoom options (#6885)
- Move zoom options from top menu to bottom config
- Add option to manually define zoom (relative to
  page width) and overlap (in percent)
- Add options to zoom to columns or rows, possibly
  with overlap. Add panning direction options when
  page forward in these modes
3 years ago
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).
4 years ago
Frans de Jonge 86db43a052
[UX] Move double tap to gesture manager (#6322)
Also replaces the default with +10/-10 pages instead of prev/next chapter.

Closes <https://github.com/koreader/koreader/issues/2721>.
4 years ago
poire-z 8991540462
Reorganize bottom menu config panels (#6131)
Mostly for the PDF bottom menu.
- Reorganize by topic, trying to limit the number
  of widgets per panel to 4.
- Re-order some toggles from low to high ('off' then 'on').
- Show font size as number instead of a list of "Aa".
- PDF: add more font size values, and increase usable
  contrast values.
- Add help_text to most PDF toggle titles.
- CRE line spacing: increase fine tuning min and max.
Also avoid zoom advice messages on book load.
4 years ago
Frans de Jonge f1f6eebce0
[feat] Add MuPDF EPUB/FB2 dynamic font size (#5282)
Closes #4368.
5 years ago
Frans de Jonge a2dcfe9aec
[doc] Tag @todo, @fixme and @warning (#5244)
This commit standardizes the various todos around the code a bit in a manner recognized by LDoc.

Besides drawing more attention by being displayed in the developer docs, they're also extractable with LDoc on the command line:

```sh
ldoc --tags todo,fixme *.lua
```

However, whether that particular usage offers any advantage over other search tools is questionable at best.

* and some random beautification
5 years ago
Frans de Jonge da988c15de
[CI] Switch to custom xgettext build to extract multiline strings (#5242)
Because let's face it, it just looks much better this way.

Docker image update in https://github.com/koreader/virdevenv/pull/43

Discussion in https://github.com/koreader/koreader/pull/5238#issuecomment-523675211 and https://github.com/koreader/koreader/pull/4524
5 years ago
Frans de Jonge e2ceace302
[fix, CI] Push to Transifex from master, fix multiline strings for xgettext (#5238)
Related to https://github.com/koreader/koreader/pull/5237
5 years ago
Frans de Jonge ec6e34cb1e
Change default zoom mode & add warning message for fit page + scroll (#5170)
* [UX] Change default zoom mode to page width

Fixes #5166.

* Warning popup for weird scroll mode combinations
5 years ago
Frans de Jonge ca6c7316e6
[fix] ReaderZooming: work around tiles that are too large (#4608)
Zooms out until a page can fit in the cache. It's a bit ugly, but better than being stuck. Fixes #3491.
5 years ago
Frans de Jonge a2c47b35de
[UX] Gesture manager: add paged zoom gestures (#4610)
References #4333.
5 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
FranMarelli 229c492979 [feat] Two-column navigation (#3674)
New zoom configuration available among the others
Allows to easily navigate in two-column documents
In order to  work properly, **scroll mode must be deactivated**
The best zoom is obtained with proper cropping around the two columns (should be the default one for content-width)

Fixes #501
6 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
Qingping Hou f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 7 years ago
Qingping Hou 558754e9b5 footer(refactor): various bug fixes and optimizations 8 years ago
Qingping Hou cf3c91d92e Merge pull request #2079 from Hzj-jie/master
ReaderZooming should remove the size of page footer when calculating zoom value
8 years ago
chrox 5983050d79 PDF free zoom mode revisit
this should implement feature request of zoom mode for multi-columns
page in #501
This PR depends on koreader/koreader-base#435

How to use?
1. Tap the top left corner of a PDF/Djvu page to get into the flipping
mode
2. Double-tap on text block will zoom in to that column
3. Double-tap on any area will zoom out to an overview of the page
4. repeat step 2 to focus to another page block

How does it work?
1. We first find the mask of text blocks in the page. (Pic 1)
2. Then we intersect page boxes with user tap to form a page block. (Pic 2)
3. Finally we zoom the page to the page block and center current view to
that block. (Pic 3)
8 years ago
Zijie He ac6ccc0038 ReaderZooming should remove the size of page footer when calculating zoom value. 8 years ago
chrox 35545169a6 zoom mode is meaningless when reflowing, so disable zoom mode options in reflow mode 10 years ago
Frans de Jonge 693fa0837e Reworked several strings
This is the remaining gruntwork of #1276. I believe that only leaves networkmgr.lua and filemanagersearch.lua, which will require a little more thought.
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 834c994ed8 fix #970
by rendering full page if bbox is larger than native page size when
zooming mode is fit to content*
10 years ago
chrox 0615e1463f easier strings to translate 10 years ago
chrox a92ca26bea hold on zoom mode menu entry to set default zoom mode 10 years ago
chrox 9119d12e17 use checked/unchecked for zooming options 10 years ago
chrox 857bd6fcc8 strings not shown on GUI will not be translated
This may encourage users in transifex to join Koreader project.
10 years ago
Qingping Hou 4b357c1466 move reader code into frontend/apps/reader
it makes more sense to completely separate the UI framework and
application code

also move frontend/ui/configurable.lua to frontend/configurable.lua
10 years ago