Also allows for updating the fallback font and see results
in real-time on the underlying document.
Bump crengine for: fix updating fallback font
Also adds a menu item to generate a html document showing some
sample text rendered with each available font (only if the user has
a file koreader/settings/fonts-test-sample.html with some HTML
snippet of his choice).
Avoid drawing the fill bar our of the progress bar.
Avoid zero divided by zero that return 'nan' (Not a Number),
that does not bother lua code, but will crash libblitbuffer.so
when it gets nan as a coordinate.
New module RenderImage (alongside existing RenderText) to provides
image rendering and scaling facilities.
Uses MuPDF, but tries first giflib on GIF.
Allows for getting all the frames from an animated GIF.
When hyphenating a word, the existing algorithms enforced a minimal
length of 2 for each word fragments on left or right side.
This adds a widget to allow changing these minimal sizes (from 1 to 10).
Removed width:80% as it was never supported by crengine (the effect
was achieved thanks to margins and paddings).
Wikipedia saved articles from now on won't be effected by a double
effect if we later add full support for width: into crengine.
* Wiki Save as EPUB: various encoding fixes
Fix display of & in article titles
Fix display of &, <, > in TOC entries and in targeted anchor (the mismatch
with the target id made these TOC entries invalid and simply not displayed).
Remove percent-encoded URLs tweaks for crengine now that crengine
correctly supports them (each percent encode handled as an UTF8 byte).
Bump crengine for that.
Don't include <meta name="cover"> when no cover present.
* bump base/crengine
Transifex warns about some issues but this is not one of them.
The proper solution would be `padding_right`. But although it's supported on FrameContainer it's not passed on through TextBoxWidget.
If the device supports it, add a checkbox for enabling automatic
warmth, and a widget for setting the hour at which warmth should be
maximal ("bedtime").
The hour can be changed through +/- buttons; holding them will change
with 30min steps. As soon as automatic warmth is enabled, the 'warmth'
cannot be changed manually anymore, so we make its widget grey, but
the current value is still displayed correctly. Changing the hour
changes warmth accordingly.
* [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
* [toggleswitch] Add support for key navigation to this widget
Add the onFocus an onUnfocus event handler
add a new function that just circle the switch if not touch event is
detected
* Add key navigation to the readermenu
The shortcut is still Alt-gr on sdl, to be defined on Kindle
* Remove the old method of handling the Press key.
Now the event is handled by the main widget who implement focusmanager
and then dispatched to the currently focused item.
Modify the fine font tuning only for non touch-devices
See : https://github.com/koreader/koreader/pull/3785#issuecomment-375306466
Emulate the hold touch behavior on non touch device by clicking the right key
ButtonTable: do not add vertical separator to the layout because the focus
manager can't traverse them. Add check to make disabled button non-clickable.
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).
Also uses PathChooser (instead of InputDialog) in 'Set Wikipedia
Save as EPUB directory'. When setting not yet set, propose to
create and use ~/Wikipedia/ .
* [device][kindle4] add fake event to kindle4
* modify focusmanager to allow for more complex layout
The focusmanager now naviguate the layout by avoiding nil value
instead of relying on table lenght. It should be completely backward
compatible
* add Dpad naviguation to the touchmenu
* fix crash because virtualkeyboard on non touch device
the kindle4NT has no keyboard nor touch, the fix open the virtual
keyboard so koreader dont crash but it's not useable
* Enable device with keys to use the touchmenu
* Don't get stuck in reader progress statistics plugin
* [underlinecontainer] Fix and remove unused function
References #1898.
For devices with natural light (KA1, H2O2), add new button 'Configure'
at the bottom which will open the naturallightwidget, which will be
placed at the top. The frontlightwidget will be moved to the bottom,
and both have permanent focus. This way, you can change the parameters
and immediately test them by changing the frontlight level and
warmth. On the KA1, both widgets will easily fit, but on smaller
devices it may be that they overlap.
Since the frontlightwidget will keep focus, we disable the 'Configure'
button when the naturallightwidget opens. We also remove its 'Close'
button and disable 'onTapCloseFL', so that the frontlightwidget cannot
be closed while the naturallightwidget is displayed.
This widget is used to configure the natural light on KA1/H2O2. It
allows the user to set the gain/offset values for white/red/green, as
well as the exponent used in the formula.
Numbers can be changed via screen keyboard or through the plus/minus
buttons next to the numbers (holding the buttons will in/decrase with
smaller steps). Changes are applied immediately, but will only be set
permanently if 'OK' is pressed. If 'Cancel' is pressed, the new values
are discarded and the old ones restored. Also, pressing 'OK' will save
these values in the koreader settings file (there's no support for
changing these values in Nickel, so there's nothing to sync to its
config file). The 'Restore Default' button will install the original
defaults that were derived from Nickel's behavior.
This widget is meant to be called from the frontlight widget and is
placed at the top, so that the frontlight widget can still be used to
test the current values (see next commit).
Some Hold and move (hold on title and move away from it) would not work.
Pan (=swipe with hold at end) while selecting text would move the
window (it now does nothing: proper text selection still needs Hold
on word at start).
Also increase hold duration from 2s to 3s (for switching lookup
between dict/wikipedia) to be consistent with the 3s duration in
readerhighlight.
If the device supports natural light (currently only KA1), extend the
frontlight widget to also allow for changing the 'warmth' value. We
more or less duplicate the widget for 'brightness', with the exception
that we drop the 'toggle' button, which does not make much sense for
the frontlight's warmth. Also, we add captions 'Brightness' and
'Warmth' for clarity.
First item would be underlined if the device is both Touch and Keys
capable (emulator, android, pocketboot...), which is not really
pretty. Delay that till Keys for focusing are really used.
Also fix some bad filename and extension in epub's OEBPS/content.opf,
Store image files (jpg, png, gif) uncompressed in the .epub as they
don't need compression.
crengine may now give us multiple authors (if multiple <dc:creator>
in epub metadata) separated by \n.
Deal with that where needed.
Limit the number of authors displayed in coverbrowser views.
Bumped base/crengine: multiple <dc:creator> + fix mobi images order
Bumped base: util.runInSubProcess(): give child its own process group
When no manually added specific 'poweroff' or 'reboot' screensaver
settings, use the suspend/sleep settings set via menu with an added
overlay message in top right corner.
Generalized some settings: "White background behind message and images"
and "Stretch covers and images to fit screen", and move "Exclude this
book's cover from screensaver" up a level (and remove this menu item
added by ReaderMenu when closing document).
Don't use memory cache with rendered screensaver images.
ImageWidget: fix wrong behaviour (stretch) when 'file', 'width',
'height' and 'scale_factor' provided: now, keep aspect ratio.
ImageWidget: increase file image mem cache (mostly used for icons)
from 2 to 5MB to be ready for devices with very high DPI.
(each one at top right of each page)
Such images can be loaded dynamically when the display of a page requires it.
Allow alternating between the image and its title with Tap on it.
Allow for viewing this image zoomed in ImageViewer with Hold on it.
DictQuickLookup: add generic support for result.images, that
could optionally be provided in Wikipedia lookup results.
New TrapWidget: invisible full screen widget for catching UI events. Can
optionally display a text message at bottom left of screen (ie: "Loading..."),
used by default by Trapper:dismissable functions when no widget provided.
Added Trapper:dismissableRunInSubprocess() to run a lua function in
a sub-process, allowing it to be dismissed, and returns its return
value(s).
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
* Adds a generic HTML widget modeled after the text widget, and HTML dictionary support. HTML dictionaries can have their own CSS (for X.ifo it must be X.css). The base CSS just resets the margin and sets the font.
Note that the widget doesn't handle links, that wasn't needed for the dictionary.
Closes <https://github.com/koreader/koreader/issues/1776>.
* Show tag stripped HTML if the dictionary entry isn't valid HTML
* Simulate the normal <br/> behavior
* Bump base
Use "message" as the default for screensaver (instead of "disable") (https://github.com/koreader/koreader/pull/3535#issuecomment-353337143)
On Kobo
Fix: display message on poweroff or reboot (https://github.com/koreader/koreader/pull/3535#issuecomment-352355865)
Allows for overwritting these default messages with the classic screensaver settings, by just prepending "poweroff_" or "reboot_" to them. (https://github.com/koreader/koreader/pull/3535#issuecomment-352498497)
So one can manually add to its settings.reader.lua:
```
"poweroff_screensaver_type" = "random_image" or "message", "cover", "bookstatus", "readingprogress", "disable",
"poweroff_screensaver_dir" = "path to same as screensaver_dir or alternate dir for poweroff image(s)",
"poweroff_screensaver_message" = "message to use instead of Powered off",
```
```
"reboot_screensaver_type" = "random_image" or "message", "cover", "bookstatus", "readingprogress", "disable",
"reboot_screensaver_dir" = "path to same as screensaver_dir or alternate dir for reboot image(s)",
"reboot_screensaver_message" = "message to use instead of Rebooting...",
```
Partial, as it will safe the state when suspending the reader by pressing the power-button.
However, it will still not safe the state when Pocketbooks autoPowerOff-Feature kicks in, as this does not create an event (e.g. no EVT_BACKGROUND) of any kind.
* Clean up device.lua
* Save state on suspend
* Properly create intermediate directories when receiving books from Calibre.
This fixes an issue where you can't receive books except into directories that
already exist on the Kobo, which, in particular, causes problems when your
configuration in Calibre is something like "put books in $Author/$Title.epub"
and you haven't previously synced any books by that author.
* Wake up periodically to process ZMQs if any are registered.
This fixes an issue where if there are any timed events (such as the suspend
timer) in the queue, ZMQ events may not get processed until the timed event
fires, which is a problem when (for example) the suspend timer goes off in
an hour and you have something trying to send a book to the kobo over wifi
*right now*.
With this change, the event loop will wake up every 50ms to check for ZMQ
events and process them if necessary. If there are no ZMQs registered (which
is typical), it uses the original behaviour -- so this won't affect battery
life under normal usage.
- Fix links to wikipedia pages containing '?oldid=123', that
wouldn't work when used back thru the API.
- Make external links to other wikipedias with a different langage
work (they didn't work when non-ascii page titles)
- Speedup download of images by using a newly added 'fast_refresh'
option to Trapper:info() to bypass UIManager.
* Prevent open screensaver more than one in the same time
* Add option to enable/disable background in message screensaver
* fallback to random images if this book cover is excluded feature + fix Disabled (leave screen/page as it is)
* Autostretch disable by default, more fallback options, leave screen as it is
This feature, introduced some days ago, was actually
doing 2 updateItems calls: the initial one, and a second
to switch to focused_file page (cheap with classic display mode,
less cheap with CoverBrowser modes).
This change allows doing that in a single call.
To make it more alike bottom menu:
- left and right border not displayed
- line below icons extends to screen borders
- same bottom border size
And make separator lines have same padding on both sides
When going from reader to filemanager, we are in the directory
containing the last_file. With this, we will also be on the page
showing this file.
When in filemanager and going up (".."), we will also be on the
page containing the directory we came from.
Rationalize horizontal construction of Menu items (TOC,
Bookmarks, Classic file views) for more even padding.
Align "x" close button diagonaly with top right border and title.
Also add forgotten scale_for_dpi to MultiConfirmBox
This makes button heights similar in all uses of ButtonTable.
It depended on how the ButtonTable was used in each widget
(previously, first and last row may have different sizes than
the others).
buttontable.lua: more even buttons height whether zero_sep or not
framecontainer.lua: added padding_top/bottom/left/right (similar to
what was done for iconbutton)
The following widgets have been adapted for this, with some
additional fixes:
buttondialog.lua
buttondialogtitle.lua: wider title with adequate padding
confirmbox.lua + multiconfirmbox.lua: dismissable via tap outside
inputdialog.lua + multiinputdialog.lua: more even vertical padding between elements
imageviewer.lua
textviewer.lua
datewidget.lua
timewidget.lua
Additionaly: frontlightwidget.lua: fixed width of progress bar that
was exceeding window width since the Size scaling adjustements
Decide baseline vertical position according to font metrics, instead
of the hardcoded 0.7 (in textwidget, which made the text a little
bit up in its box), and 0.75 (in toggleswitch, which made the text a
little bit down in its box). This usually gives a value around 0.72
or 0.73 with our ui fonts, which looks about right.
ReaderFooter: add bottom padding, now that our text goes a few pixels lower
"partial" refresh causes a full (without black flash) refresh on
Kindle (which uses REAGL mode for partial refresh). This causes a
full redraw of widgets, which is a bit distracting with some of them:
- dictquicklookup: when showing next definition
- infomessage: when displaying a new one (Wikipedia Save as epub)
Also fix bottom menu, that even when closed, would still register
bottom area as dirty: this would cause top menu navigation to
cause a full partial refresh, only noticable on Kindle.
* Fix crash with keyboard navigation of onHold buttontables
Would crash when encountering a separator or when the number
of buttons in a row changes.
* Reset previous selected item on new buttontable
For years they've been smaller on higher DPI devices and likely very few people realized it was technically a bug. These values round up on lower DPI and smaller screen devices.
References https://github.com/koreader/koreader/issues/3265
Closes: #3236 and #3235
Details:
> Also, when looking in days, we see info how many hours we read. It would be great if we could tap a day, it opens info on book(s) we read that day with info pertaining to that day, and if we tap on book, we receive book info for that book.
> Statistics plugin is really great, I started to look in my reading statistics now much more, but all the time I can go only in one way. And I need to exit at lowest level of info. It would be great if I can use statistics plugin like part of menu, to go up and down within statistics data and exit at my wish, not when I have to.
Also added:
* new statistics book by week
* new statistics book by month
* last year by week now we can see days in selected week
* Cache scaled images with scale_for_dpi
* Don't update original self.scale_for_dpi
A same ImageWidget object can be free()'d and re-render()ed,
and we would then lose scale_for_dpi on next renderings
Made the onHold buttons table similar to the one of File browser.
Added "Purge .sdr" and "Delete" to these buttons.
Moved the purgeSettings and removeFileFromHistoryIfWanted
logic into filemanagerutil functions.
Stay on the same page when manipulating history (previously, we were
always put back on first page).
Really keep deleted files in history (unless setting says otherwise).
Show deleted files in grey or dimmed in classic History and all
CoverBrowser display modes.
This module provides methods for simple interaction with UI, without
the need for explicit callbacks, for use by linear jobs between
their steps.
Uses coroutines, but their usage is hidden by a simple API.
Factored out of Wikipedia:createEpubWithUI().
* frontlight on kobo: a few fixes
Rewritten to not update NickelConf on every change, and never
if KOBO_SYNC_BRIGHTNESS_WITH_NICKEL = false.
Reintroduce global settings frontlight_intensity and
is_frontlight_on to keep level and state across koreader
sessions.
Fix a few of the remaining issues on kobo light.
Ensure settings are saved when rebooting/powering off from
File browser.
* Ensure untoggle works when starting with light off
* fixes#2898 (prevents accidentally triggering reboot or poweroff)
Add ConfirmBox before reboot/power off
* increases clarity by preventing second page
* add "sleep" menu entry
* Add exit menu hold callback
Just under the existing "Embedded Styles". Support for this
was already there in crengine, and interfacing is similar to
what is done with Embedded Styles.
* Put back fl_min=0 as it is for all other devices (the idea
fl_min should be 1 and toggling managed some other way is
not implemented in current code).
* Fix a few frontlightwidget issues
* CoverBrowser plugin: alt views for File Browser and History
* Added Prune cache and Compact cache menu actions
* Support for book descriptions, and settings stored in db
- Factored out duplicate code from filemanager.lua and filemanagerhistory.lua
to new filemanagerbookinfo.lua (and other common code to filemanagerutil.lua).
- Uses sidecar files' new doc_props and doc_pages settings, or fallback to
old 'stats' settings, or to opening document.
- Shows filename, filetype and directory.
- Shows description (Hold to see whole truncated text), keywords, and
cover image (tap to extract image from document and display it if available).
- Book information now available from reader menu, to display info about
the currently opened book.
- Convert possibly HTML description to plain text via added
util.htmlToPlainTextIfHtml() (for simple HTML conversion).
* Use PluginShare to exchange data between plugins
* Remove legacy code in reader.lua and kobo/device.lua, and move KOBO_LIGHT_ON_START to kobo/powerd.lua
* A better sync config logic
* Consider kobo without hardware frontlight toggle
* update frontlight widget once toggle is tapped.
* Force refresh when kindle is out of screensaver or usb is unpluged.
* Improve AutoFrontlight
* More plugins sub menu
* Last brightness should always be updated
* Finish autofrontlight improvement and enable it by default.
* More tets
* onFlushSettings
* MenuSorter can now correctly sort sub menus
* [fix] stop propagation of tap events
when triggering reader menu
And also get rid of unnecessary screen refreshes on Kindle Voyage.
The "progress" window for dict lookup is also eliminated as most of the time dict lookup is an instant process, and the "progress" window is preserved for wikipedia lookup as it may take longer time to show the result window.
* [up] add an option to disable dictionary fuzzy search
* [fix] tidy up require
* [fix] fix read settings
* Add a basic Japanese keyboard layout
Allow for entring Japanese text into text boxes. Only supports kana
and latin letters due to limitations of current VirtualKeyboard
implementation (complex text input with conversion is not possible).
* Allow keyboard layouts to declare custom modifiers
Refactor modifier key setup code and existing keyboard layouts so
that each layout can declare custom modifier key labels. This
allows for greater extensibility and for future keyboard layouts.
* newsDownloader - atom support initial version
* NewsDownloader: update example feed config (use Reuters atom source)
* NewsDownloader: InfoMessage when unsupported urls
* NewsDownloader: update menu_item id
* NewsDownloader: change text label
* translation text fix
* quickstart(fix): go back to home dir after document close
* quickstart(fix): purge old quick start files
* spec: fix quickstart tests
* 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
* Swipe for menu and quickstart guide
Because swiping for the menu is a big change from what we're used to, this commit includes a new quickstart guide.
Fixes#2608.
* add some dev docs
* add FileConverter spec
* add QuickStart spec
* add Version module
* add Version spec