Commit Graph

4333 Commits (ce624be8b83e880b1a81106a143e1440eeda4aab)

Author SHA1 Message Date
NiLuJe bf6c0cdd6c
LuaSettings: Add a method to initialize a setting properly (#7371)
* LuaSettings/DocSettings: Updated readSetting API to allow proper initialization to default.
Use it to initialize tables, e.g., fixing corner-cases in readerFooter that could prevent settings from being saved.
(Fixes an issue reported on Gitter).
* LuaSettings/DocSettings: Add simpler API than the the flip* ones to toggle boolean settings.
* Update LuaSettings/DocSettigns usage throughout the codebase to use the dedicated boolean methods wher appropriate, and clean up some of the more mind-bending uses.
* FileChooser: Implement an extended default exclusion list (fix #2360)
* ScreenSaver: Refactor to avoid the pile of kludges this was threatening to become. Code should be easier to follow and use, and fallbacks now behave as expected (fix #4418).
3 years ago
Glen Sawyer 15ef1a3a1b
reMarkable 2 clean wakeup from sleep (#7345) 3 years ago
Martín Fernández eb57c4e0da
Add a couple of modern android dicts (#7359)
https://play.google.com/store/apps/details?id=gaurav.lookuppro and its free version.

From https://www.mobileread.com/forums/showpost.php?p=4097548&postcount=8
3 years ago
yparitcher 78c34e60fa
FileSearcher: Do not crash on space, show unsupported files if enabled. (#7362) 3 years ago
NiLuJe 32b070f3ac
Dispatcher: nil guard against access to a document instance (#7389)
Also:
* Properly update *all* the touch zones when rotating the FM
* Unbreak (Reader) rotation labels in Dispatcher
Regression since #7306
3 years ago
NiLuJe b75ea3da03
ReaderFooter: Fix some interactions between margins and text width (#7391) 3 years ago
Frans de Jonge c0423401aa
A few more directory to folder (#7386)
Cf. https://github.com/koreader/koreader/issues/7350#issuecomment-789672442
3 years ago
NiLuJe 9bcaae6eeb
Remove an unwanted truncation. (#7378)
This *should* be a float ;).

c.f., https://github.com/koreader/koreader/pull/7335#discussion_r586548610
3 years ago
Frans de Jonge 8bdf2c5e75
Add explanation for shorten home folder (#7365)
Cf. <https://www.mobileread.com/forums/showthread.php?p=4098071#post4098071>.
3 years ago
NiLuJe 5303165bf9
ReaderDogEar: Enforce a minimum size, too (#7369)
* Add a semi-transparent version of the dogear icon
* Ensure the dogear won't become too tiny to be useful
3 years ago
NiLuJe f9635bc41b
WiFi: Handle inconsistent states a tad better. (#7368)
* NetworkManager: Use a dedicated prompt if Wi-Fi is enabled but
disconnected.
3 years ago
josdion 3d8d40d797
Add Bulgarian keyboard layout (#7367) 3 years ago
Frans de Jonge 4f7f6169a6 Change a few more directory strings to folder
Fixes <https://github.com/koreader/koreader/issues/7350>.
3 years ago
Frans de Jonge 8b72ddb5de Fix nativation typo to navigation 3 years ago
NiLuJe 0e130d6a17
ReaderSearch: Switch to a real InputDialog (#7360)
Instead of piggybacking on InputContainer's onInput trickery for hold_input & tap_input.

Also, don't flag the buttons from that InputDialog as vsync, because that was stupid ;).

Fix #7357
3 years ago
NiLuJe c2db948ff2
KeyValuePages: Handle not having anything to show slightly better (#7353)
By disabling the pagination buttons, and showing a specific label, like Menu (https://github.com/koreader/koreader/pull/7347#issuecomment-786768640)
3 years ago
NiLuJe 26b9ab2505
Minor followup to #7335 (#7347)
* Unify SortWidget's pagination button (it was using a tap_input, which is why I'd missed it ;)). (https://github.com/koreader/koreader/pull/7335#issuecomment-785628495)
* Menu*: Remove redundant screen-layout updates from `_recalculateDimen`, as it should only be concerned with item layout (https://github.com/koreader/koreader/pull/7335#discussion_r582072032)
3 years ago
NiLuJe 525b1957b9
[RFC] Pagination UI shenanigans (#7335)
* Menu/KeyValuePage/ReaderGoTo: Unify the dialogs. (Generally, "Enter page number" as title, and "Go to page" as OK button).
* Allow *tapping* on pagination buttons, too. Added spacers around the text to accommodate for that.
* Disable input handlers when <= 1 pages, while still printing the label in black.
* Always display both the label and the chevrons, even on single page content. (Menu being an exception, because it can handle showing no content at all, in which case we hide the chevrons).
* KVP: Tweak the pagination buttons layout in order to have consistent centering, regardless of whether the return arrow is enabled or not. (Also, match Menu's layout, more or less).
* Menu: Minor layout tweaks to follow the KVP tweaks above. Fixes, among possibly other things, buttons in (non-FM) "List" menus overlapping the final entry (e.g., OPDS), and popout menus with a border being misaligned (e.g., Calibre, Find a file).
* CalendarView: Minor layout tweaks to follow the KVP tweaks. Ensures the pagination buttons are laid out in the same way as everywhere else (they used to be a wee bit higher).
3 years ago
NiLuJe d243097d75
ScreenSaver: Delay footer/header repaint if screensaver_delay is enabled (#7334)
Fix #7327
3 years ago
Anton 013a6076c1
External link: adds "Show QR code" (#7310) 3 years ago
poire-z 0883202e07
bump crengine: CSS line-break/word-break, various fixes (#7342)
Includes:
- LVString: Fix a c/p issue in lString8::atoi64
- LVTextFm: Simplify and fix resizeImage logic
- LVXMLParser::ReadText(): fix parsing at buffer boundaries
- TextLang: fix lang_tag first part comparison
- CSS font-family: fix parsing of 'inherit' and '!important'
- CSS: support a few -epub-* and -webkit-* properties
- Text fragment flags: add LTEXT_HAS_EXTRA
- CSS: add support for 'line-break' and 'word-break'
3 years ago
poire-z 37af0fd6ea
TOC: expand to show all chapters on current page (#7339) 3 years ago
NiLuJe 64611e6acb
Legacy Kindle: Actually handle (system) power events (#7336)
Otherwise, ScreenSaver handling doesn't work, duh'.
I have no idea how I managed to get that working the last time I tested
it :?.
Possibly I tested the final code on a K4 and not a K3?

Fix #7333
3 years ago
Frans de Jonge 1bd4636a03
Standardize directory/folder to folder (#7328)
Closes <https://github.com/koreader/koreader/issues/7157>.
3 years ago
NiLuJe 75356f2837
flash_ui: Workaround potential EPDC races (#7332)
* flash_ui: Yield to the kernel between the HL and the UNHL/CB to let the EPDC do its thing in peace.
* UIManager: Handle nils in task scheduling arguments.
* SkimTo: Use the same, thicker chapter nav icons as ReaderSearch (fix #7326).
* SkimTo: The bookmark toggle button doesn't require a vsync flag.
3 years ago
NiLuJe e582036c3e
TouchMenu: Workaround an EPDC race in the hold handler w/ flash_ui (#7325)
* Also bump base, because it's mildly related

https://github.com/koreader/koreader-base/pull/1312
3 years ago
poire-z 8a0d798e9e KeyValuePage: configurable items per page
Tweak building to start from items per page instead of
a fixed item height.
Guess the best font size that fit.
Update separator specification from using a "----" to
the now generic separator=true (this allows not wasting
a slot for each separator in the page and not have
only 12 items and 2 small lines in a 14 items page).
3 years ago
NiLuJe 572900bfff When displaying a *date* (as opposed to a *time*), pad the hour with
blanks if necessary in order to get a consistent alignment.

Fix #7316
3 years ago
NiLuJe 588acfe31e DictQuickLookup: Properly scroll back to top when updating a
ScrollTextWidget

Despite a similar API between ScrollTextWidget and ScrollHtmlWiget, what
they do internally doesn't quite match.

So, while ScrollHtmlWidget's resetSCroll *does* rewind back to the top,
ScrollTextWidget's doesn't, it just updates the scrollbar itself.
So, do that on our end, *before* the (re-)init, which'll call
_renderText for us.

Fix #7318
3 years ago
NiLuJe e6a946a048 Menu: Enable/Disable the pagination Button properly
Otherwise, the dim state isn't updated properly, because Button trusts the state flag.

Regression since 6132e8c904

Fix #7317
3 years ago
poire-z 173d9600f0
Bookmarks dogear: fix position with CRe top status bar (#7312)
Draw it below the CRe top status bar rather than over it.
3 years ago
poire-z 00aef60e17 Goto dialog: use "Go to Page" also with CreDocuments 3 years ago
poire-z 05c8cd2155 SkimToWidget: remove title bar, add bookmark button
Remove the title bar, as it was just taking uneeded
space over the book content.
Add a middle button in the top row to toggle bookmark
for the current page.
Rework the UI building to get more consistent and
aligned buttons and progress bar.
Move SkimToWidget from apps/reader/ to ui/widgets/.
3 years ago
poire-z 0f7722d4a6 TOC settings: add bind chapter navigation/titles to ticks
Add 2 convenience settings, allowing ToC ignored depths
settings to apply further than just the progress bars.
3 years ago
poire-z d63d282806 History: avoid opening non-existent files
Mostly just so we don't get the History closed when
erroneously tapping on a deleted file.
3 years ago
NiLuJe fe10d0bce5
Revamp flash_ui handling, once more, with feeling ;) (#7262)
* Simplify flash_ui handling (by handling the unhighlight pre-callback, c.f., #7262 for more details).
* UIManager: Handle translucent window-level widgets (and those wrapped in a translucent MovableContainer) properly in setDirty directly, making sure what's *underneath* them gets repainted to avoid alpha layering glitches. (This was previously handled via localized hacks).
* Update UIManager's documentation, and format it properly for ldoc parsing, making the HTML docs more useful.
* ReaderView: Reinitialize the various page areas when opening a new document, to prevent poisoning from the previous document.
* Event: Handle nils in an event's arguments.
* CheckButton/RadioButton: Switch to simple inversion to handle highlighting
* CheckButton: Make the highlight span the inner frame's width, instead of just the text's width, if possible.
* AlphaContainer: Fix & simplify, given the UIManager alpha handling.
* MovableContainer: When translucent, cache the canvas bb used for composition.
* Avoid spurious refreshes in a few widgets using various dummy *TextWidgets in order to first compute a text height.
* KeyValuePage: Avoid floats in size computations.
3 years ago
NiLuJe 1cdc6c61e0 Strip trailing slash from the URL in About popup 3 years ago
NiLuJe 1820c616a1
[RFC] Switch ConfigDialog's rotation toggle to custom icons (#7306) 3 years ago
NiLuJe 467264f59f
ScreenSaver: Don't expand special tokens with an empty string (#7314) 3 years ago
poire-z 6132e8c904 Button: don't handle long-press when not enabled
It was only not handled when hold_callback. Do that
also when hold_input/hold_input_func.
Also fix the handling of HoldRelease (as the Hold may
change the state of 'enabled', so we can't rely
on it to guess the Hold is being handled by Button).
Menu: prevent long-press on "No choice available",
as there's then no page to navigate to.
3 years ago
poire-z e44c170f59 Wikipedia results: fix images not updated across results
Some results fields were forgotten by the "smarter update"
from a38881a9.
3 years ago
Rex Kerr 2510ff4847
Reversing commit 2348cd, changes to warmth values (#7296) 3 years ago
Frans de Jonge 35ff6776a5
[fix] Remove OPDS menu entry from FilemanagerMenu (#7291)
Fixes #7290.
3 years ago
Frans de Jonge 9f2c45284b
[chore, documentation] Fix up util.stringStartsWith/stringEndsWith LDoc comments (#7292)
Cf. <https://github.com/koreader/koreader/issues/7286#issuecomment-778855817>.
3 years ago
Rex Kerr 2348cdb066
Improved ramp-down of warm-light after max hour (#7272)
previously: warm light stays at 100% for 3 hours and then drops by 50% per hour
now: warm light stays at 100% for 4 hours and then drops by 15% per hour
3 years ago
NiLuJe d8fc28df97
Page Overlap: Fix rectangle computation and arrow mode (#7269)
* In ReaderPaging, the panning step pre-PanningUpdate can be wildly overshot near page edges, so, use the corrected value instead by recomputing it after the panning has been effectively computed by ReaderView.
This fixes slight inaccuracies, as well as glaring mistakes when going backwards, or when near page edges.
This is in line with how ReaderRolling computes the value, which I only realized later because I'm an idiot. 
* Minor cleanups around the handling of the dim_area Geom object in general.

* Fix the "Arrow" page overlap mode to be painted in the right coordinates when going backward. Issue might not have been terribly clear because of the previous issue ;).
* Center the arrow's point, while we're here.
* Don't use AlphaContainer to make it translucent, because AlphaContainer is horribly broken, and has weird quirks and behavior that make no sense to me unless some very specific and unlikely constraints are met, and they definitely aren't here.
This fixes the arrow copying an arrow-sized square of the original page the book was opened on on the top-left corner of *every* page with an arrow. (lol).
* Do real proper alpha-blending via Icon/ImageWidget from the original icon, instead of faking it via addBlitFrom, in order to avoid the dimming *around* the triangle's shape.
3 years ago
poire-z 6059958ab6
File browser settings: reorganize into Settings submenu (#7259)
Move classic file browser settings from CoverBrowser plugin
into FileManagerMenu, so they are available when this
plugin is disabled (as they also apply to everything
based on Menu).
3 years ago
Frans de Jonge ac668ecb64
Add a few more mimetypes for OPDS (#7258)
Doesn't include application/zip as CBZ, but it will be downloaded (as ZIP).

Doesn't include CBR since that's not supported.

Closes #7218, closes #5997.
3 years ago
NiLuJe 82f0e68118
Button: Fix some more weird highlighting corner-cases (#7256)
Namely, the Terminal plug-in and its chain of InputDialog on top of each other (via the "Save" button, which opens a whole new fs InputDialog to set the filename, while keeping the file's fs InputDialog open).
3 years ago
NiLuJe 23affc7414
Menu: Properly unhighlight menu items with a callback that doesn't do anything (#7254)
Fix #7251
3 years ago
NiLuJe 9e862e1126
TextViewer: Flag as a modal (#7255)
It's used that way in a few contexts (e.g., View HTML).

Fix #7249
3 years ago
Martín Fernández 5c9e649804
move opds to plugin (#7237) 3 years ago
poire-z c7e97ca3cb
Highlight dialog: fix 'Follow Link' button not shown (#7250)
Since 7bd59330: some checks can't be done at init(),
and have to be done at onShowHighlightMenu() time.
3 years ago
Frans de Jonge 893026a2ef
[chore] Fix a few Persian keyboard luacheck issues (#7253)
Cf. <https://github.com/koreader/koreader/pulls#issuecomment-774345230>.
3 years ago
poire-z 3b89e32069 [UX] Add ToC/Bookmarks settings
- Menu widget: allow specifying the number of items per
  page and the item font size, so we can use other values
  than the default File browser ones
- Menu: fix setDirty when a border is used
- ToC: add item per page and font size settings, make
  Alternative ToC more visible (was previously
  available on long-press on Table of contents)
- Bookmarks: add item per page, font size, size reduction
- Progress bars (Skim widget and footer): allow selecting
  ToC depths from which ticks are made.
3 years ago
poire-z 316107a1cb ReaderRolling: fix possible crash in scroll mode
When opening a document in scroll mode with an invalid
last_xpointer.
This code path was never taken before 05126b94, and it has
never been updated to pass the page number in scroll mode
(so it's provided to the footer) like it has been in other
places.
3 years ago
Monirzadeh 6f50d67b5d
[UX] Add Persian keyboard (#7222)
Fixes #5791.
3 years ago
Frans de Jonge cf3fed252a
[chore] Properly set CoverImage menu order (#7239)
Reported by @pazos in <https://github.com/koreader/koreader/pull/7237#discussion_r570395126>.
3 years ago
NiLuJe d4d5dd25ba TextViewer: Allow tweaking the region of the refresh done on close.
Use it in ReaderBookmarks to clear flash_ui highlights.

Fix #7230
3 years ago
NiLuJe b41567e0e6 ConfigDialog: Check alt_name_text if name_text isn't set,
as it is used for the "Set as default" popup.
This allows having that text accurate on widgets without an
actual name_text (e.g., the font size wheel).

Fix #7231

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
3 years ago
NiLuJe 285fc75aa7
Button: Better handling of translucent MovableContainer (#7223)
* DictQuickLookup: Preserve alpha when switching dict, and scrolling
inside a dict.

* Start moving the NumberPicker alpha hack to Button itself

This makes handling flash_ui easier and saner, avoiding flickering.

* Handle the transparency hack entirely from within Button

* Murder the now unnecessary NumberPicker update_callback hack

* Tweak comments

* And the Button handling made that redundant, too

* Squish debug print

* More comment tweaks

* Reset transparency on scrolling instead of rpeserving it

* Reset alpha when switching dictionaries

* Simplify the pre/post callbakc transparency state handling

And explain why we need to care.

* Give a named reference to ButtonDialog's MovableContainer, so the Button
alpha hack behaves with it

* Document the "self.movable" convention

* Amend that comment a bit

e.g., we don't care much about MultiConfirmBox'w MpvableContainer, as
any button action will close it.

* And make SkimTo's MovableContainer accessible so that Button can grok
that it's translucent
3 years ago
Martín Fernández 4a89c93290
Remarkable1 wifi (#7216)
* add wifi support to Rm1
* remarkable: common suspend for all models
3 years ago
poire-z 68a5fcdbc1 Notifications: stack them instead of overdrawing them 3 years ago
poire-z cdafd9438c Georgian keyboard: remove unused variable (luacheck) 3 years ago
Beka Arabuli f665a25e70
Georgian keyboard (#7225) 3 years ago
poire-z a192a335f1 Footer: tweak auto refresh code
Make it similar to how it's been done recently for CRe
alt status bar, avoiding scheduling when not needed.
3 years ago
poire-z 062bb68335 Alt status bar: full repaint on font size change 3 years ago
NiLuJe a38881a9f7
Fix a few things after #7166 (#7212)
* Switching between HTML/text dicts (Fix #7209)
* Updating the scrollbar and scroll state properly when switching dicts
* Highlights in SortWidget
* Highlights in the Dictionary Download page
* Minor simplification of the tail end of the update process in ImageViewer
3 years ago
zwim 3118d0dba0 Refresh AltStatusBar once a minute, if there are changes 3 years ago
poire-z 49e2d91afb Don't toggle the footer when toggling the top status bar 3 years ago
poire-z 8ee7dcf342 Top menu: long-press on truncated menu item to show full text 3 years ago
poire-z 05126b94b6 Dual pages: shown as 2 columns on a single page
Rework Dual pages code so that the view is considered
a single page number, so it looks more like 2-columns
on a single page.
This solves a few issues like:
- Page number and count are consistent between top
  and bottom status bars
- SkimTo -1/+1 doing nothing every other tap
- Statistics being wrong (like "Pages read" never
  going over half of the book page count)
3 years ago
poire-z 7779e2d8e7 CRe: use getDocumentRenderingHash() to detect rendering changes
Instead of just relying on document full height
and number of pages.
3 years ago
poire-z fbdff1c672 CRe top status bar: ensure 12-hours clock setting 3 years ago
poire-z 8ff50a9e24 CreDocument: disable crengine image scaling options
Since their handling in crengine has been re-enabled.
3 years ago
poire-z a482baac5b Footer current chapter: use first chapter on page instead of last 3 years ago
poire-z 564db73cd8 TOC: show en-dash on empty titles 3 years ago
poire-z e74c28efa9 CRe TOC, Bookmarks: show marker when jumping 3 years ago
NiLuJe df0bbc9db7
Tame some ButtonTable users into re-using Buttontable instances if possible (#7166)
* QuickDictLookup, ImageViewer, NumberPicker: Smarter `update` that will re-use most of the widget's layout instead of re-instantiating all the things.
* SpinWidget/DoubleSpinWidget: The NumberPicker change above renders a hack to preserve alpha on these widgets almost unnecessary. Also fixed said hack to also apply to the center, value button.

* Button: Don't re-instantiate the frame in setText/setIcon when unnecessary (e.g., no change at all, or no layout change).
* Button: Add a refresh method that repaints and refreshes a *specific* Button (provided it's been painted once) all on its lonesome.

* ConfigDialog: Free everything that's going to be re-instatiated on update
 
* A few more post #7118 fixes:
  * SkimTo: Always flag the chapter nav buttons as vsync
  * Button: Fix the highlight on rounded buttons when vsync is enabled (e.g., it's now entirely visible, instead of showing a weird inverted corner glitch).
  * Some more heuristic tweaks in Menu/TouchMenu/Button/IconButton
* ButtonTable: fix the annoying rounding issue I'd noticed in #7054 ;).

* Enable dithering in TextBoxWidget (e.g., in the Wikipedia full view). This involved moving the HW dithering align fixup to base, where it always ought to have been ;).

* Switch a few widgets that were using "partial" on close to "ui", or, more rarely, "flashui". The intent being to limit "partial" purely to the Reader, because it has a latency cost when mixed with other refreshes, which happens often enough in UI ;).

* Minor documentation tweaks around UIManager's `setDirty` to reflect that change.

* ReaderFooter: Force a footer repaint on resume if it is visible (otherwise, just update it).
* ReaderBookmark: In the same vein, don't repaint an invisible footer on bookmark count changes.
3 years ago
Glen Sawyer 34b177aa69
Wifi toggle for reMarkable 2 (#7122)
reMarkable 1 is no-op for the moment
3 years ago
Jason Benwell 41ab04b49e
Fix crash attempting to set compact items in status bar (#7172) 3 years ago
NiLuJe 0c76c73e4f
Assorted fixes after #7118 (#7161)
* I'd failed to notice that ButtonTable *also* instantiates seven billion Buttons on each update. Unfortunately, that one is way trickier to fix properly, so, work around its behavior in Button. (This fixes multiple issues with stuff using ButtonTable, which is basically anything with a persistent set of buttons. A good and easy test-case is the dictionary popup, e.g., the Highlight button changes text, and the next/prev dic buttons change state. All that, and more, was broken ;p).

* Handle corner-cases related to VirtualKeyboard (e.g., Terminal & Text Editor), which screwed with both TouchMenu & Button heuristics because it's weird.

* Flag a the dictionary switch buttons as vsync

(They trigger a partial repaint of the dictionary content).

* Flag the ReaderSearch buttons as vsync

They very obviously trigger a partial repaint, much like SkimTo ;p.
3 years ago
Cali-Co 66eb939936
[feat] Add skimming support for Non-Touch devices (#7163)
Fixes #6866.
Replace InputContainer with FocusManager for easier DPad Handling.
Add ProgressBar jump via key Q to P, corresponds with 0% to 100%.

Tested on K3 and SDL. Should be safe for devices with touch.
3 years ago
Frans de Jonge 1ef6d0b257
[feat] Support mimetypes in DocumentRegistry:hasProvider() (#7155)
And make .djvu the canonical extension for DjVu.

Fixes #5478.
3 years ago
Glen Sawyer 7753577616
[reMarkable] Don't need to keep attempting WiFi connection after success (#7121)
If we're in range of multiple known WiFi Access Points (including multiple instances of the same SSID), we don't need to keep trying to connect after the first successful connection.

Minimal change would have been replacing the return inside the foreach function with return [a non-nil value].
But foreach is deprecated, and since I was touching the code anyhow, I figured I'd do that tiny update as well.
3 years ago
Frans de Jonge 5c9dc850e8
Address assorted Weblate comments (#7154)
* Fix typo in dropbox

Reported by @lescheck

* Rephrase text justification explanation more elegantly

* CoverBrowser: fix up some plurals

* Statistics: remove random use of template function

* Use ngettext for minute/minutes and second/seconds

* Change KB/MB/GB to kB/MB/GB SI units
3 years ago
Jason Benwell cd6e2d9975
Make status bar prefix compact items a bit more compact (#7153)
For battery level, show icon only
Reduce separator between items to " " from "  "
3 years ago
NiLuJe dffe86dfe9
Cleanup eye-gouging madness around io.read calls (#7149)
* Don't reinvent the wheel when reading a one-line int or string from sysfs

* Simplify a whole other bunch of read calls
3 years ago
Martín Fernández f52fffd467
Mark calibrecompanion plugin as obsolete (#7147) 3 years ago
NiLuJe 183e0a2e25
Bump android-luajit-launcher (#7137)
* Check available width when using a viewport

* Mention that available_width should always match width
3 years ago
poire-z 396d1fbf46
bump crengine: parsing, lists, 2-pages mode fixes & tweaks (#7138)
Includes:
- EPUB: fix truncated HEAD>STYLE stylesheet
- XML parsing: slightly better parsing of <script>
- Update German hyphenation patterns
- (chore) Silence some clang warnings
- (Upstream) CSS content: fix regression with open-quote/close-quote
- (Upstream) HTML lists: support the 'reversed' attribute
- (Upstream) Tweak list items disc/circle/square symbols
- 2-pages mode: option to skip geometry checks

CRE bottom menu: allow toggling Dual Pages in portrait mode.
3 years ago
Martín Fdez 1148e46651 migrate fontlist to persist 3 years ago
Martín Fdez b8f0dc3752 add table persistence module 3 years ago
NiLuJe 47b0d4089a
Remember the final rotation during Reboot/PowerOff/AutoSuspend, too (#7133)
Re #7096, Fix #7125

Co-authored-by: yparitcher <y@paritcher.com>
3 years ago
Jason Benwell f53fa1d323
[UX] Footer: add prefix option "Compact items" (#7127)
For a compact layout, with removed/shortened spaces.
3 years ago
poire-z 9b11497652 KOPT bottom menu: hide it when applying Zoom options 3 years ago
poire-z b92c078e9c ConfigDialog: temporarily hide when showing SpinWidgets
Hide bottom panel when showing a SpinWidget, so we gain
on the bottom the space covered by the SpinWidget to see
more how a change is affecting the book text.
For clarity, rename delay_repaint & refresh_callback
to hide_on_apply & when_applied_callback.

Normalize SpinWidgets: have them both accept a
cancel_callback and a close_callback.
InfoMessage: call dissmiss_callback also on timeout.
3 years ago
poire-z 4043ba27b0 CRE: fix to Top/Bottom margins fine tuning
Rework eb66856d so that "Sync T/B Margins" is disabled
when set Top and Bottom margins differ (previously,
the bottom one was taking over the top one when
it was enabled).
3 years ago
poire-z 8f79c662cf Notification: closed by any event, but not consuming it
Make Notification have toast=true, and UIManager deal
specifically with such widget:
a "toast" widget gets closed by any event, and let
the event be handled by a lower widget.
This should allow us to not wait or tap to get rid
of a notification, and just go on with what we're
doing.
Also make them have a default timeout of 2s,
used with all existing ones.
3 years ago
poire-z f1046f07a9 Dispatcher: increase hold_step for usability 3 years ago
Markismus 67ca9c35f5
Prevent sdcv from interpreting search term starting with dash as an option (#7134) 3 years ago
zwim 8991ec1372
Align wording of AltStatusBar menu to the bottom one (#7130)
Also change to "Font size (%1)"
3 years ago
NiLuJe 47568ae9b4
ScreenSaver: Unbreak "disable" mode (#7124)
* Unbreak "disable" mode

Regression since f67296942f
3 years ago
NiLuJe 3060dc81af
Revamp "flash_ui" handling (#7118)
* Wherever possible, do an actual dumb invert on the Screen BB instead of repainting the widget, *then* inverting it (which is what the "invert" flag does).
* Instead of playing with nextTick/tickAfterNext delays, explicitly fence stuff with forceRePaint
* And, in the few cases where said Mk. 7 quirk kicks in, make the fences more marked by using a well-placed WAIT_FOR_UPDATE_COMPLETE

* Fix an issue in Button where show/hide & enable/disable where actually all toggles, which meant that duplicate calls or timing issues would do the wrong thing. (This broke dimming some icons, and mistakenly dropped the background from FM chevrons, for example).
* Speaking of, fix Button's hide/show to actually restore the background properly (there was a stupid typo in the variable name)
* Still in Button, fix the insanity of the double repaint on rounded buttons. Turns out it made sense, after all (and was related to said missing background, and bad interaction with invert & text with no background).
* KeyValuePage suffered from a similar issue with broken highlights (all black) because of missing backgrounds.
* In ConfigDialog, only instanciate IconButtons once (because every tab switch causes a full instantiation; and the initial display implies a full instanciation and an initial tab switch). Otherwise, both instances linger, and catch taps, and as such, double highlights.
* ConfigDialog: Restore the "don't repaint ReaderUI" when switching between similarly sized tabs (re #6131). I never could reproduce that on eInk, and I can't now on the emulator, so I'm assuming @poire-z fixed it during the swap to SVG icons.
* KeyValuePage: Only instanciate Buttons once (again, this is a widget that goes through a full init every page). Again, caused highlight/dimming issues because buttons were stacked.
* Menu: Ditto.
* TouchMenu: Now home of the gnarliest unhilight heuristics, because of the sheer amount of different things that can happen (and/or thanks to stuff not flagged covers_fullscreen properly ;p).

* Bump base
https://github.com/koreader/koreader-base/pull/1280
https://github.com/koreader/koreader-base/pull/1282
https://github.com/koreader/koreader-base/pull/1283
https://github.com/koreader/koreader-base/pull/1284

* Bump android-luajit-launcher
https://github.com/koreader/android-luajit-launcher/pull/284
https://github.com/koreader/android-luajit-launcher/pull/285
https://github.com/koreader/android-luajit-launcher/pull/286
https://github.com/koreader/android-luajit-launcher/pull/287
3 years ago
poire-z 475bb648b0 Margins info msg: show left/right margin values
As we can now tweak them independantly.
3 years ago
poire-z ebf997dd99 DictQuickLookup: allow continuous reading with keys
We could scroll a definition with keys. Now, when
reaching top or bottom, switch to prev/next result.
3 years ago
poire-z 27b493afef Fix selected word non-highlighted on PDF
Optimisation for CRE from dd74194e made it not work with
KOpt-based documents.
3 years ago
poire-z 9ec3dcb376 ReaderDictionary: fix possible crash with Wikipedia
Also reword some "...canceled" to "...interrupted"
for consistency.
3 years ago
zwim a44c178d74
show AltStatusBar when changing the font size (#7119) 3 years ago
yparitcher 1c9c40fb95
Save rotation across restarts (#7096) 3 years ago
yparitcher 00556715f4
Dispatcher: update document.configurable (#7116)
So ConfigDialog knows about changed settings and
properly reflects their states.
3 years ago
Martín Fernández 5ec0b049d9
Add deprecation messages to plugins (#7101)
And deprecate Goodreads plugin.
3 years ago
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.
3 years ago
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
3 years ago
poire-z dc80321688 Search: fix matches not highlighted on current page
Regression (typo from cut and paste) from 7bd59330.
3 years ago
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).
3 years ago
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
3 years ago
NiLuJe 34b764dc06 Kindle Legacy: Probe for SO on the K3 & K4 3 years ago
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.
3 years ago
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.
3 years ago
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.
3 years ago
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
3 years ago
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.
3 years ago
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.
3 years ago
poire-z b6323f15fc DictQuickLookup: hold prev/next buttons go to first/last result 3 years ago
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.
3 years ago
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)
3 years ago
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
3 years ago
Jason Benwell 32b28c0b80
Footer: add "Pages left in book" as footer item (#7047) 3 years ago
poire-z f96585ece8
htmlToPlainText(): tweak format paragraphs with indentation (#7095)
Rework dafaf966, with a tabulation instead of multiple
&nbsp; to ensure a constant indentation when text
is justified.
3 years ago
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.
3 years ago
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).
3 years ago
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
3 years ago
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).
3 years ago
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.
3 years ago
John Beard fca87b5b3a
UI: Clicking menu icon returns to top of menu (#7074)
Fixes: #6940
3 years ago
Glen Sawyer 3bd3493014
Fix double-pressing reMarkable 2 power button twice to wake up (#7065) 3 years ago
Glen Sawyer 578f92e424
Time-adjust on all reMarkable events, not just EV_ABS (#7066) 3 years ago
gbyl d2379fc6e6
remarkable: poweroff.png ghosting fix (#7051) 3 years ago
Frans de Jonge a96181d74f
Fix typo in "remove bookmark?" (#7062) 3 years ago
John Beard 12d1604a75
UI: Make button radius match default window radius (#7054) 3 years ago
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
3 years ago
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>.
3 years ago
yparitcher 4548ced866
Quickstart: add long press sets default (#7048)
add wiki reference
3 years ago
Frans de Jonge 53909db687
Close Lua state on all os.exit() calls (#7050)
Cf. <https://github.com/koreader/koreader/pull/7044>.
3 years ago
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
:)
3 years ago
Frans de Jonge dafaf966e4
htmlToPlainText(): Format paragraphs with indentation (#7027)
Cf. <https://www.mobileread.com/forums/showthread.php?p=4072308#post4072308>.
3 years ago
Frans de Jonge ad08ce9849
OPDS: Inform and warn about downgrade attack (#7032)
Fixes <https://github.com/koreader/koreader/issues/7007>.
3 years ago
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
3 years ago
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
3 years ago