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

7189 Commits

Author SHA1 Message Date
poire-z
dc8696bd34 TextBoxWidget: add new properties, use them in Menu
- height_adjust: if true, reduce height to a multiple of
  line_height (for nicer centering)
- height_overflow_show_ellipsis: if height overflow, append
  ellipsis to last shown line
(Implemented in both use_xtext and legacy code path.)

Use them in Menu.lua to clean up/shorten the code used for multiline
menu items by delegating the work to TextBoxWidget, or using
TextWidget when we end up needing only a single line.
2019-11-16 18:41:14 +01:00
poire-z
e699a1ee22 TextBoxWidget: use xtext for text shaping
Alternative code to size, split lines and draw text with
the help of the xtext Lua C module.
Enabled by default (can be disabled via an added menu
item in "Developer options").

New properties can be specified by calling widgets, only
used when xtext is used:
- lang: use specified language instead of the UI language
- para_direction_rtl: true/false to override the default
  direction for the UI language
- auto_para_direction: detect direction of each paragraph
  in text
- alignment_strict: prevent the inversion of the specified
  alignment= that is done when a paragraph direction is
  set or detected as RTL.

Also: fix possible memory leak (present even when not using xtext)
by calling :free() in onCloseWidget() like it's done in ImageWidget.
2019-11-16 18:41:14 +01:00
poire-z
22e3e34c45 TextWidget: use xtext for text shaping
Alternative code to size and draw text with the help
of the xtext Lua C module.
Enabled by default (can be disabled via an added menu
item in "Developer options").

New properties can be specified by calling widgets, only
used when xtext is used:
- lang: use specified language instead of the UI language
- para_direction_rtl: true/false to override the default
  direction for the UI language
- auto_para_direction: detect direction of each paragraph
  in text
2019-11-16 18:41:14 +01:00
poire-z
c2e2c00db6 Font rendering: add some helpers for use by xtext
bump base for libkoreader-xtext.so:
- ffi/pic.lua: fix memory leak with some unsupported PNG files
- FreeType ffi: add methods for use with Harfbuzz shaping
- thirdparty: adds libunibreak
- Adds libkoreader-xtext.so: enhanced text shaping

Add a getFallbackFont(N) to each Lua font object to instantiate
(if not yet done) and return the Nth fallback font for the font.

Fallback fonts list: add NotoSansArabicUI-Regular.ttf

