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

85 Commits

Author SHA1 Message Date
poire-z
918f296bd3 cre scroll mode: fix highlights not shown when small pages
The idea of looking for highlights 1 page before and after
was not working when you have multiple small pages, and
some scroll mode view was actually showing 3 or 4 pages.
So, rework that by using absolute positions when looking
for highlights present in the scrolled view.
2019-02-26 09:43:35 +01:00
poire-z
62d548fc61 Highlight adjusting: avoid start and end crossing each other 2019-02-17 16:54:54 +01:00
Frans de Jonge
33840c17cb
[fix] Highlight moving button text shouldn't be translated (#4597) 2019-02-16 15:03:27 +01:00
Galunid
015fb4d34e Allows adjusting highlight start and end (#4582)
Adds arrow buttons under Delete|Edit.
Tap to move by word, hold to move by char.
2019-02-16 00:42:27 +01:00
poire-z
e802b96e45 cre: allow text selection/highlighting across pages
Panning to the bottom right corner (or top left corner) switches
to scroll mode and scroll the page forward (resp. backward) 1/3rd
of the screen.
One has to pan out of the corner to continue selection.
Panning again to that corner scrolls another 1/3rd of screen.
Page mode is restored when highlighting or dismissing the highlight
dialog, and a little marker is shown at where selection was started
so one does not get lost after all that scrolling and restoring.
2019-02-03 22:12:00 +01:00
poire-z
895589ddaa
Page overlap menu (cre): set nb of overlap lines (#4538)
Make this existing setting tunable with a menu item.
Also make the Page overlap and Highlight menus use a
checkbox, and their items grayed out when disabled.
2019-02-03 11:17:27 +01:00
poire-z
335a513826 [chore] cleanup multi-lines translatable strings
Revert 9971eb85 and make multi-lines strings more readable.
(Multiline translatable strings extraction has been fixed
in koreader-misc tralua_xgettext.py.)
2019-01-29 00:05:55 +01:00
Galunid
0678d75438 Adds choice of default action when highlighting (#4486)
New menu Document > Highlight action.
2019-01-17 22:12:38 +01:00
poire-z
80cb9d0db1 adds "Translation settings" menu
and the list of 104 languages supported by Google Translate
2018-12-17 15:19:25 +01:00
poire-z
22b7f17cd8 Fix translator, enable selected text translation
Update translator.lua to use a still working google translate API.
Add a method to show translations (main and alternates) in
a TextViewer.
Re-enable "Translate" button in text selection/highlight buttons
dialog.
Target language can be set with a manually added setting:
    translator_target_language = "fr"
and will fallback to the UI language.
2018-12-17 15:19:25 +01:00
poire-z
ea946d52d6 bump crengine: tables rendering improvements and others
bump crengine, which includes:
- Adds support for symbol fonts (local or embedded)
- Fix some issues when rendering text in constrained width
- Page splitting: fix possible missing blocks
- CSS: adds support for 'auto', ignore % for borders
- Fix right border drawing position
- Fix: adds missing properties in copystyle()
- Adds comments, erm_killed rendering method
- Adds getRenderedWidths(): get node min/max node content width
- Tables rendering: fixes and improvements
- getRenderedWidths: enable min_width to be a single CJK char
- Fix wrong text wrap avoid in some case
- epub.css: add style for 'blockquote'
- Fix rendering issue when line ends with an image

Adds a few style tweaks related to tables.

Enforce table width: 100% in Wikipedia EPUBs to keep
previous look, which feels better with the various kinds
of tables in Wikipedia pages.

Fix unit tests as juliet.epub (full of blockquotes), grew quite
a few pages with the epub.css update.
2018-12-07 14:11:46 +01:00
poire-z
2a8ab2b311 View HTML: adds Prettify button to CSS viewer
Quick and non-full-proof prettification, but quite good
and enough to make unreadable/minified CSS files readable
for Style tweaks cooking.
2018-10-23 13:12:40 +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
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
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
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
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
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
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
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
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
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
b7785753c6 [fix] Crash on highlight in some situations (#3306) 2017-10-06 15:58:58 +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
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
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
Robert
21c63a297e Gesture to show only config menu (#3051)
* Gesture to show only config menu

* Show config menu from bottom
2017-08-05 21:49:00 +02:00
robert00s
4b9fc6333f Fix: Unable to click on highlighted text in tap menu zone 2017-08-04 17:26:50 +02:00
Robert
4d0f66a354 Fix: Unhighlight is not clickable in dictionary view and Deleting highlights in bookmarks does not take effect (#3034)
* Fix: Unhighlight is not clickable in dictionary view
* Fix: Deleting highlights in bookmarks does not take effect
2017-07-28 22:39:54 +02:00
robert00s
ba96506483 Fix event AddHightligh and add event DelHighlight 2017-07-27 20:25:26 +02:00
Huang Xin
8938786472 [fix] stop propagation of tap events when triggering reader menu (#2934)
* [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
2017-06-19 00:08:57 +08:00
Frans de Jonge
338fcd76ae Lang: two tiny strings
* ReaderHighlight: underscore to underline. Although underscore means to
emphasize by underlining, the emphasis lies on the, ahem, emphasis. Besides
which, it's mostly AmE and less well understood worldwide (although in this
particular context it should probably cause no trouble).

* Statistics plugin: menu item text to "reading statistics" to make it clear
which statistics we're talking about. Fixes #2744.
2017-04-09 15:03:21 -07:00
Frans de Jonge
a970a1f034 MenuSorter: fix outside testability (for potential unit tests) 2017-03-26 11:12:44 +02:00
Frans de Jonge
b7b5950e98 MenuSorter: review comments and various bug fixes
* fixed wrongful retention of submenus variable and added return to MenuSorter:findById
* fixed readerfooter_spec.lua error
* fixed review comments
2017-03-26 11:12:44 +02:00
Frans de Jonge
5b20106db7 MenuSorter: initial implementation
* Menus are now sanely configurable
* Custom separator placement for clearer menus
2017-03-26 11:12:44 +02:00
Qingping Hou
9b7aba3fba fix: override readerhighlight hold in readerfooter
Also fix touch zone dependency graph generation code.

ReaderHighlight has now been migrated to use touch zone

Inputcontainer's touch event handling logic changed to only stop
propagation when handler returns `true`. Previously, it stops
propagation when a handler is found. This is needed to support
both readerhighlight_tap and tap_forward touch zones.
2017-01-30 05:53:44 -08:00
poire-z
2ded2bce5e Wikipedia: save full page as epub (html, with optional images)
Also for the current text-only wikipedia full page: replace
the ==s in section titles with some unicode symbols for a better
visual feeling of hierarchy. These same symbols are also used
in the .epub.
Both can be disabled by adding ["wikipedia_prettify"] = false
to settings.reader.lua

readerhighlight: close ButtonTable (like other buttons do) when looking
up wikipedia, otherwise if we save as epub, and swtich to new document,
this ButtonTable will never be closed and stays in UI.
2017-01-24 01:16:23 -08:00
poire-z
ee06171c83 New ImageViewer widget + hold on image show it fullscreen
Simple image viewer with Best Fit/Original size and Rotate
(for landscape images) buttons.
readerhighlight: check if hold is on an image to show it
fullscrren
2017-01-18 09:03:31 -08:00
Qingping Hou
f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 2017-01-02 19:52:09 -08:00
poire-z
1708fd5e1c Dictionary and wikipedia enhancements (#2393)
Stardict:
- remove duplicate results
- better cleaning of selection
- append results from a 2nd query of a 2nd set of dictionaries
  in data/dict_ext/

Wikipedia:
- use the search API for better results
- allow viewing the full page content of a result in a bigger window
- allow queries for multiple languages
- available languages can be set in settings.reader.lua :
    ["wikipedia_languages"] = {"en", "fr", "it"}
- "Wikipedia lookup" added to Tools menu

For both:
- allow selection of multiple words for a new lookup (so one can
  actually browse wikipedia)
- allow continuous reading with Tap
- display "current result / total number of results"

Details in #2393
2016-12-11 14:32:02 -08:00
ycrichard
c3aa5fa0d9 allow disable highlight by default
minor code change

typo
2016-10-23 15:31:01 -07:00
chrox
4c491b5ee2 rename 'Highlight' to 'Highlight options' in menu
This should fix #2023.
2016-05-14 12:20:01 +08:00
Qingping Hou
c22a3747d8 fix all the tests 2016-04-19 00:01:28 -07:00
Qingping Hou
467199285f minor: rename Koreader to KOReader 2016-03-27 18:50:23 -07:00