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

54 Commits

Author SHA1 Message Date
Frans de Jonge
6ed58346a1
[i18n] Add translator notes (#5250)
Thanks to <https://github.com/koreader/koreader/pull/5237> we can now  extract the knowledge currently embedded in Transifex and put it directly in our source. This positively affects <https://github.com/koreader/koreader/issues/3754>.

Translation instructions and knowledge that comes out of localization-related questions should be preserved in the source, because Transifex is too ephemeral. For example, the links from <https://github.com/koreader/koreader/pull/2290> are no longer accessible. Even when they are, it's quite useful to have this information around while dealing with the code as well, and I also hope it'll be informative to contributors who seldom visit Transifex.

This commit also makes a few minor changes to obviate the need for comments where possible.
2019-08-24 09:25:38 +02:00
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
2019-08-23 19:53:53 +02:00
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
2019-08-22 17:11:47 +02:00
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
2019-08-22 00:12:53 +02:00
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
2019-08-05 18:38:10 +02:00
NiLuJe
2011cf1ad1 Various blitting related cleanups (#4789)
* Fix the "Enable debug logging" checkbox so that it properly disables "Enable verbose debug logging" when it gets disabled
* Avoid asking ImageWidget for alpha-blending when it's not useful
* Make ImageWidget's alpha-blending code-path double-check that alpha-blending actually is needed, and avoid it if possible
* In the same vein, only do alpha-blending in textboxwidget when absolutely necessary
* Prefer color constants over the gray() method, ensuring that they're part of the eInk palette

Depends on https://github.com/koreader/koreader-base/pull/853

Fix #4774
2019-03-14 20:58:45 +01:00
poire-z
0948a4b656 cre: tweak current page highlights detection
No need to use current page and xpointers. We can use
'pos', in both scroll and page modes, as it is always
accurate to show the y of the current view.
2019-03-13 22:18:04 +01:00
poire-z
2c98c81a0d
cre: fix highlights in 2-pages mode (#4753)
Also check for boxes in the 2nd page when in 2 page modes
(and fix onTapXPointerSavedHighlight(), too quickly cut
and pasted from drawXPointerSavedHighlight() recently).
Bump crengine and cre.cpp to correctly returns rect for
the first line of the 2nd page.
2019-03-07 22:13:30 +01:00
poire-z
918f296bd3 cre scroll mode: fix highlights not shown when small pages
The idea of looking for highlights 1 page before and after
was not working when you have multiple small pages, and
some scroll mode view was actually showing 3 or 4 pages.
So, rework that by using absolute positions when looking
for highlights present in the scrolled view.
2019-02-26 09:43:35 +01:00
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)
2019-02-11 03:28:46 +01:00
NiLuJe
abc6d17a25
A few minor fixes after #4541 (#4561)
* Enforce dithering in PicDocument
* Ensure we'll get a flashing update on ScreenSaver exit
2019-02-08 18:31:40 +01:00
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)
2019-02-07 01:14:37 +01:00
poire-z
895589ddaa
Page overlap menu (cre): set nb of overlap lines (#4538)
Make this existing setting tunable with a menu item.
Also make the Page overlap and Highlight menus use a
checkbox, and their items grayed out when disabled.
2019-02-03 11:17:27 +01:00
NiLuJe
f6743a45db
Proper Forma support (#4414)
* Enforce a known rotation on startup, to make sure we handle touch input coordinates properly.
* Proper FrontLight warmth support (thanks to @cairnsh & @pazos in #4291)!
* Fix the PageTurn buttons mapping to match Nickel's defaults
* Properly remap PageTurn buttons depending on the current rotation.
* Actually enable the Mk.7 screen refresh codepath on *all* Mk.7 devices (I'd messed up the device check...).
* Full accelerometer handling (includes a touch of refactoring regarding orientation handling in general).
* Fix insidiously broken USBMS behavior in Nickel after we exit on FW >4.8.

Fix #4291
Fix #3002
2018-12-28 04:32:42 +01:00
poire-z
6ab34c6d1d cre highlights: draw segments instead of word boxes
It gives a cleaner drawing of multi-lines selected text.
Bump base and crengine.
2018-10-08 22:04:50 +02:00
poire-z
2697a30166 [fix] Optimize cre highlights onTap and drawing (#3508)
drawXPointerSavedHighlight() and onTapXPointerSavedHighlight were
looping thru all credocuments highlights, which was expensive.
Now, we first check with cheaper getPageFromXPointer() the highlights
are on the current page before doing more expensive stuff.

Closes #3503.
2017-11-20 21:58:58 +01:00
poire-z
26def92983 credocument reader optimisation (avoid multiple TOC builds) (#3292)
Avoid unnecessary work in ReaderView:onSetViewMode() and
ReaderRolling:updatePos() that would result in TOC being reset
and rebuilt (which can take time on books with huge TOC) during
reader setup.
2017-10-03 00:31:14 +02:00
Frans de Jonge
6815959f06 ReaderView: add long-press to set default
Fixes #2915
2017-05-24 01:46:24 -07:00
Qingping Hou
f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 2017-01-02 19:52:09 -08:00
Qingping Hou
ead5dfd9b4 readerview(feat): add registerViewModule method 2016-12-25 12:13:53 -08:00
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
2016-12-10 16:06:51 -08:00
Bastien Dejean
41764e23e8 Make page gap configurable 2016-11-05 13:16:33 -07:00
ycrichard
17e9a8e45b add kobo frontlight gesture (#2284)
* add kobo frontlight gesture
2016-10-14 11:11:35 -07:00
chrox
166aa52a24 move painting and drawing debug log to verbose 2016-08-12 17:47:35 +08:00
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.
2016-07-23 18:00:37 -07:00
Qingping Hou
726259f5a1 reader(fix): fix crash when DAUTO_SAVE_PAGING_COUNT is set to 0
* setup autoSaveSettings callback on ReaderReady event
* delay calling autoSaveSettings with UIManager:nextTick
2016-07-12 23:54:01 -07:00
Qingping Hou
a10a4f65a5 minor: use predefined color instead of gray method 2016-07-10 23:25:32 -07:00
chrox
551857ce6e fix some luacheck warnings 2016-06-28 00:43:23 +08:00
Qingping Hou
0f3eeb24c9 progressbar(fix): persist progressbar visibility 2016-04-28 01:25:18 -07:00
Qingping Hou
c22a3747d8 fix all the tests 2016-04-19 00:01:28 -07:00
Qingping Hou
11d5b5c0a1 fix(readerlink): restore reader view context on go back 2016-03-27 16:01:56 -07:00
Qingping Hou
2d5222ef33 readerview: add get/set methods for view context 2016-03-27 15:39:59 -07:00
Qingping Hou
1ede9d03f1 fix: avoid initializing readerfooter multiple times
This will create multiple autoRefreshTime function and crash the reader on exit
2016-03-07 22:50:32 -08:00
Qingping Hou
b63ddb8736 fix: kill in fly hinting event on document close 2016-02-16 23:26:08 -08:00
Qingping Hou
59c17ef420 minor: more luacheck fixes 2016-02-15 01:33:48 -08:00
chrox
35abf4bfaf move minibar configurations to reader menu
and fix #1446 by adding progress percentage in minibar.
2015-03-12 14:35:49 +08:00
Hans-Werner Hilse
05503791b4 issue a full refresh when changing rotation 2014-12-05 21:25:32 +00:00
Hans-Werner Hilse
82c26b1f18 adapt widgets to new refresh/repaint API 2014-11-30 00:17:50 +00:00
chrox
548e830fdc fix crash when highlighting text in EPUB documents
Since the new Screen:getSize modthod returns a regular table
instead of a Geom which is set to the dimen field of readerview,
there is no copy method in the dimen field. And we don't need to
copy dimen any more since the result won't be modified. Even the
screen page area somehow needs to be modified, the caller of this
function should make a copy of that variable by itself.
2014-11-25 11:02:33 +08:00
Hans-Werner Hilse
22697adf20 switch from scaleByDPI() to scaleBySize() 2014-11-23 12:13:32 +00:00
chrox
ee3c5525f9 add an option to show an arrow to indicate page overlap 2014-11-17 21:45:14 +08:00
chrox
307bbe8675 fix #1142 by adding 'show page overlap' option for EPUB doc
And 'show page overlap' option is disabled in "page" mode for EPUBs,
and in fit to page/*height zoom mode for PDFs.
2014-11-13 12:37:20 +08:00
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.
2014-11-02 21:19:04 +01:00
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.
2014-10-24 13:48:42 +02:00
chrox
07ae0cba81 fix #1011
The #1011 bug is caused by the `contains` check of link box with
visible area. When the link is at the very right (left?) of
the page, enlarged link box often exceeds the page bound rendering
the mentioned `contains` check failed. This patch uses an `intersectWith`
test to check if the link is in current page.
2014-10-21 17:26:16 +08:00
chrox
d30709edb0 add djvu render mode options in readermenu 2014-10-15 20:31:24 +08:00
chrox
e714caed8d refactoring restoreScreenMode from readerview to filemanager
This should fix #983.
2014-10-12 17:26:36 +08:00
chrox
d7fa72e46c negative x panning if writing direction is set right to left
so that in right to left writing/drawing system the right part
of the page is drawn first
2014-08-06 22:06:38 +08:00
WS64
f259e3d92d remember saved default value for screen mode 2014-07-17 19:22:54 +02:00
chrox
27b15b7020 restrict highlight in current page area
This should fix #588.

Highlight in multiple pages is too complicated and requires large
code refactoring and will not be considered for now.
2014-07-02 17:46:55 +08:00