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

751 Commits

Author SHA1 Message Date
onde2rock
53e7a0b6c9 [Non-touch] Add a menu item to toggle a bookmark on the current page (#4262) 2018-10-16 21:05:58 +02:00
poire-z
fa0117bb2a Fix default not being used for View mode and Progress bar
Default setting set by holding on the bottom config buttons
for "View mode" (scroll/page) and "Progress bar" (full/mini)
were not used.

Also, when switching Progress bar from 'full' to 'mini',
show the mini bar again.
2018-10-14 21:32:31 +02:00
poire-z
1b3d974bec Footnotes: fix current link being unhighlight in some cases
When a link is covered by the footnote widget, we highlight it
again when closing the footnote, and schedule an unhighlight
0.5s later.
When we tap on another footnote link, this was happening too
but the unhighlight unhighlighted all, including the new
footnote link.
This disable the former when the latter happens.
2018-10-14 21:32:31 +02:00
poire-z
9d8531a4b5 Fix footnotes and markers with full status bar
Take full/top status bar's height into account when
computing coordinates.
Also wrap getPageMargins() in CreDocument, so we
don't use cre.cpp _document directly anywhere else.
2018-10-14 21:32:31 +02:00
Martín Fernández
717184f1d6 move e-ink related settings to a submenu (#4246) 2018-10-10 21:34:47 +02:00
onde2rock
42a7dd4502 disable panning in page view_mode (#4265) 2018-10-10 20:39:34 +02:00
poire-z
f9086a2ba9
EPUB links: show footnotes in popup, larger tap area (#4261)
Adds new options to the Links> submenu, for now only
available and used with CRE documents.
- Allow larger tap area around links
- Ignore external links
- Show footnotes in popup
- Show more links as footnotes

(This last item is mostly for testing and loosening the
footnote detection algorithm, and see how it would behave
with glossary-like links and inter glossary terms links.)

Fix distance computation from gesture position to link by
using segments.
Code for detecting if a link is a footnote is in cre.cpp, and
tweakable a bit with flags in ReaderLink:showAsFoonotePopup().

Footnotes HTML content is displayed by a new FootnoteWidget,
which uses MuPDF for its rendering.
From it, swipe south or tap outside to close, swipe to the left
to follow the original link and jump to the footnote location
in the book.

Also fix tap on highlights after the recent change to use segments
for displaying: use segments also when checking taps.
2018-10-10 18:50:24 +02:00
poire-z
0e2a3b6263 Selection menu: allow viewing HTML 2018-10-08 22:04:50 +02:00
poire-z
6ab34c6d1d cre highlights: draw segments instead of word boxes
It gives a cleaner drawing of multi-lines selected text.
Bump base and crengine.
2018-10-08 22:04:50 +02:00
Robert
b9baa10d22 Minor changes of gesture manager (#4257) 2018-10-05 20:20:00 +02:00
Robert
949c856447 Gesture manager - fix refresh switch to night mode (#4252) 2018-10-01 20:24:10 +02:00
Robert
046a47ff98 Gesture manager - fix (#4251)
* remove comment from buildMenu
* updateFooter in full refresh
2018-10-01 13:00:12 +02:00
Robert
dc5a479b66 Gesture manager (initial) (#4240)
Manager supports separate gestures for the file manager and the reader. Gestures from the manager have a higher priority than built-in gestures.

Settings available in Gear -> Device -> Gesture manager
2018-09-29 23:15:57 +02:00
Robert
bd154e0bc3 Change skim mode menu & dialog title (#4223) 2018-09-18 21:37:13 +02:00
poire-z
850be52177
Keep some menus open when Tap or Hold (#4189)
TouchMenu: added options to menu items with the following defaults:
    keep_menu_open = false
    hold_keep_menu_open = true
So, default for Tap callback is to close menu, and for Hold callback
to keep menu open.
In both cases, provide the TouchMenu instance as the 1st argument to
the callback functions (instead of a refresh_menu_func I added in #3941)
so the callback can do more things, like closing, refreshing,
changing menu items text and re-ordering...

ReaderZooming: show symbol for default (like it was done for
ReaderFont, ReaderHyphenation...)
TextEditor plugin: update the previously opened files list in real
time, so the menu can be kept open and used as the TextEditor main
interface.
SSH plugin: keep menu open and update the Start/Stop state in real time
ReadTimer plugin: tried to do what feels right (but I don't use it)

Also remove forgotten cp in the move/paste file code
2018-09-04 23:55:58 +02:00
poire-z
6f2368e3bc
cre: configurable kerning method (off/freetype/harfbuzz) (#4167)
Bump base & crengine for HarfBuzz support.
2018-08-17 23:08:21 +02:00
Robert
4428ecb422 Plugin manager (#4159)
Also adds descriptions to all plugins.
2018-08-17 20:54:11 +02:00
poire-z
48c85e7deb [UX] SkimTo/GoTo: add origin page to location stack (#4162) 2018-08-15 15:22:55 +02:00
Robert
225b5d417d Adds ReaderDeviceStatus: low battery alarm (#4144) 2018-08-11 22:47:33 +02:00
poire-z
c1206888ab Hyphenation: speed up book loading by setting hyph algo earlier (#4142)
Setting the hyph algo before loading the document may save crengine
from re-doing some expensive work at render time (the hyph algo
is accounted in the nodeStyleHash, and would cause a mismatch if it is
different at render time from how it was at load time - "English US" by
default - causing a full re-init of the nodes styles.)
We will only re-set it on pre-render (only then, after loading, we
know the document language) if it's really needed: when no algo saved
in book settings, no default algo, and book has some language defined.
2018-08-07 18:37:52 +02:00
poire-z
1d18b01cf7
PathChooser: clearer usage and behaviour (#4133)
Explicit new options: select_directory, select_file, show_files.
With select_directory, show an entry to select current directory
(so, removed undocumented hack "hold on .. to select current
directory").
2018-08-06 20:59:01 +02:00
poire-z
9971eb8533 Fix untranslatable strings (#4132)
Some problem somewhere with [[...]] strings starting with a
leading newline. Should probably be allowed, but for now
fix the few such cases to allow them being translated.
2018-08-01 19:29:03 +02:00
NiLuJe
0924b57877
Tweak/unbreak my CPUFreq experiment (#4119)
* Only switch to ondemand when we actually can, and when it's better than the current governor...
  This potentially leaves Mk.5 in the lurch, but there's no perfect solution there :/.

* Switch to UI for the unmark event of navigation hints markers
Might help on non-REAGL devices, and doesn't hurt there (re #3983).

* Switch SQLite DBs to WAL
Sounds nice in theory, behaves fine in practice.
2018-07-29 03:53:57 +02:00
Robert
a8e4ce8b01 Footer: launch SkimTo (instead of GoTo) on long-press (#4097) 2018-07-24 21:47:07 +02:00
poire-z
d8d0def122
Floating punctuation: change default to disabled (#4101)
It was enabled by default, but it's mostly only needed for CJK users.
Furthermore, when floating punctuation is enabled, some rendering
issues exist (text right alignment, variable margins...) that
only CJK developpers could really fix. So, best to disable it and
avoid these rendering issues for most users.

Also: fix CoverBrowser crash when "Delete cache database"
followed by "Prune cache of removed books".
2018-07-24 21:01:45 +02:00
Robert
00cfc469f1 Allow selecting a single image as screensaver (#4095) 2018-07-23 10:37:24 +02:00
Robert
d4ebcd26c9 [Minor] make "Keep this directory" translatable (#4090) 2018-07-20 00:06:23 +02:00
poire-z
0d66ea7555
Text input fixes and enhancements (#4084)
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.
2018-07-19 08:30:40 +02:00
poire-z
7666644362
Bookmarks, CoverBrowser: scale dogear icon (#4081)
The Dogear icon is 20x20 pixels and was never scaled where used. Now:
- The bookmark icon (top right of screen) is scaled to 1/32th of the screen
width (previously, it was 1/30th on a 600px wide emulator, 1/53th on a GloHD).
On CreDocument, furthermore decrease its size if needed depending on the
selected margins so it never overwrite the text.
- CoverBrowser list view: scale it to the available room under
the "N % of P page" text, so it does not cover "page".
- CoverBrowser mosaic view: scale it to 1/16th of the cover rectangle, which
should prevent if from overwritting the text thanks to a max text width of
7/8 of the cover rectangle.

Also for CoverBrowser: don't index metadata for unsupported document
(which could happen when browsing files with PathChooser) and show
full filename for such documents.
Also: ImageWidget: small fix in case we use both scale_factor and
scale_for_dpi.
2018-07-19 08:18:55 +02:00
poire-z
8c9fe9b589
Allow following links to local files (#4064)
Also use the new ReaderUI:switchDocument(new_file) when
already in ReaderUI in the other cases we switch document.
2018-07-11 18:05:30 +02:00
NiLuJe
6835c18ee6
Re-exec startup script on Kindle/Kobo when an OTA update is processed on startup (#4062)
So that we may properly pickup potential updates to the startup script
itself.
2018-07-07 22:27:38 +02:00
poire-z
8ee741f538
Fix occasional incoherent back xpointer when following a link (#4061)
In rare cases, the origin xpointer when following a link
was detected as incoherent, and not used when going back,
so no left margin marker was shown.
2018-07-07 20:22:44 +02:00
poire-z
8b3432ae76 Reader menu: adds "Open previous document" (#4056)
* Reader menu: adds "Open previous document"

Allows for quick switching between 2 documents, and keep
symmetry with FileManager menu "Open last document".

* Use "Last:" and "Previous:" when Show filename
2018-07-07 13:03:33 +02:00
poire-z
d8e58a08fd
bump crengine: adds support for dpi-based css units (#4040)
Adds a new toggle to the bottom menu: Zoom (dpi), which
allows for scaling CSS absolute units and image sizes.
2018-07-03 07:05:57 +02:00
Robert
d29a65b96e cre: add Word Gap setting to bottom config panel (#4026)
Maps to crengine's Space Condensing feature (named Word Gap
as a similar feature is named for PDF)
2018-06-30 16:55:43 +02:00
poire-z
d3d30c405a
bump crengine: fix handling of soft-hyphens (#4025)
Adds a new Hyphenation method: Soft-hyphens only.
Adds a new toggable option, usable with Algorithm and language
based methods: Trust soft hyphens (if enabled, if soft hyphens
found in word: use them and skip regular method).
2018-06-28 23:27:03 +02:00
poire-z
6877ade4fd
Remove cre cache file when deleting a book (#4022)
Store the cache file path in book settings, so we can
delete it too when deleting the book.
2018-06-25 23:38:02 +02:00
poire-z
c3a938aad6
bump crengine: alternative TOC, no page break on borders (#4011)
Includes:
- Avoid page break between a node and its borders
- Allow building an alternative TOC from document headings

On CRE documents, allows toggling between original TOC and an
alternative TOC with long-press on the "Table of content" menu
item.

Also update the Wikipedia stylesheet to further avoid
page-breaks between images and their caption, so a full
bordered wikipedia thumbnail is always full on a single page.
2018-06-14 00:46:52 +02:00
Robert
901a1e46da Exit to file browser after finishing reading quick start guide (#4009) 2018-06-13 21:43:50 +02:00
poire-z
9a0728e421
Style menu cleanup (#3996)
Use epub.css as the main default style, with all file formats
except FB2 (which needs fb2.css).
(epub.css has been cleaned recently to be more conforming to HTML
specs and to not include class name based styles - with conditional
compatiblity styles for previously opened documents. It should be
usable on all HTML based documents, except FB2 which has some
incompatible specs.)

Consider all shipped css files other than "epub.css" and "fb2.css"
obsolete, and put them in a sub-menu (these other css files have
not been updated in the same way, and are kept as-is for when a
previously opened document requests one of them).

Add an icon indicating which style is set as default (like it's
been done for the Font and Style tweaks menus).

Also set the font size of the full status bar (available with
cre documents) when the setting "cre_header_status_font_size"
is present in settings.reader.lua (to add manually).
2018-06-06 13:18:29 +02:00
Robert
6abc1262dd Screen refresh between chapters (#3989) 2018-05-30 00:28:47 +02:00
poire-z
9b6b91b743
TouchMenu: added hook to show help text on long-press (#3980)
When Hold and there is no hold callback attached to a menu item, a help_text
attribute, when present, is shown in an InfoMessage.
2018-05-25 20:56:37 +02:00
poire-z
b498d872be
bump crengine: LI and CITE fixes are now the defaults (#3976)
Books previously opened (that have a metadata.lua, whether with
highlights or not, but because they all have a last_xpointer that
points to the current page, that can be broken too by the changes)
will continue to have the old wrong behaviour, so they won't be
impacted by the breaking changes.
Update cre_dom_version code to use the new functions from cre.cpp.
Remove these Workarounds from Style tweaks.
2018-05-25 00:22:08 +02:00
poire-z
07713be429
Adds "Better rendering of list items" to Style tweaks (#3968)
Alternate rendering of list items as block elements (instead of
inline/final).
Check the built DOM is still coherent with styles on stylesheet
change, and propose to reload the document if not. Also
invalidate cache on close in that case so a new DOM is built
at next opening.
ReaderStyleTweak: fix tweak css duplication; when globally
enabled, when disabling and re-enabling locally, the css would
be added twice to the final CSS.
Also adds !important to "sub_sup_smaller" tweak, and increase
its priority so it can override "font_size_all_inherit".
Adds CreDocument:getCacheFilePath() for futur features.
2018-05-21 01:19:36 +02:00
Robert
6a98dbaec7
Always close filemanger before open document (#3935)
* Always close filemanger before open document

* rev1
2018-05-20 16:35:53 +02:00
Robert
136a72f316 [UX] Notification are displayed too short (#3962)
Changed from 1 second to 2.

I also fixed the problem with blocking the UI when displaying the message. Now notification box is closed after taping anywhere (like InfoMessage).
2018-05-19 14:01:20 +02:00
poire-z
1144efafff ReaderRolling: update footer when TOC is updated (#3950)
Footer item "pages left in chapter" was wrong when changing font
sizes or some other layout option (the footer was drown before
this happen, and not after, until we later change page).
Seems to also fix possible wrong ticks position in that case
(may be only when cache is used/re-used, for some not really
obvious reason)
2018-05-14 22:06:35 +02:00
poire-z
9e4cb59327
Re-order typeset menu (#3946)
And add symbols for default and fallback to the Hyphenation
menu, as it was done recently to the Font menu.
2018-05-14 20:35:49 +02:00
Robert
fbd549bcfd
End of document action (#3943)
* End of document action

* Rev1

* Rev2

* Rev3

* File browser
2018-05-13 13:07:23 +02:00
poire-z
5b7664b064
Style tweaks: use css snippets to tweak book styles (#3944)
Adds a new menu "Style tweaks", with a few CSS snippets
that can make some things better with some books.
2018-05-12 23:24:43 +02:00
poire-z
a9905c5129
Font menu: add symbols for default and fallback fonts (#3941)
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).
2018-05-11 17:48:26 +02:00
poire-z
8b2253b3e9
bump base: crengine, freetype, libjpeg-turbo (#3928)
Includes:
- [build] FreeType: bump to 2.9.1
- [build] bump libjpeg-turbo to 1.5.3
- bump crengine:
 - Fix CSS selector specificity computation
 - [fix] crengine/src/lvfntman.cpp: improve letter_spacing limit
 - [fix] crengine/src/lvxml.cpp: add all empty HTML elements
 - html head styles: fix styles not being applied
 - Hyphenation: increase MAX_PATTERN_SIZE from 16 to 35
 - html documents: proper handling of <BR> tags
 - Allows requesting old (broken) XML/DOM building code
- cre.cpp: setStyleSheet(): accept filepath and/or css text,
  and added getIntProperty() and getStringProperty()

credocument/readerrolling: request older XML/DOM building code
for books previously opened, to not lose bookmarks and highlights

(unit tests update because of new handling of consecutive BR via css
pushed links down in the book)
2018-05-05 00:38:50 +02:00
poire-z
24d4ab43c4
dict: convert htmlentities in non-html text results (#3921) 2018-05-01 13:30:02 +02:00
onde2rock
dad7f209fa [CI] Add a check to detect tab in lua files (#3919) 2018-04-29 15:15:11 +02:00
poire-z
4bb3999cbc RenderImage: factorize all image rendering and scaling code
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.
2018-04-22 17:00:29 +02:00
Ruoyu Sun
7f15b3a142 Fix the bug where "Press" key does not open config menu on Kindle 4 NT (#3898) 2018-04-19 20:44:13 +02:00
poire-z
7f6aebe399
cre hyphenation: allow for setting min left/right fragment length (#3890)
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).
2018-04-19 14:24:04 +02:00
poire-z
82b13a64b0
Fix overlap in scroll mode for cre documents (#3870)
Use a setting 'copt_overlap_lines' (default to 1) for the
number of text lines from previous page to show on next
page (instead of a hardcoded and unscaled 20).
Take footer height into account for overlap calculation
and dim area.
Show overlap only when changing pages (not when panning).

Also fix ReaderFooter:getHeight() which was returning
a higher height than the real one since footer refactoring.
2018-04-14 00:26:57 +02:00
poire-z
f63975d9db ReaderBack: allow for disabling back history (#3862)
Mostly useful for developers for quick launch & quit of
the emulator.
2018-04-12 08:41:59 +02:00
onde2rock
5aacc761e1 [UX] Implement back_to_exit option (#3838)
Also goes back to File Manager as default view first.
2018-04-09 09:22:16 +02:00
poire-z
2473ebce01
Wikipedia link: check if previously saved as EPUB (#3837)
Also makes MultiConfirmBox movable, like ConfirmBox is.
2018-04-06 21:13:25 +02:00
Frans de Jonge
2c1178896c
[feat] Add ReaderBack (#3821)
This implements a reasonable facsimile of going back on Android.

The back button first goes back in a history of visited pages.
When there's no history left, it closes the app.

Fixes #3816.
2018-03-31 21:19:31 +02:00
onde2rock
e502bf04d3 [feat, UX] Support the virtualKeyboard on non touch-device (#3796)
* [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
2018-03-30 12:46:36 +02:00
poire-z
e21fe55042 [UX] Remove search highlights when closing search bar (#3804)
They were indeed removed, but no full screen refresh was requested,
so the highlights stayed visible.
2018-03-26 21:10:46 +02:00
onde2rock
dfd87447da [UX] Make the reader bottom menu compatible with key navigation (#3785)
* [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
2018-03-22 21:01:38 +01:00
Frans de Jonge
65a63d244b
[UX] SDL2: set window title (#3784)
This initial implementation only sets the title for FileManager and ReaderUI.

Fixes #3713.
2018-03-21 20:10:35 +01:00
Frans de Jonge
96242648c8
[UX] apps/reader/modules/readerfooter: also redraw progressbar on height change (#3780) 2018-03-20 21:41:53 +01:00
poire-z
5e47a83e6a
UIManager: avoid painting widgets covered by a full screen widget (#3770)
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).
2018-03-17 23:02:32 +01:00
poire-z
50a96ce2b2 Fix some texts (#3769) 2018-03-17 18:41:26 +01:00
poire-z
b3b7e3d279 Remove some leading and trailing newlines (#3768)
in some InfoMessage and ConfirmBox, introduced willingly
or not, that cause top or bottom padding
2018-03-17 18:13:04 +01:00
poire-z
b46628c08c
new option: Save Wikipedia EPUB in current book directory (#3762)
Also uses PathChooser (instead of InputDialog) in 'Set Wikipedia
Save as EPUB directory'. When setting not yet set, propose to
create and use ~/Wikipedia/ .
2018-03-16 20:47:51 +01:00
poire-z
0a4fb89239 Fix possible crash with config panel when engine switched (#3761)
Reading an epub file with Mupdf would show 6 items in bottom
config panel. Reading it with crengine would show only 5.
A crash would happen if we were on the 6th when leaving MuPDF,
and later opening config panel with crengine.
2018-03-15 15:39:44 +01:00
onde2rock
e8aab49ee9 Kindle4NT improvements (#3745)
* [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.
2018-03-14 22:16:38 +01:00
poire-z
7d71d73cc4
Speed up page turning on big cre documents (#3740)
Page turning, menu opening, ... everything actually
2018-03-12 20:46:40 +01:00
poire-z
c93bbec40d
cre: more constrast settings (#3737)
Use ButtonProgress like it was done for kopt.
2018-03-11 14:54:17 +01:00
Frans de Jonge
076bf406fd
[UX] Add InfoMessage about OCR (#3718) 2018-03-05 16:38:04 +01:00
poire-z
5bc18b3c78 [fix] Long Hold on DjVu/PDF documents crash (#3697)
Holding on a word for more than 3s should bring the highlight menu.
It crashed on readerpaging documents because self.hold_pos is no more
a Geom object with them.
Also inverted selected_word/selected_text logic, as with PDF, selected_word
stays set when selected_text is available.
2018-02-26 17:25:34 +01:00
Frans de Jonge
f15732bbe5
[fix] larger max font size for crengine (#3676)
Fixes #2686
2018-02-10 22:20:09 +01:00
FranMarelli
229c492979 [feat] Two-column navigation (#3674)
New zoom configuration available among the others
Allows to easily navigate in two-column documents
In order to  work properly, **scroll mode must be deactivated**
The best zoom is obtained with proper cropping around the two columns (should be the default one for content-width)

Fixes #501
2018-02-10 14:58:39 +01:00
Frans de Jonge
82ca050a17 [fix, lang] ReaderLink: change location stack to location history (#3671) 2018-02-10 11:42:50 +01:00
poire-z
59496c1d46 Show vertical marker at original position when back from link (#3669)
ReaderLink: make all links be a table (they were a table for PDF,
but a string for CRE) for clearer code. Also have location_stack
store them as tables, with additional properties.
Get original position of link source (and verify it is valid)
so we can show a marker there.

Also:
Hold on "Go back to previous location" to clear location stack.
Resists "Swipe to go back" when previous locations stack has just
become empty, and show a notification.
Fix wrong links with Swipe to follow nearest link on PDF documents.
2018-02-09 17:06:16 +01:00
poire-z
5357fdde7c
cre full text search: fix inconsistencies (#3656)
Fix various inconsitencies: some occurences not highlighted
on displayed page; different occurences highlighted on same
page wheter we went there searching backward or forward; pages
with occurences simply just skipped when searching in one
direction, and not in the other...
To avoid edge cases, crengine will now give back results on up
to 3 pages, that we need to filter.
Bump base and crengine
2018-02-04 20:57:13 +01:00
Robert
9c373f138f Menu: speed up rendering of long texts (#3657)
Slowness mostly noticable in Bookmarks with long highlights
2018-02-04 19:48:39 +01:00
Frans de Jonge
f6ca1c7c0a
[feat] Open with: choose which engine to use for file (#3653)
Fixes #3345

* Add SVG to MuPDF filetypes
2018-02-02 21:21:52 +01:00
poire-z
a3e2a8073f Full text search: when Go back, go back to initial page
Only add the initial page to the location stack - and not
every search result's page - so we can easily go back to it.
2018-01-31 14:22:28 +01:00
poire-z
e615345ffa TOC, bookmarks: remember current page so we can go back to it 2018-01-31 14:22:28 +01:00
poire-z
9d44930960 Add menu item for toggling auto_book_status (#3642) 2018-01-30 12:12:52 +01:00
poire-z
43a6cf4b2e Add MovableContainer: allow moving some widgets (#3636) 2018-01-29 21:27:24 +01:00
poire-z
e7377cd20e Dict & wiki history: use filename when no book title (#3635) 2018-01-29 09:46:50 +01:00
poire-z
35df1749b2
Screensaver: a few tweaks and fixes (#3619)
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.
2018-01-21 19:44:12 +01:00
poire-z
775b7a364f Wikipedia: show images and allow interrupting queries
Reword some english messages
2018-01-17 21:36:21 +01:00
Frans de Jonge
acacd7a7f8
[UX] Move "Go back to previous location" up one menu level (#3615) 2018-01-17 20:28:33 +01:00
TnS-hun
b40bc53fc7 HTML dictionary link support (#3603) 2018-01-15 23:51:43 +01:00
Robert
d163f8281d Menu: configure number of items per page, wrap entries (#3589)
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
2018-01-13 23:38:53 +01:00
Mahmoud Nagy
6e303e7372 Swipe down or tap on top left/right to access left/right reader menu tab directly (#3595) 2018-01-13 23:11:09 +01:00
poire-z
e389510257 Fix speedup of dictionaries init (#3592)
Revert 338d14edb7 (#3489)
Simply just don't walk into "res/" subdirectories, which is where
resource files should be per startdict specs.
2018-01-11 20:28:34 +01:00
poire-z
8c897a086f HTML dict: enable color rendering and per-dict user fix html func (#3585)
Also fix possibility of crash in HtmlBoxWidget:free()
2018-01-09 21:38:49 +01:00
poire-z
91092c442d Fix negative nb of enabled dictionaries (#3584)
Happened when some dictionaries files have been removed, while
these were still referenced in the 'dicts_disabled' setting.
2018-01-09 13:28:17 +01:00
TnS-hun
06a8a33d39 HTML dictionary support (#3573)
* 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
2018-01-07 20:24:15 +01:00
Mahmoud Nagy
5245f018a6 [fix] small skim problem (#3580)
in relative page turning in skim, errors appear when page number is less than 10, and you press -10 in skim it gives warning and the page doesn't change, this happens in pdf.
"update" method solves this if it comes first.
2018-01-06 21:47:45 +01:00
poire-z
7797c2369e
credocument: deal with loadDocument() failures (#3570)
cre:loadDocument() may fail in recognizing the document format, and
koreader would previously keep calling other methods on it, which would
make crengine segfaults. We now check loadDocument success at the
various places it is called, and try to deal the best way we can when it fails.
2018-01-03 09:43:49 +01:00
Robert
efa0d06df9 Add new options to screensaver (#3535)
* 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
2017-12-17 18:27:24 +01:00
poire-z
70f2aa09ea Adds Wikipedia history (#3549)
Just like Dictionary lookup history.
Also changed Disable to Enable in some menu items to be more positive.
2017-12-17 13:02:08 +01:00
poire-z
2697a30166 [fix] Optimize cre highlights onTap and drawing (#3508)
drawXPointerSavedHighlight() and onTapXPointerSavedHighlight were
looping thru all credocuments highlights, which was expensive.
Now, we first check with cheaper getPageFromXPointer() the highlights
are on the current page before doing more expensive stuff.

Closes #3503.
2017-11-20 21:58:58 +01:00
TnS-hun
29b376fdd9 [UX] Option to show dictionary in large window (#3499) 2017-11-20 09:40:00 +01:00
poire-z
338d14edb7 Speedup dictionaries init (#3489)
When looking for .ifo to populate Dictionary settings menu,
avoid walking sub-directories once we found a .ifo, as these
sub-directories may contain a lot of images and other subdirs.
2017-11-16 14:04:59 +01:00
Frans de Jonge
06dfe4fb78
[feat] Add Device:hasClipboard() (#3465)
References https://github.com/koreader/koreader/issues/3441
2017-11-14 19:20:58 +01:00
Frans de Jonge
1515753621
[UX] Always show screensaver menu in reader (#3471)
* Add enabled_func on relevant settings

Fixes https://github.com/koreader/koreader/issues/3470
2017-11-10 11:31:00 +01:00
mwoz123
a01271b8a6 [Android] Wifi status in footer (#3396)
Implemented through the Android API so it's reasonably cheap.
2017-10-28 17:51:34 +02:00
Frans de Jonge
2ddcc7155a [fix] Dictionary no fuzzy search flag (#3433)
Upstream uses `-e` rather than the `-f` that was first introduced in our fork.

References https://github.com/koreader/koreader/issues/3429#issuecomment-339749396
2017-10-26 20:54:32 +02:00
Robert
af61153df2 [feat] SkimToWidget chapter markers & next/prev chapter/bookmark (#3389)
https://github.com/koreader/koreader/issues/2819#issuecomment-332261968
+ refactoring code in skimtowidget
+ add chapter markers
+ add next/prev chapter buttons
+ add next/prev bookmark buttons
2017-10-22 11:09:49 +00:00
poire-z
29708884c7 Enable Edit (rename bookmark) when tap on highlight (#3369)
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.
2017-10-18 15:19:06 +00:00
poire-z
8aa26edeb6 Fix some widget title height and close button alignment (#3366) 2017-10-16 17:51:56 +02:00
poire-z
29707bd664 FileBrowser: change page to show last file or previous subdir (#3351)
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.
2017-10-13 18:43:02 +02:00
poire-z
2b89be4f95 Fix cre scroll page update and allow jumping to page (#3333)
This makes Go to, Skim to and TOC page selection work in
scroll mode, and page given to other module more accurate
(previously, we were one action lagging).
2017-10-10 11:57:57 +02:00
poire-z
9443098e98 Normalize some widgets appearance (those using ButtonTable)
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
2017-10-08 20:44:11 +02:00
poire-z
2fc8076139 Better vertical centering of text in its box
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
2017-10-08 20:44:11 +02:00
Robert
9ea2b3dbad Option to disable show bottom menu on top menu activation (#3316) 2017-10-08 12:27:53 +02:00
Frans de Jonge
d23d01643e Add LuaData and Dictionary Lookup History (#3161)
* Add dictionary history

Fixes #2033, fixes #2998.

* Add LuaData

* table handling in base settings

* Add LuaData spec
2017-10-07 22:13:46 +02:00
poire-z
8c700eefd9 Avoid some full refreshes on Kindle (#3315)
"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.
2017-10-07 15:23:39 +02:00
poire-z
b7785753c6 [fix] Crash on highlight in some situations (#3306) 2017-10-06 15:58:58 +02:00
poire-z
b483c54be8 Fix footer, stats, TOC position with cre in scroll mode (#3304)
This gives the page position to these modules even in scroll mode.
Also, in readerrolling: don't query battery/charging status
when crengine does not need it (used only when it shows its top
progress bar).
2017-10-05 21:49:59 +02:00
poire-z
301892f4b6 [fix] Avoid multiple refreshes when opening credocuments (#3300)
Only noticeable on Kindle (which uses REAGL as partial refresh).
2017-10-05 17:12:49 +02:00
poire-z
5a2c8e4b5e Revert 2 commits that caused crengine scroll mode side effects (#3295)
394be8a (#2855) and 2b3b310 (#3183) introduced side effects (scroll mode
crashing and TOC being reset and rebuild). This reverts parts of them
not yet reverted.
2017-10-03 21:33:12 +02:00
poire-z
26def92983 credocument reader optimisation (avoid multiple TOC builds) (#3292)
Avoid unnecessary work in ReaderView:onSetViewMode() and
ReaderRolling:updatePos() that would result in TOC being reset
and rebuilt (which can take time on books with huge TOC) during
reader setup.
2017-10-03 00:31:14 +02:00
poire-z
1a97b4289c [Fix] Show 'Follow Link' even when no dict installed 2017-10-02 08:28:09 +02:00
poire-z
53f083f516 Allow for toggling color rendering
New menu item in Screen submenu.
hasColorScreen enabled for SDL device.
2017-10-02 00:10:29 +02:00
Robert
a2ea46bfdc Rename bookmark (#3275) 2017-09-30 18:17:48 +02:00
Frans de Jonge
a6be301695 Added Size module 2017-09-23 20:24:45 +02:00
Frans de Jonge
9eb073a524 [travis] Add protection against unscaled sizes
As pointed out by @poire-z

* [fix, UX] SkimToWidget scaling

* [fix] Button scaling

* [fix, UX] Scale ProgressWidget

* [fix, UX] Scale confirmbox

* [fix, UX] Scale just about everything
2017-09-23 20:24:45 +02:00
Frans de Jonge
8babe57106 [fix] ReaderGoto button order 2017-09-23 20:24:45 +02:00
Robert
bdf02f14aa Add bookmark browsing mode to menu (#3248) 2017-09-23 18:25:22 +02:00
poire-z
47139266b2 Dict lookup: allow cancelling with tap
base bumped for ffi/util.getNonBlockingReadSize(luafile)
2017-09-20 23:09:59 +02:00
poire-z
5828ef8f1c Fix potential crash when clearing hold highlight (#3241)
A delayed clear() could reset hold_pos while a onHold/onHoldPan/
onHoldRelease is in progress, resulting in hold_pos becoming nil and
a crash.
2017-09-20 17:35:30 +02:00
Robert
2c3936ddb4 Refactoring readerfooter statistics - TB and TC (#3223) 2017-09-16 13:36:54 +02:00
poire-z
f5a6e32887 Fix wrong page when tap on link (#3217)
Closes #3216
2017-09-14 13:01:09 +02:00
Frans de Jonge
161cae6b3a [UX] Document settings language simplification (#3215)
As suggested by @comradekingu in https://github.com/koreader/koreader/pull/3165#issuecomment-326795203
2017-09-13 12:44:37 +02:00
Allan Nordhøy
3f24514a8d Set Rendering Style, and Comments (#3165) 2017-09-13 12:16:42 +02:00
poire-z
991b56664f Added Swipe to follow nearest link/to jump to latest bookmark (#3207) 2017-09-11 22:56:15 +02:00
Frans de Jonge
a39db783c0 [SDL] Add quit through regular window manager actions (#3206)
* [SDL] Add quit through regular window manager actions

Depends on https://github.com/koreader/koreader-base/pull/506

* proper exit and fix bug in restart function as a bonus
2017-09-11 21:37:00 +02:00
poire-z
a9c1ed24b8 Show vertical marker at target position when following a link (#3202) 2017-09-11 17:11:04 +02:00
poire-z
a720eaceb5 Hold on a word for more than 3 seconds to access highlight menu (#3199)
and avoid the dict lookup.
2017-09-10 20:35:27 +02:00
Frans de Jonge
164f0568b1 [fix] ReaderHighlight: remove highlight when closing popup dialog
See https://github.com/koreader/koreader/pull/3198#issuecomment-328339992
2017-09-10 14:39:10 +02:00
Frans de Jonge
7310937219 [fix] "Follow Link" popup issues (#3198)
* Add current location to location stack from follow link popup
  See https://github.com/koreader/koreader/pull/3190#issuecomment-328332771
* Word highlight not removed
* "Follow Link" not translated
* Typo in docs
2017-09-10 14:26:49 +02:00
Frans de Jonge
f439ca0e8d [UX] Add "Follow Link" in hold/highlight dialog (#3190)
* This way you can disable "tap to follow links" on single tap yet still follow links.
* Change menu as well as per @poire-z's suggestion.
2017-09-09 18:30:00 +02:00
poire-z
75b7c4b524 Added Font Hinting toggle (#3182) 2017-09-08 17:38:51 +02:00
Robert
2b3b310719 Fix: Lost last document position in scroll mode (#3183) 2017-09-06 20:12:26 +02:00
Robert
2a0e424a17 Prevent crash on exit in scroll mode (#3171) 2017-09-05 18:22:36 +02:00
Frans de Jonge
ba7fad2cdf [fix] Dict settings NaN in installed dicts submenu (#3173) 2017-09-05 07:56:05 +02:00
Frans de Jonge
177485f84f [UX] Add exit menu (#3167)
* 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
2017-09-03 15:40:50 +02:00