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

4122 Commits

Author SHA1 Message Date
Martín Fernández
5ec0b049d9
Add deprecation messages to plugins (#7101)
And deprecate Goodreads plugin.
2021-01-07 23:15:32 +01:00
poire-z
6c23d29a8a ReaderDictionary: tweak timings if interrupted quickly
Rework b66d0be3 and 6205f260 by making that simpler
to comprehend:
- If interruption or search result window is shown in
less than 3 secondes: no specific tweak, a tap outside
will dismiss everything instantaneously.
- If done after 3 seconds: show the interruption or result
window, and discard input for a few 100ms.
- UIManager:discardEvents(): increase a bit default delays.
2021-01-07 23:10:24 +01:00
poire-z
02ac2c4ce6 DictQuickLookup: re-add "tap on title" to set as preferred dict
Restore feature removed in c98dfef7: tap on title
to set dict of current result as a preferred dictionary
for this document.
Changes from former implementation:
- trust sdcv for ordering, instead of doing it ourselves
  by looking at the results (which didn't always work)
- allow setting multiple preferred dicts
- order of preference is shown with a number as a prefix
  to the dictionary name in the title
- taping again allows removing it from preferred dicts,
  and taping again allows setting it back as the first
  preferred dict
2021-01-07 23:10:24 +01:00
poire-z
dc80321688 Search: fix matches not highlighted on current page
Regression (typo from cut and paste) from 7bd59330.
2021-01-07 23:10:24 +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
yparitcher
dc964f3941
reader.lua: rework file/directory argument handling. (#7053)
platform: do not pass a directory on the command line.
The home directory will be properly set by Device.home_dir.

It was sometimes crashing when opened with no args.

Fixes: #7049
2021-01-07 20:38:10 +01:00
NiLuJe
34b764dc06 Kindle Legacy: Probe for SO on the K3 & K4 2021-01-06 20:14:21 +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
NiLuJe
f67296942f ScreenSaver:
* Don't try to expand a screensaver message without any special tokens
  * Don't needlessly nil the background when show_message is true
    Honor the actual nil background setting, now that we've got one.
    Also, only clear covers_fullscreen with no background *and* no widget.
  * Support special tokens outside of ReaderUI. Because the undocumented
    "Oops, I'll use the fallback otherwise" was extremely not
    user-friendly.
2021-01-06 20:14:21 +01:00
NiLuJe
b119e29218 NetworkActivity: Fix an exceedingly unlikely crash.
If you're *extremely* unlucky, the scheduled check might run *right*
after a wakeup, before the network interface is up. So, you have a
previously stored packet count, but the new one is nil. Boom.
2021-01-06 20:14:21 +01:00
NiLuJe
5ae5c99197
Legacy Kindle: Unbreak screensavers (#7112)
* The K2 & DXg cannot be SO, so, bypass the check there

* Handle native screensavers on FW 3.x & 4.x
2021-01-06 16:50:58 +01:00
poire-z
eb66856d81
CRE: allow both Top/Bottom margins fine tuning (#7104)
By having the same DoubleSpinWidget launched when
hitting "..." on any of Top margin or Bottom margin
progress bars.
DoubleSpinWidget: remove blank space when no info_text.
2021-01-02 23:15:48 +01:00
poire-z
6205f26047 Dict, Trapper: prevent dismissal by past events
Add UIManager:discardEvents(), to allow dropping events
for a period of time.
Default duration of 600ms on eInk, 300ms otherwise.
Used when showing the dict result window, so that a tap
happening just when it's being shown won't discard it.
Used with Trapper:confirm()/:info(), to avoid taps made
in a previous processing to dismiss (and so, select the
cancel action) a ConfirmBox not yet painted/visible.
2021-01-02 11:50:32 +01:00
poire-z
b6323f15fc DictQuickLookup: hold prev/next buttons go to first/last result 2021-01-02 11:50:32 +01:00
poire-z
aedab2d695 Dict/Wiki lookup: less text cleanup on manual input
Don't cleanup input text as much when entered manually
(or when it's sane) than when coming from book text
selection.
This may allow looking up words like "-suffix", or
do more precise Wikipedia queries.
2021-01-02 11:50:32 +01:00
NiLuJe
5756f1f43e
LuaJIT on Android fixes (#7094)
* Don't flag Android as should_restrict_JIT

And allow disabling the C blitter, to put the workaround to the test...

* Add a -d, --debug flag to the log function

Catches KOReader's debug, as well as (our) dlopen & luajit logging

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/283
https://github.com/koreader/android-luajit-launcher/pull/282

* Bump base

(https://github.com/koreader/koreader-base/pull/1279)
2021-01-02 03:00:39 +01:00
NiLuJe
a5468ba385 Fix opacity of the dictionary window
Brainfart from 6162c287e8

Forgot to zap the original UIManager:show(), so we were stacking two
identical widgets on top of each other, which obviously affected alpha.

Re #7029
2021-01-01 13:35:10 +01:00
Jason Benwell
32b28c0b80
Footer: add "Pages left in book" as footer item (#7047) 2020-12-31 23:48:16 +01:00
poire-z
f96585ece8
htmlToPlainText(): tweak format paragraphs with indentation (#7095)
Rework dafaf966, with a tabulation instead of multiple
  to ensure a constant indentation when text
is justified.
2020-12-31 23:23:05 +01:00
poire-z
c98dfef7fc DictQuickLookup: various tweaks
- Rework widget layout to avoid implicit (and wrong)
  sizing, using proper padding/margins and correct
  measurements of components.
- Adjust lookup word font size so it's not smaller
  than the definition.
- Tweak small window positionning: keep it centered
  if possible, only move it to keep the highlighted
  word shown when we can.
- Large window: adjust to screen size correctly,
  leaving room for footer.
- Always have a "Close" button at bottom right.
  Former always displayed button "Follow link" will
  be added as a 3rd row in the rare case we select
  a word in a link.
- Replace "tap on lookup word to edit and redo the
  query" with an icon on the right: tap on it to
  edit the queries word, long-press to edit the
  current result word. Only close the current dict
  window when lookup is launched.
- Remove feature "tap on title to set current dict
  as the default dict for this document", as it didn't
  really work, and it was bad UX.
2020-12-31 13:28:08 +01:00
poire-z
b66d0be3f9 ReaderDictionary: show nothing if interrupted quickly
If interrupted quickly just after lookup launch, don't
display anything (this might help avoiding refreshes
and the need to dismiss after accidental long-press
when manipulating the device).
2020-12-31 13:28:08 +01:00
poire-z
cac7db1a1c InfoMessage: allows being drawn only after a delay
- InfoMessage: add an option show_delay.
- MovableContainer: avoid possible crash when
  not yet painted.
- ReaderDictionary: use show_delay=0.5 instead of
  scheduleIn(0.5n...) (a5b133da) as we need the
  InfoWidget to be known to UIManager to catch tap
  and allow interrupting lookups properly.
- ReaderDictionary: rework handling of no_refresh_on_close
  (6162c287) with proper regions comparisons
2020-12-31 13:28:08 +01:00
poire-z
dd74194e0a cre.getWordFromPosition(): fix a few issues
Drop the use of crengine's getWordFromPosition() which
is a bit unreliable: it may returns wrong coordinates,
or words from far away in the book (ie. when holding
in the margins).
Rely only on the robust getTextFromPositions() that
we already use for multi words selection.
Having good coordinates allows refreshing a smaller region
(the higlighted word, or the 2 lines if hyphenated).
2020-12-31 13:28:08 +01:00
John Beard
0e494169f2
Keyboard input in InputText (#7037)
For text input, use the SDL events, which contain the decoded
strings.

Still handle keypresses for non-text input.
2020-12-30 22:26:40 +01:00
John Beard
fca87b5b3a
UI: Clicking menu icon returns to top of menu (#7074)
Fixes: #6940
2020-12-29 23:08:49 +01:00
Glen Sawyer
3bd3493014
Fix double-pressing reMarkable 2 power button twice to wake up (#7065) 2020-12-28 19:09:10 +01:00
Glen Sawyer
578f92e424
Time-adjust on all reMarkable events, not just EV_ABS (#7066) 2020-12-28 19:08:28 +01:00
gbyl
d2379fc6e6
remarkable: poweroff.png ghosting fix (#7051) 2020-12-27 14:13:23 +01:00
Frans de Jonge
a96181d74f
Fix typo in "remove bookmark?" (#7062) 2020-12-27 14:10:43 +01:00
John Beard
12d1604a75
UI: Make button radius match default window radius (#7054) 2020-12-26 22:49:57 +01:00
NiLuJe
f1f439d08b
More Android trickery (#7059)
* Modernize jit syntax

It's built-in, no need for a require anymore.

* Flag Android should_restrict_JIT again

It's mildly helpful at putting off the inevitable.
(very, very, very, very mildly).

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/281
2020-12-26 20:23:51 +01:00
Frans de Jonge
b8bed49a61
Pass dict_path to dictionary fix_html_func (#7057)
That way images can be made to work in a more generic, portable manner, such as:

```
return function(html, dict_path)
    html = html:gsub('<rref[^>]*>([^<]*%.jpg)</rref>', '<img src="'..dict_path..'res/%1">')
    return html
end
```

Cf. <https://github.com/koreader/koreader/issues/6056>.
2020-12-26 18:30:19 +01:00
yparitcher
4548ced866
Quickstart: add long press sets default (#7048)
add wiki reference
2020-12-26 12:46:14 +01:00
Frans de Jonge
53909db687
Close Lua state on all os.exit() calls (#7050)
Cf. <https://github.com/koreader/koreader/pull/7044>.
2020-12-25 16:19:16 +01:00
NiLuJe
21af9144ab
Don't paint invisible background-colored rounded corners (#7046)
* Don't paint invisible background-colored rounded corners

Made obvious when testing #7042

* Only enforce a highlight radius on buttons that don't already set a
custom one ;).

(Mostly, square buttons with a 0 radius ^^).

ffi/blitbuffer already handles radius being nil, which suits us just fine
:)
2020-12-25 00:39:13 +01:00
Frans de Jonge
dafaf966e4
htmlToPlainText(): Format paragraphs with indentation (#7027)
Cf. <https://www.mobileread.com/forums/showthread.php?p=4072308#post4072308>.
2020-12-24 15:38:18 +01:00
Frans de Jonge
ad08ce9849
OPDS: Inform and warn about downgrade attack (#7032)
Fixes <https://github.com/koreader/koreader/issues/7007>.
2020-12-24 15:37:19 +01:00
Galunid
d5103bddc3
Add fall back to text selection option to panel zoom (#6960)
* Add fall back to text selection option to panel zoom
* Add functions to allow per extension settings
2020-12-24 09:07:27 +01:00
yparitcher
b2b9b49859 ReaderActivityIndicator: fix isStub()
it was being overridden by the EventListener:new

caused by #7002

c.f. https://www.mobileread.com/forums/showthread.php?t=335886
2020-12-23 23:49:53 -05:00
yparitcher
405c48b6ea Show only 1 End Document Dialog at a time
if scrolling past the end of a document the EndOfBook event get fired once per scroll (a lot)
2020-12-23 23:43:54 -05:00
yparitcher
c3fd6ae38b Margins: allow direct input (more_options) 2020-12-23 23:42:34 -05:00
NiLuJe
d845741b15
Android: Don't mark the platform as should_restrict_JIT (#7024)
* Android: Don't mark the platform as should_restrict_JIT

And see how much stuff breaks \o/

* Prevent Android users from disabling the C blitter, regardless of the
restrict flag

* Update android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/278
https://github.com/koreader/android-luajit-launcher/pull/275
2020-12-24 02:37:03 +01:00
NiLuJe
09c1f35191
rM: Unbreak PowerEvents (#7043)
Most of this is scheduled with delays for reasons, so this was a stupid
idea, my bad ;).

Fix #7033
2020-12-24 02:36:05 +01:00
NiLuJe
7df60ba0e4
OPDSBrowser: Update the title during navigation (#7034)
* OPDSBrowser: Update the title during navigation

Fix #7030
2020-12-23 14:35:54 +01:00
NiLuJe
b78d9c1576
Menu: Clear path history on close (#7028)
Move the the paths table outside of the class, make it per instance instead
2020-12-23 00:24:16 +01:00
Frans de Jonge
d355e6482d
Revert ManyBooks and Flibusta to HTTP (#7031)
Cf. <https://github.com/koreader/koreader/issues/7007>.
2020-12-22 21:47:26 +01:00
NiLuJe
a15106fcc6
NetworkManager: Slightly more accurate wifi strength icons (#7020)
* Update lj-wpaclient to get more consistent link quality values out of it
* Simplify wifi strength icon selection
2020-12-21 18:48:33 +01:00
NiLuJe
f5a7541dbb
[UX] Use a full-width plus for buttons paired with a unicode minus (#7018)
U+FF0B vs. U+002B

Because otherwise it is not, in fact, the same width as the minus, which looks weird in buttons ;).

Re #3840 & #6939
2020-12-20 20:47:40 +01:00
poire-z
9f25dc75a0
IconWidget: fix user icons directory path (#7019)
Should be `DataStorage:getDataDir()` instead of `DataStorage:getSettingsDir()`.
(`koreader/icons/` instead of `koreader/settings/icons/`) https://github.com/koreader/koreader/pull/6977#discussion_r546375434
2020-12-20 20:45:55 +01:00
NiLuJe
f4e2878a3c
Implement proper alpha-blending of SVG icons (#7011)
* Implement proper alpha-blending of SVG icons

Also, instead of doing that every time, cache a pre-composited version
that matches the screen's BB type.
This is faster, and also has the advantage of making icon highlights
behave.

Jot down a few notes about corner-cases or future improvements, e.g.,
dimming icons on non-white backgrounds, and nightmode with color icons.
2020-12-19 22:34:16 +01:00