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

4073 Commits

Author SHA1 Message Date
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
Frans de Jonge
a5b133dadc
[UX] Wait 0.5s before showing "searching for" dialog (#7012)
Fixes <https://github.com/koreader/koreader/issues/3030>.

Cross-ref to <https://github.com/koreader/koreader/pull/6998>.
2020-12-19 20:02:09 +01:00
NiLuJe
642978c97c
FileManager: Make reinit slightly less hackish (#7006)
Much like #6958 did for plugins, registering listener twice was also a
big boo-boo.

Revamp the whole thing to make it slightly less hackish.
2020-12-19 16:27:53 +01:00
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
2020-12-19 14:49:18 +01:00
John Beard
3b1b9fe7cb
Radius corners of more boxes (#6997)
This gives a more uniform look than having some boxes rectangular and some
with radiused corners
2020-12-19 08:25:00 +01:00
NiLuJe
9cda84ef2f Prevent Busted from blowing up on cdata finalizers by properly closing
opened documents...
2020-12-19 06:40:00 +01:00
NiLuJe
c0981a55d9 Make sure KindlePowerD's __gc metamethod will actually be called
* Via the newproxy hack.
2020-12-19 04:16:51 +01:00
NiLuJe
e2dd68bd13 RenderImage: Fix __gc handling for GifDocument
* Via ffi/__gc, as this is a plain table.
2020-12-19 04:16:51 +01:00
NiLuJe
7f6bc28eca BookInfoManager: Convert thumbnail compression to ZSTD
* Avoid the Lua string copies when compressing/uncompressing the bb
  thumbs
* Delay the statement reset so that the pointer returned by the BLOB
  query is actually usable ;).
* Re-use a ZSTD decompression context
* Store date & mtime for successfully extracted documents
  c.f., 10477501f9 (r44914917)
* Switch to user_version pragma to handle DB schema versioning
* Update file size/date on *each* extraction attempt.
  @poirez-z raised a good point, this ought to be useful to deem a file
  re-parseable after an update.
* Remove xutil
  Functionality has been moved to ffi/zlib & ffi/zstd
* Preserve settings when migrating the BookInfo DB
* Warn via InfoMessage that the DB was updated
* Only store the series name in series, and move the index in series_index
  (Column names chosen to match Calibre's).
* Handle the new series_index column in BookInfo consumers
* This allows us to get rid of the code that stripped empty decimals
  from series index in *most* places, since it's now a real Lua
  number, and the string formatting library does that magic on its
  own.
2020-12-19 04:16:44 +01:00
NiLuJe
c1496e943b util: Simplify splitFile* util functions
* Use a single match call instead of two gsubs
2020-12-19 01:54:43 +01:00
NiLuJe
d80d6dc562 Handle the BlitBuffer struct changes
* stride is now a size_t
  On some platforms, that's 64 bits, which means it's no longer
  automatically converted to a Lua number to avoid precision loss.
  Do that ourselves, because lua-serialize doesn't know how to handle an
  uint64_t cdata ;).
2020-12-19 01:54:43 +01:00
Frans de Jonge
db9b485e2d
[chore] Minor formatting fixes (#7009)
Cf. <https://github.com/koreader/koreader/pull/6992>.
2020-12-18 23:28:39 +01:00
ddvk
77ac32d4ac
remarkable2 support (#6992)
Fixes https://github.com/koreader/koreader/issues/6792
2020-12-18 23:12:34 +01:00
NiLuJe
17356bbb2a
Kindle: Make ReaderActivityIndicator a stub (#7002)
And only actually flesh it out and register it in the very few cases
where it can actually do something (i.e., old FW 5.x with KPV).
2020-12-18 18:26:58 +01:00
Frans de Jonge
608cc04622
Fix docs (#6999)
Follow-up to <https://github.com/koreader/koreader/pull/6973>
2020-12-16 07:40:57 +01:00
NiLuJe
83e148bc9e
Tests: Make a few things more deterministic (#6991)
This way we still get the passed/expected actual values in Busted's
output

Which helps not make this any more maddening than it already is to
update...
2020-12-15 21:10:36 +01:00
Martín Fernández
a90038e4eb
Calibre plugin fixes for android (#6996)
* calibre plugin: scan on sdcard too
* calibre plugin: force inbox chooser in android's primary partition
* downloadMgr: override dir
2020-12-15 00:46:38 +01:00
NiLuJe
248e508c7e
Deal with hr/br in a single gsub call (#6995) 2020-12-14 18:47:11 +01:00
NiLuJe
a0f4015f7d
Workaround luxl's issue with self-closing tags once and for all (#6994)
* luxl and self-closing tags, once more with feeling...

Fix #6993

* More generic fix to the self-closing tag issue w/ luxl

Re #6902 & co.
2020-12-14 18:43:23 +01:00
NiLuJe
e0ac00f310
Make sure getting rid of a DPI override actually restores default behavior (#6984)
* Make switching *back* to the default DPI via auto actually work
properly.

eg., by actually setting DPI back to defaults, and clearing the override
flag.

* Bump base to pickup https://github.com/koreader/koreader-base/pull/1258
2020-12-13 01:41:44 +01:00
NiLuJe
32bf53cfdf
ReaderFooter: Don't duplicate a 12h clock time format option (#6973)
* ReaderFooter:
	* Honor the global twelve_hour_clock setting, instead of
	  duplicating a local one.
	  (Re #6969)

* os.date is a thin wrapper around strftime, so we might be able to get
away with some not-quite-standard extensions...

These are *definitely* supported on Linux, but are *NOT* the glibc
extension (that'd be e.g., %-I), so, hopefully, they're somewhat
portable...

They are also supported on BSD/macOS.
They are *not* supported by the MS UCRT. That means MinGW-w64, too.
This *appears* to be supported on current Bionic (it might even support
said glibc format altering extensions).

* And of course, Windows is terrible, so, make this terribly ugly to not
break it there...

* Turns out BSD also supports the dash trim format extension, so, leave
the trimming to the libc, and handle the special-casing in a way that
doesn't create stupid locals.

* Random unrelated cleanup ^^.

(https://gitter.im/koreader/koreader?at=5fd24be492aa1c4ef5d11f31)

* Update the testsuite

(Because the default used to be 24h clock).

Changed the default to 24h clock ;p.

* Explain why we don't try to fix it in Lua
2020-12-12 10:44:35 +01:00
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.
2020-12-11 19:28:55 +01:00
poire-z
a0eb91d6ab
Some RTL UI fix up after #6885 (#6975)
Avoid crash with RTL UI after options we moved.
Swap Zoom direction items when RTL UI.
Also don't check show_func when sizing the names
on the bottom menu, to avoid icons moving or
resizing when toggling options.
2020-12-10 23:53:33 +01:00
Martín Fernández
c481c5aa04
move unpackArchive to Device, use native version on android (#6959) 2020-12-10 16:59:14 +01:00
yparitcher
b0a1077756
FileManager: fix Plus menu override (#6957)
manage it in FM not in gestures, as  #6918 made the menu tap zone the entire width so the tap is not passed through to the gesture plugin
2020-12-07 20:30:07 +01:00
jperon
53a7067c24
FileManager: don't load already loaded plugins (#6958)
FileManager:init is called by FileManager:reinit, which caused duplicate
loads. Those can't be useful, (for example to re-load a modified plugin
on runtime), as PluginLoader:loadPlugins memoizes loaded plugins.
2020-12-07 20:29:03 +01:00
poire-z
c20ad8f5e9
RenderImage: add renderSVGImageFile() (#6950)
ImageWidget: allow picking SVG versions of provided
PNG icons if available.
2020-12-05 23:57:00 +01:00
jperon
8b7d60299f
JPG/PNG: MuPDF as default provider (#6931)
As said in #6929
2020-12-04 19:10:50 +01:00
NiLuJe
4b9627456e
Fix the frontlight gesture range scaling (#6946)
xref https://www.mobileread.com/forums/showthread.php?t=335341
2020-12-04 08:07:53 +01:00
NiLuJe
6162c287e8
ReaderDictionary: Avoid an irritating refresh when dismissing the InfoMessage (#6934)
* ReaderDictionary: Don't refresh when dimissing the lookup info
InfoMessage

Re #6932

* Fix dict_largewindow in Landscape

Have to leave some room for the UI chrome
2020-12-03 17:37:46 +01:00
NiLuJe
493eab92c9
[RFC] Make default UI tapzones more generous (#6918)
* Top menu & bottom menu tapzones are now full-width, thanks to the now sane override system.
* A separate, extra tapzone was also created for each of them to provide a taller, but narrower tapzone extension (one that doesn't clash with the prev/next tapzones).
* The footer tapzone was made much taller.
2020-12-03 17:33:54 +01:00
Galunid
059ffc0040
Fix bad authentication handling in opds browser (#6942)
Fixes #6941.
2020-12-03 15:38:31 +01:00
John Beard
5bd055206d
Use Unicode minus in ButtonProgressWidget (#6939)
Change the text in the button from a hypen (-) to a
Unicode minus size (−, U+2212). This is the same width
as the + sign.

The NaturalLightWidget and FrontLightWidget controls
already use minus signs in this way.
2020-12-02 16:21:52 +01:00
jperon
3d8342a98c
Fix #6929 (#6930)
A check was missing on a flag not defined for images.
2020-11-30 11:21:14 +01:00
Frans de Jonge
908e3ae363
[chore] Don't translate numbers (#6928)
Cross-ref to <https://github.com/koreader/koreader/pull/6885>.
2020-11-30 10:08:03 +01:00
Frans de Jonge
575b86593f
[chore, i18n] Remove extra quotation marks (#6927)
@jperon Did my review comment about this get lost? :-/
2020-11-30 09:03:23 +01:00
Martín Fdez
be2bcac28e switch between internal and external sdcard 2020-11-29 10:19:47 +01:00
jperon
1f16815f94
[chore] Get rid of ui/data/strings.lua (#6921)
As suggested [here](https://github.com/koreader/koreader/pull/6885#issuecomment-734865881)
2020-11-29 10:18:59 +01:00
NiLuJe
bba8b31e1d
AutoSave: Delay I/O until after the pageturn (#6917)
nextTick was too early ;).

Prevents small hitches when turning the page for the page where this
triggers.

Apply the same trickery to the Stats DB insert, even if that one probably
had a much smaller impact.
2020-11-28 22:59:27 +01:00
NiLuJe
931f01ef26
Kobo: Warn on restart if the startup script is outdated (#6916)
* Warn on restart if the startup script has been updated, because a restart will not reload it.

* Also warn right after the update if it contained a startup script update...
2020-11-28 22:48:09 +01:00
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
2020-11-28 17:18:57 +01:00
zwim
52f66a89d2
CoverImage plugin: enable on Remarkable and PocketBook (#6906) 2020-11-28 13:58:44 +01:00
poire-z
da95091e7b
ReaderTypography: fix language names order in menu (#6913)
Also fix just added "Latin (liturgical)" hyph filename.
See https://github.com/koreader/koreader/pull/6910#discussion_r531091283
2020-11-26 20:53:34 +01:00
jperon
16b37b5605
bump base (thirdparty, crengine), add Latin hyphenation (#6910)
Includes:
- Resync libue w/ KoboUSBMS
- Update to FBInk v1.23.0
- Update to KoboUSBMS v1.0.0
- Revert "blitbuffer: Always enable JIT workaround" (6705c028)
- BB: Ensure consistent types are being used in writePNG
- bump crengine: hyphenation: add Latin, update Esperanto
2020-11-26 16:06:46 +01:00
NiLuJe
0ae86fc0ec
ReaderFooter: Cleanup some more messy dimensions handling (#6898)
Some stuff was still hacked on manually instead of trusting the widget system to do things right, which it does, if you update the right stuff at the right time the right way ;). *This Is The Way*.

Fix #6893 (and address https://github.com/koreader/koreader/pull/6878#discussion_r523411883, because it was indeed redundant ^^).

Includes a bonus fix for a number of (footer) settings not being applied immediately in PDFs.
2020-11-22 04:52:03 +01:00
NiLuJe
960b2ae62a
OPDS*: Mangle Calibre feeds some more so that they don't confuse luxl/us (#6902)
By essentially dropping the whole XHTML block, instead of trying to salvage each and every tag one by one as we did before.

Also, as that's usually the result after broken parsing, handle nil URLs slightly better in the frontend, so that they get caught/reported properly instead of doing nothing and/or crashing half the time.
2020-11-22 04:51:32 +01:00
poire-z
dde497a0df
ReaderCropping: prettier bottom buttons (#6900)
Also remove the grey gap between the page and the buttons
that would appear only when the footer is visible.
2020-11-21 00:19:24 +01:00
Frans de Jonge
ded8ae6efb
[lang] Minor touch-up to non-linear info text (#6895)
As an aside, it should be "ToC," not "Toc." ;-)

Cf. <https://github.com/koreader/koreader/pull/6847>.

* Also fix newlines in to be translated string
2020-11-20 09:02:30 +01:00
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.
2020-11-18 18:28:47 +01:00
Jellby
f892d4559f Fix typos 2020-11-18 18:28:47 +01:00