Commit Graph

44 Commits (master)

Author SHA1 Message Date
NiLuJe da65ac8b02
Cleanup various varargs shenanigans (#9624)
* Iterate over varargs directly via select if possible
* Use table.pack otherwise (https://github.com/koreader/koreader-base/pull/1535).
* This allows us to simplify a few Logger calls, as logger now handles nil values.
2 years ago
NiLuJe 62059f8d68
Misc: Get rid of the legacy defaults.lua globals (#9546)
* This removes support for the following deprecated constants: `DTAP_ZONE_FLIPPING`, `DTAP_ZONE_BOOKMARK`, `DCREREADER_CONFIG_DEFAULT_FONT_GAMMA`
* The "Advanced settings" panel now highlights modified values in bold (think about:config in Firefox ;)).
* LuaData: Isolate global table lookup shenanigans, and fix a few issues in unused-in-prod codepaths.
* CodeStyle: Require module locals for Lua/C modules, too.
* ScreenSaver: Actually garbage collect our widget on close (ScreenSaver itself is not an instantiated object).
* DateTimeWidget: Code cleanups to ensure child widgets can be GC'ed.
2 years ago
NiLuJe b0d8919399
ImageViewer: Followup to #9529 (#9544)
* ImageViewer: Minor code cleanups
* GestureDetector: Fix the `distance` field of `two_finger_pan` & `two_finger_swipe` gestures so that it's no longer the double of the actual distance traveled. Get rid of existing workarounds throughout the codebase that had to deal with this quirk.
2 years ago
NiLuJe 49e5200c8a
Kobo: Unbreak touch input on fresh setups on Trilogy (#9473)
By making sure we setup the right evdev parser first ;).
2 years ago
NiLuJe 8e1bb9bafc
GestureDetector: Full refactor for almost-sane(TM) MT gesture handling (#9463)
Should hopefully make two-contact gestures *much* more reliable, among other things.

See the PR for all the details ;).
2 years ago
Aleksa Sarai 501a6204f8
luacheckrc: allow busted's "match" global for spec/ (#8369)
This was fixed in luacheck 0.24.0 but our CI still uses an older version
at the moment.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
3 years ago
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
3 years ago
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.
3 years ago
poire-z 962fd02c98
Tame BackgroundRunner: stop running when no more job (#6605)
A BackgroundRunner plugin instance will stop running
(rescheduling a check every 2 seconds) when there is no
(or no more) job to run.
Clients of this service now have to emit an event after
adding a job into PluginShare.backgroundJobs, so an
already loaded but stopped BackgroundRunner can notice
it and start running again.
4 years ago
Martín Fernández 83cde64bcc
unified calibre plugin (#6177)
joins calibre metadata search and calibre wireless connections into a single plugin

search metadata changes:

- search directly into calibre metadata files.
- search can be performed on more than one library (configurable from a menu)
- device scans now find all calibre libraries under a given root
- search options can be configured from a menu. (case sensitive, find by title, author and path)
- removed legacy global variables.
- *option* to search from the reader
- *option* to generate a cache of books for faster searches.

calibre wireless connection changes:

- keep track of books in a library (includes prunning books from calibre metadata if the file was deleted locally)
- remove files on device from calibre
- support password protected connections
- FM integration: if we're in the inbox dir it will be updated each time a book is added or deleted.
- disconnect when requested by calibre, available on newer calibre versions (+4.17)
- remove unused opcodes.
- better report of client name, version and device id
- free disk space checks for all calibre versions
- bump supported extensions to match what KOReader can handle. Users can override this with their own list of extensions (or from calibre, by configuring the wireless device).
4 years ago
poire-z e074b603e0 Adds Word Expansion: use of letter spacing for justification
Bump crengine:
- Text: fix occasional BiDi bad word splitting
- Font: fix HB fallback measurement/drawing mismatches
- Font: do not add letter spacing on diacritics
- Text: tunable use of letter spacing for justification
- Text: dont adjust space after initial quotation mark/dash (rework)
- Text: fix possible bad widths after collapsed spaces

xtext.cpp: pick crengine fix with HB fallback
measurement/drawing mismatches

Adds "Word Expansion" to bottom Font size menu, and moved
"Word Spacing" there too, to balance the panels' heights
to 4 items.
4 years ago
Martín Fdez f756a6aaa7 stardict path override 4 years ago
Robert 73a0f2f9d1 Remove DSCROLL_MODE and DGLOBALGAMMA (#5754) 4 years ago
Robert 8a0ce98149 [UX] Footer: add option to set font size (#5736) 4 years ago
poire-z 908151a3b0 [feat] Adds Document> Auto-save book metadata sub-menu (#5687)
Replaces DAUTO_SAVE_PAGING_COUNT in defaults.lua with
a new option available in menu, that allows setting
an interval in minutes instead of a page count.
4 years ago
Robert dd0c6c0bb8 [UX] Footer - add option chapter markers width (#5708) 4 years ago
Robert c3a0bd4def Remove DFULL_SCREEN (#5695) 4 years ago
poire-z 5541d5f5d3 bump crengine: word spacing and hyphenation tweaks
Includes:
- New option to tune word spacing: space width scale percent
- Text: look for hyphenation in more words if needed
- CSS: fix "hyphens:none" should override inherited "hyphens:auto"
- getHtml(): grab dir= and lang= attributes from upper nodes

Replace our Word Gap/Space condensing toggle/setting with
a new Word Spacing toggle/setting, made of 2 values:
- 1st number scales the normal width of spaces in all font
  (100% uses the font space width untouched)
- 2nd number applies after the 1st has been applied, and
  tells how much these spaces can additionally be condensed
  to make more text fit on a line.
4 years ago
Robert b0738960df Dictionary: add menu item to set font size (#5647) 4 years ago
Robert a96114d14a Remove DRCOUNTMAX (#5644) 4 years ago
Robert d93206a841 Remove DCREREADER_PROGRESS_BAR (#5641) 4 years ago
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).
5 years ago
Robert 5209493ba8 [UX] Option to show progress bar at the bottom of the screen (#5442) 5 years ago
Robert 93b6335421 [statistics] Remove conversion message on new installations (#5120) 5 years ago
NiLuJe 888d3591b2
Give more control over CRe margins (#4945)
Without having to resort to weird custom defaults.

* Split the current margins setting in three:
  * Horizontal margins (because you generally want those two to be balanced).
  * Top margin & Bottom margin (because you may want to tweak those separately to deal with quirky status bar/final line shenanigans).

* Also, add a "Reclaim bar height from bottom margin" toggle to the status bar menu, to optionally make sure the status bar won't eat into the bottom margin.

* Includes a free fix to diacritics popup refresh handling in the keyboard ;).
5 years ago
Frans de Jonge 8466af2c5b
[UX] Gesture manager: corner gestures (#4878)
Adds configuration to the top corners as well as the additional gestures hold and two-finger tap.

Deprecates `DTAP_ZONE_FLIPPING` and `DTAP_ZONE_BOOKMARK`.

Fixes #4877.
5 years ago
NiLuJe 645d41eda9
Add more granularity in line-height settings with CRe (#4785)
70 -> 130, in steps of 5 ;).
5 years ago
Frans de Jonge 1d1dc74290 [UX] creoptions: add more margin values
Fixes #4684.
5 years ago
Frans de Jonge b261a647c2
[feat] Add dictionary download option (#3176)
You can now download pretty much all of the easily available freely licensed dictionaries I could find.
5 years ago
Robert cd37535056 Replace remaining 'local gettext' with '_' (#4160) 6 years ago
sebastien 71ff69ec4f cre word gap: use values from defaults.lua (#4045) 6 years ago
Frode Austvik f12f317e9d [spec] Replace custom assert[Not]AlmostEquals with assert.is[_not].near (#3885)
Also, change "make static-check" to also check the tests.
6 years ago
mwoz123 a6b824ed90 NewsDownloader: add date time to filename (#3863)
* Download all files from ftp server(Not only epub). Show failed download number

* add date and time to filename

* optimalization - decrese max redirect number

* remove new external lib from luacheck

* add new lib licence info
6 years ago
Frans de Jonge e3c17aa6d0 Travis: run luacheck on unit tests (#3059)
* Travis: run luacheck on unit tests
7 years ago
mwoz123 d6c81f5097 Simple News (RSS/Atom) downloader plugin (#2592)
* Simple News (RSS/Atom) downloader plugin
* Limit news from sources
* new News Downloader menu entry - goto news dir
* Initial configuration logic
* Download each feed source to separate folder
* 2 feed sources in example config
7 years ago
Qingping Hou 40e19dbc37 ci(fix): ignore 631 warnings from luacheck 7 years ago
Qingping Hou 854043e18d chore: fix all luacheck errors for plugins 8 years ago
Qingping Hou d6c48b06f9 chore: fix all luacheck issues 8 years ago
Qingping Hou ec6da5318c screensaver(fix): add back menu toggle to support screensaver folder 8 years ago
Qingping Hou 144fd170f1 uimanager(refactor): replace autosuspend if check with noop 8 years ago
Qingping Hou e422842256 minor: a lot of luacheck fixes 8 years ago
Qingping Hou 9bd2d42834 build: enforce luacheck in travis build 8 years ago
Qingping Hou 6fe9f7870b chore: more luacheck fixes 8 years ago
Qingping Hou e695a3c30d build: add luacheck for static analysis 9 years ago