Add RenderText:getGlyphByIndex() to get a glyph bitmap by glyph
index, which is what we'll get from Harfbuzz shaping.
(RenderText:getGlyph() works with unicode charcode).
2019-11-16 18:41:14 +01:00
poire-z
272d8857a2 TextBoxWidget: fix two minor bugs 2019-11-16 18:41:14 +01:00
poire-z
0fb780ea21 PicDocument: log reason of opening failure 2019-11-16 18:41:14 +01:00
Robert
679b592c80 [UX] Add Mark as read to end of document action (#5596) 2019-11-16 14:51:21 +01:00
NiLuJe
b21b4c8776
Update nerdfonts symbol codepoints for the updated version with no PUA (#5595)
* Update nerdfonts symbol codepoints for the updated version with no PUA conflicts

Should no longer stomp on Arabic & CJK PUA stuff.
2019-11-15 19:06:35 +01:00
Robert
e166a77eba [UX] Gesture to open Favorites (#5592)
Close: #5576 
+ default multigesture east - west - east -> open `Favorites`,
+ ability to add new gesture to open `Favorites`
2019-11-14 15:00:05 +01:00
Frans de Jonge
2855fdfdac
[feat] Support callback function in VirtualKeyPopup (#5588)
Required for <https://github.com/koreader/koreader/pull/5583>.
2019-11-11 23:10:27 +01:00
Frans de Jonge
35154b8d56
Bump base for [fix] Prevent undefined symbol error on SDL < 2.0.9 (#5587)
Fixes https://github.com/koreader/koreader/issues/5570 for real this time. ;-)
2019-11-11 16:57:41 +01:00
Frans de Jonge
3550672a5e
Bump base (#5586)
Includes:

* [fix] LuaRocks 2 and 3 compat (#1004)
* [fix] Revert Android Noto patch (#1007)
* [fix] Don't crash on SDL < 2.9 (#1008)
2019-11-11 15:14:46 +01:00
Frans de Jonge
425c808c18
[UX] Switch ButtonTable to COLOR_GRAY (#5585)
Same as the menu.

See <https://github.com/koreader/koreader/pull/5584>.
2019-11-11 10:05:28 +01:00
yparitcher
816b197ab9 [UX] Thicker loading bar (#5581)
The current thickness for the loading bar when opening a document is to thin to really see on my KT4,
2019-11-10 21:27:49 +01:00
yparitcher
83b7d8de2b [UX] Default setting option always enabled (#5580)
as per https://github.com/koreader/koreader/pull/5522#issuecomment-548006595 do not grey out the current default
2019-11-08 21:01:38 +01:00
Robert
98555908c8 [fix] Enable rewind button in sort widget (#5579)
See: #5578
Close: #5578
2019-11-08 10:26:41 +01:00
Frans de Jonge
9bc1c6f40d
Add CODEOWNERS file (#5559)
A bit of an experiment with GitHub functionality.

Teams can be added like `@koreader/kobo-dev` but that doesn't seem too much use to us right now.
2019-11-07 20:39:50 +01:00
Robert
2ae91ac6f6 [fix] Prevent crash on local calibre OPDS server (#5572)
Close: #5476 
- Prevent segmentation fault when we enter incorrect address of calibre opds server (eg http://192.168.1.1:8080/ instead of proper http://192.168.1.1:8080/opds
- prevent unnecessary infos in Gutenberg OPDS
2019-11-07 20:37:02 +01:00
poire-z
0885e9947d Keyboard: avoid additional key stroke on hold release (#5573) 2019-11-06 21:26:17 +01:00
Frans de Jonge
dc4453eb7f
[fix, plugin] Don't show full widget together with isOnline() (#5575)
Fixes https://github.com/koreader/koreader/issues/5415

Cf. https://github.com/koreader/koreader/pull/5452 https://github.com/koreader/koreader/pull/5573 https://github.com/koreader/koreader/pull/5574
2019-11-06 21:02:41 +01:00
Frans de Jonge
f0b2d58342
Revert "Fix frozen confirmbox when keyboard shown (#5452)" (#5574)
This reverts commit 513fd807b0.
2019-11-06 21:02:27 +01:00
Martín Fernández
f1f75c5cb0 android: touchscreen toggle option (#5564) 2019-11-06 00:52:44 +01:00
Robert
371e3336a5 [feat] Favorites: organize book into collections (#5527)
View, add, remove, sort, open book to/from collections.
For now, only one collection named Favorites.
2019-11-06 00:17:28 +01:00
poire-z
04ce1836d8 Avoid double flash when switching or reloading document (#5568) 2019-11-04 16:44:13 +01:00
poire-z
4462380048
Wikipedia lookup results: fix page turning when image loading (#5560)
Tapping to turn page while some image is loading was
interrupting the image loading, but not turning the page,
since a82d7832 where using trap_widget=false is to be
used to not resend the event (while =nil does resend it).
2019-11-02 02:30:12 +01:00
poire-z
6baa2af5fb
cre: use 'best' (Harfbuzz) as the default kerning method (#5553)
It might be slower, but is needed to properly display
books in arabic, indic...
Also bump crengine: use FreeType "light" hinting algorithm,
which hints on the y-axis only (and so avoid messing with
advances and kerning on the x-axis).
2019-11-01 23:07:41 +01:00
poire-z
16c021a76a
CoverBrowser: fix files_per_page setting type (#5556)
Avoid saving/getting "12.0" (as the lua-ljsqlite3 driver does),
and save/get "12" instead by properly converting it to a string
and back, as the config.value table column is of type TEXT.
2019-11-01 11:29:11 +01:00
poire-z
eb8795e4e0
ButtonTable: taller buttons for easier tap (#5554) 2019-11-01 01:52:05 +01:00
poire-z
602a821acc
CoverBrowser: list mode: better default for files_per_page (#5551)
Don't use a hardcoded default value of 10 files per page, but
compute it from available height, as previously (this reverts
a bit from 0ecf42e9).
2019-10-31 12:06:21 +01:00
NiLuJe
a5419439ce
Bump base (#5549)
Pickup https://github.com/koreader/koreader-base/pull/1000,
https://github.com/koreader/koreader-base/pull/1001,
https://github.com/koreader/koreader-base/pull/1002,
https://github.com/koreader/koreader-base/pull/1003
2019-10-30 01:40:24 +01:00
NiLuJe
4f52c4147f
Fix a deadlock with empty settings (#5546)
* Fix deadlock on empty settings
Emulator only. Was stuck looping forever on directory == base == .
2019-10-30 00:27:54 +01:00
Frans de Jonge
34090c2f22
[fix, Android] Crash on startup when no homedir is set (#5548)
By calling the function instead of returning it. Fixes #5547.
2019-10-29 17:56:21 +01:00
NiLuJe
21c5d58685
Allow access to the topmenu clock format even if !Device:setDateTime() (#5543) 2019-10-28 22:42:07 +01:00
NiLuJe
61a8b63757
Minor fixes after #5537 (#5538)
* Restore '+' prefix when charging in the footer w/ letters prefixes

Regression since #5537

* Don't use a full battery icon in the menu entry

Make it clear that one isn't in-sync with the current gauge
2019-10-27 19:10:25 +01:00
Robert
7b6a3f3cb2 [fix] Handle max_width in time widget (#5540)
Set max_width like in #5503
2019-10-27 18:30:39 +01:00
NiLuJe
8d281647ae
Unify battery meters look'n feel (#5537)
* Unify battery meters look'n feel

Switch to proper (vertical) battery icons (one per 10% steps).

Fix #5535

* Bump fonts (https://github.com/koreader/koreader-fonts/pull/7)

Because we need the new symbols from nerdfonts ;).
2019-10-27 05:22:17 +01:00
NiLuJe
9f7bc356ba
Bump base (#5536)
Final (hopefully) Darwin build fix.
2019-10-26 22:16:04 +02:00
Robert
dec0e73a7b [statistic plugin] Don't generate md5 sum on open document (#5528)
There is no need to generate a md5 sum for documents that were already opened.
2019-10-26 09:08:57 +02:00
NiLuJe
39b532b85b
Bump base (#5532)
Pickup https://github.com/koreader/koreader-base/pull/997 & https://github.com/koreader/koreader-base/pull/998

The most user-visible fix being startup in non-standard orientations on
the Libra no longer being broken ;).
2019-10-26 02:17:39 +02:00
Frans de Jonge
dd5ba70418
[i18n, fix] Update l10n dir with initialized Transifex (#5531)
Not required for the nightly build, but without 47e47c5fae the push fails.
2019-10-25 18:35:54 +02:00
yparitcher
40d6a7665b [fix] Typo in #5522 (#5530) 2019-10-25 18:33:26 +02:00
yparitcher
aa165cefe9 [UX] Set global settings independent of local setting (#5522) 2019-10-25 17:25:26 +02:00
yparitcher
6c68df42ec [feat] Open unsupported documents as text (#5497) 2019-10-23 23:15:30 +02:00
poire-z
0ecf42e995
CoverBrowser: list mode fixes and tweaks (#5525)
- Use a hardcoded default value of 10 files per page.
- Save cover sizetag as "s<nb of items per page>" instead
of "s<item height>" so they are stable (and not re-fetched)
when switching between FileBrowser and History, which have
some small geometry differences.
- When showing History in landscape mode, decrease perpage
from the set value, so items don't look smaller.
- Use a step, larger with big items, when iterating and decreasing
font sizes to make text fit, to speed up the process a bit.
2019-10-23 22:54:14 +02:00
poire-z
f38073c1e9 (test master branch protection - please ignore) 2019-10-23 00:17:35 +02:00
Jörg Derungs
946595fa46 CoverBrowser: select nb of items in Detailed list mode
New menu options:
- Detailed list mode: select nb of items per page
- Series: new option to show it on a separate line
2019-10-22 23:49:04 +02:00
Robert
c7ecd08d9d Menu: new algorithm for multi-lines items (#5496)
(used by bookmarks list and classic file browser)
When text is too long or line too tall:
first: we try to decrease the number of lines (eg from 3 to 2 and from 2 to 1 line)
second: when 1 line is too tall, we try to decrease font size (-1)
And at the end we try to add or remove chars to better fit text.
2019-10-22 12:48:47 +02:00
NiLuJe
eae105bb72
Minor dev documentatioon tweaks (#5518)
* Made Porting not so hilariously outdated.
* Minor tweaks to the macOS build instructions and the various quirks involved in getting it to behave (and accompanying actual build fixes).
2019-10-22 01:25:00 +02:00
Frans de Jonge
d1cd5e7ad4
[i18n] Enable Arabic and Esperanto (#5515)
Unfortunately I missed that Arabic has had a few hundred translated strings for a couple of months now.

Cf. <https://github.com/koreader/koreader/issues/5359#issuecomment-544460031>.
2019-10-21 18:40:40 +02:00
Frans de Jonge
b8b6abe4d4
[fix] GetText: Support Arabic plurals (#5517)
Fixes <https://github.com/koreader/koreader/issues/5516>.

Cf. <https://github.com/koreader/koreader/pull/5515>.
2019-10-21 18:29:40 +02:00