Attempting to update a highlight when matching on a bookmark doesn't
make sense, and no longer works since #7411
Also, switch to ipairs(), and stop piggybacking on a new local that
shadows or uses the function's item argument.
It works in Lua, but it's super weird and error-prone.
Fix#7520 (regression since #7411).
* 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).
* 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.
- 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.
* 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.
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.
(Not sure how and with what this check works and if
we still get such kind of items, but avoid a crash
when item2.pos0 exists but item1.pos0 does not.)
Was correctly done when jumping bookmarks via the Bookmarks
menu and the SkimTo widget, but not from gestures.
Also prevent fillToc() on each page turn when book has no TOC.
This number might have been leaking from a previously opened
book, and can be innacurate.
Reset it from the number of highlights stored in settings.
Note that the number of "Notes" shown does not mean much.
bump crengine: support for EPUB3 nav toc and page maps
Includes:
- Fix lvRect:isRectInside(rc) with 0-width or 0-height rect
- TOC: parse EPUB3 nav toc, fallback to spine when no toc
- Parse and cache various hardcopy page list maps
- epub.css: hide EPUB3 <span epub:type="pagebreak"> content
cre.cpp: add a few PageMap helper functions.
Adds ReaderPageMap which will add a new menu (under TOC and
Bookmarks) that will allow:
- to list source page numbers (like a TOC)
- to show visible page labels in the right margin
- to use these source page numbers in the footer, the TOC,
the GoTo and SkimTo widgets, and to use the source page
number in the standard bookmark and highlight initial text.
Depending on the random ordering of bookmarks and highlights
on a same page, the binary seach could not notice that a
bookmark exists for this page.
Solve this by putting bookmark before highlights on a same
page in the list, and skip them when searching.
Small tweaks all around to handle UI mirroring:
- swap existing symbols like arrows, or use alternative ones
- rotate some images, like chevrons and dogear icons
- flip some left and right swipe handling
- flip some geometry arithmetic like tap on left or right
side of page or dict window
- use new ProgressWidget:getPercentageFromPosition() instead
of geometry arithmetic
- BD.wrap() some concatenated string bits, like in reader
and menu footers
- flip inverse_reading_order when UI is mirrored
More specific tweaks:
- ReaderGesture: reset some specific gestures when UI direction
has changed (tap on top/bottom left/right corners, for
bookmarks and FileManager "Plus menu").
- ReaderRolling: show markers on the correct side of page,
in single or dual page mode.
- KoptOptions: swap left and right icons in Alignment toggle
- CheckMark: proper rendering in all 4 mirroring/rtl combinations.
- VirtualKeyboard: forbid any mirroring
- Move util.getMenuText into Menu.lua
Adds "Render mode" toggle with 4 modes, to enable some or all
of crengine's new enhanced block rendering features.
Use "legacy" rendering for previously opened books to not mess
with bookmarks, and "web" (all of the new features) for new books.
Also make available the added "HTML5" stylesheet to the Style menu.
InputText, ScrollTextWidget, TextBoxWidget:
- proper line scrolling when moving cursor or inserting/deleting text
to behave like most text editors do
- fix cursor navigation, optimize refreshes when moving only the cursor,
don't recreate the textwidget when moving cursor up/down
- optimize refresh areas, stick to "ui" to avoid a "partial" black
flash every 6 appended or deleted chars
InputText:
- fix issue when toggling Show password multiple times
- new option: InputText.cursor_at_end (default: true)
- if no InputText.height provided, measure the text widget height
that we would start with, and use a ScrollTextWidget with that
fixed height, so widget does not overflow container if we extend
the text and increase the number of lines
- as we are using "ui" refreshes while text editing, allows refreshing
the InputText with a diagonal swipe on it (actually, refresh the
whole screen, which allows refreshing the keyboard too if needed)
ScrollTextWidget:
- properly align scrollbar with its TextBoxWidget
TextBoxWidget:
- some cleanup (added new properties to avoid many method calls), added
proxy methods for upper widgets to get them
- reordered/renamed/refactored the *CharPos* methods for easier reading
(sorry for the diff that won't help reviewing, but that was needed)
InputDialog:
- new options:
allow_newline = false, -- allow entering new lines
cursor_at_end = true, -- starts with cursor at end of text, ready to append
fullscreen = false, -- adjust to full screen minus keyboard
condensed = false, -- true will prevent adding air and balance between elements
add_scroll_buttons = false, -- add scroll Up/Down buttons to first row of buttons
add_nav_bar = false, -- append a row of page navigation buttons
- find the most adequate text height, when none provided or fullscreen, to
not overflow screen (and not be stuck with Cancel/Save buttons hidden)
- had to disable the use of a MovableContainer (many issues like becoming
transparent when a PathChooser comes in front, Hold to paste from
clipboard, moving the InputDialog under the keyboard and getting stuck...)
GestureRange: fix possible crash (when event processed after widget
destruction ?)
LoginDialog: fix some ui stack increase and possible crash when switching
focus many times.
* [VirtualKeyboard] Add support for keynaviguation
Also rename the variable "layout" to "keyboard_layout" because conflict
with the layout from the focusmanager
* Make the goto dialog compatible with key naviguation
My solution is to change the order of the widget. The last one will the
virtualkeybard so it catch all the keybinding, and below it, make the
dialog "is_always_active = true" so it can receive touch event.
* Correctly show the virtual keyboard on dpad devices
* change the order to call the virtualKeyboard so it end up on top
* Handle the multi input dialog
* Support reopening the virtualKeyboard by the Press key
* add check focusmanager
* Fix https://github.com/koreader/koreader/issues/3797
* MultiInputDialog : Now work on non touch-device
* Set the virtualkeyboard to be a modal widget
* Fix the layout in multiinputwidget
* Fix for the various combination of
hasKeys,hasDpad,isTouchDevice
* [Focusmanager] Better handling of malformed layout
Navigating the TOC, viewing a full screen image, browsing
reading stats... would call paintTo() on ReaderUI (so, asking
the engine to render the page) or FileManager (so, rendering cover
images) even though their content is hidden.
Widgets registering to UIManager have to explicitely states
they cover the full screen (UIManager can't know, parts of their
dimen may be transparent, e.g. if it is a CenterContainer).
Configure number of items per page (from 6 to 24) - default is 14
Allow filenames to wrap so that we can see the full name
Used by File browser, History, Search Result, Bookmarks, Table of contents (only single line), File chooser, OPDS catalog
Also fix a few crash possibilities when unhighlighting.
Also fix bug with binary search that could not be able to remove bookmark
when there are multiple bookmarks/highlights on the same page.