Commit Graph

1155 Commits (ce624be8b83e880b1a81106a143e1440eeda4aab)

Author SHA1 Message Date
poire-z 3e71e4985e bump crengine: support for pseudo elements ::before/after
Includes:
- GIF decoding: avoid crash on some images
- Top progress bar: avoid re-computing when not needed
- Top progress bar: allow external filling of marks
- CSS/Text: properly inherit and handle text-align-last
- getRenderedWidths(): fix handling of text-indent
- Reorder some flags to make the sets clearer
- CSS: support more white-space named values
- Text: fix standalone BR not making an empty line (rework)
- CSS: support for pseudo elements ::before & ::after
- CSS: content: open-quote support via TextLangMan
- CSS/Text selection: adds a few "-cr-hint:" tweaks
cre.cpp: adds setHeaderProgressMarks()

Added 2 style tweaks to disable pseudo elements
::before/after and common ligatures.
4 years ago
poire-z a753f332de
Footer: skip tap lock when needed (#6225)
7d139263 was preventing some features to work,
so skip it in some cases:
When toggling between top & bottom status bar (a tap
is simulated to show the bottom bar).
When in flipping mode (jumps to page at tap position).
When toggling via menu (shown only when zero tap zone).
4 years ago
Frans de Jonge 4a65cc666b
[UX] Implement hasFewKeys prototype (#6195)
This is a quick exploration into how the new Device:hasFewKeys() method could work to make things more usable on very limited devices.

In the reader, the right is repurposed to open the menu. Left in turn closes it.

The same principle is applied to ButtonDialog. This means you can select anything in principle, but once you go right you can't go back.

References <https://github.com/koreader/koreader/issues/4029>.
4 years ago
Martín Fernández 879f8a7624
[Desktop] Fix missing glyphs by packaging freefonts again (#6218)
Also disable battery completely from defaults/option in desktop linux as it always return 0%
4 years ago
poire-z b4113769e3
SkimToWidget: fix next/prev bookmark not updating it (#6216) 4 years ago
poire-z fc6c786f84
Footer: fix items possibly missing (#6212)
Iterating a k/v table as an array would have us stopped
on the first disabled MODE (frontlight, battery... on
some devices).
Rework that initial setup, and make it correctly handle
added or removed MODEs when using the ordered items
saved in the user settings.
4 years ago
poire-z 177551918f
bump_crengine: various fixes, tweaks and cleanups (#6188)
Includes:
- Don't reset invisible BR to display: inline
- ldomTextCollector: handle inline-block/table as inline
- Avoid re-rendering on font hinting mode change
- List markers: fix positionning when floats involved
- GIF decoding: avoid uneeded abort on LZW table overflow
- Adds getUnknownEntities(), can help with debugging
- Don't check stylesheet hashes when loading from cache
- Hardcoded elements and attributes list: cleanup
- Full rendering: 2 small optimisations
- Strut confinning: deal with images earlier
- lvtextfm: some cleanup and reordering
cre.cpp:
- fix getPageFromXPointer() and getPosFromXPointer()
  to not fail on invisible nodes and work on the next
  visible node (so links whose target is display:none
  can work).

Add support for 2 settings one can set manually
in reader.settings.reader.lua:
["cre_background_color"] = "0xccffcc",
["cre_background_image"] = "/path/to/bg_paper.jpg",
4 years ago
poire-z 39345704ec
Statistics: fix number of highlights (#6173)
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.
4 years ago
mwoz123 0e2b430796
Fix/exit dir (#6163) 4 years ago
poire-z e5206922c6 [UX] Normalize SpinWidget and DoubleSpinWidget
- Use same names for options;
- Have them both movable
- Add option to keep widget shown on Apply (and use that
  when appropriate: when the value may have an immediate
  visual effect, so one can tweak it without having to
  go thru menus to re-open it again).
4 years ago
poire-z 8991540462
Reorganize bottom menu config panels (#6131)
Mostly for the PDF bottom menu.
- Reorganize by topic, trying to limit the number
  of widgets per panel to 4.
- Re-order some toggles from low to high ('off' then 'on').
- Show font size as number instead of a list of "Aa".
- PDF: add more font size values, and increase usable
  contrast values.
- Add help_text to most PDF toggle titles.
- CRE line spacing: increase fine tuning min and max.
Also avoid zoom advice messages on book load.
4 years ago
poire-z 46221985a6
Delegate "lastfile" management to ReadHistory (#6128)
Simplify (and avoid edge cases) in other code by having
ReadHistory manage the "lastfile" setting on add, remove,
rename...
Fixed a few other cases of things not updated.
4 years ago
poire-z e074b603e0 Adds Word Expansion: use of letter spacing for justification
Bump crengine:
- Text: fix occasional BiDi bad word splitting
- Font: fix HB fallback measurement/drawing mismatches
- Font: do not add letter spacing on diacritics
- Text: tunable use of letter spacing for justification
- Text: dont adjust space after initial quotation mark/dash (rework)
- Text: fix possible bad widths after collapsed spaces

xtext.cpp: pick crengine fix with HB fallback
measurement/drawing mismatches

Adds "Word Expansion" to bottom Font size menu, and moved
"Word Spacing" there too, to balance the panels' heights
to 4 items.
4 years ago
poire-z 429f4bf1ae
Enable Highlight action on single word selection (#6114)
Also add "Dictionary" and "Fulltext search" to available
and cycleable highlight actions.
Generalize long-press (3s) at end of selection to show
the highlight dialog popup.
4 years ago
Robert 3f874f0d1f
[Gesture] Add progress sync gesture (#6103) 4 years ago
Robert c2a0cc836d
[Gesture] Add go to first and last page (#6096) 4 years ago
yparitcher 0edfc4e150
ReaderStatus: close file before deleting (#6108) 4 years ago
poire-z 1a91893576
Allow toggling use of additional fallback fonts (#6095) 4 years ago
Robert 7d139263d8
Option to prevent tap on status bar (#6083)
See: #5969
4 years ago
poire-z 7d83a0c967
bump crengine: multiple fallback fonts (#6090)
Includes:
- Simplify libunibreak includes
- Text: fix read/write outside array bounds
- lvtextfm: dont adjust space after initial quotation mark/dash (rework)
- Fonts: allow providing and using multiple fallback fonts

Users can set their prefered fallback font, which will be completed
with a few of our shipped fonts for maximum coverage.
4 years ago
Robert 72c9ec2aa0
Add support for physical button for page crop (#6091)
See: #2003
In page crop:
physical press button = OK
physical back button = Cancel
4 years ago
poire-z 6dc8bbcc49
Adds ReaderTypography (replaces ReaderHyphenation) (#6072)
Replace Hyphenation menu with Typography menu.
This works mostly like before:
- typography/hyphenation is chosen according to the book
  metadata language,
- one can set a default or a fallback language,
- hyphenation is now just a subset of typography, and
  can be disabled while still setting a language and
  enabling the other features,
- the typography language enables newly added features
  to crengine: per-language line breaking rules and
  per-language Harfbuzz glyph selection.
4 years ago
poire-z 6336927cb7
bump crengine: text typography by language (#6069)
Includes:
- Fix a few clang-tidy warnings
- Add support for <img src="data:image/png;base64,...>
- XML parsing: add more HTML5 named entities, optimize search
- Text: fix standalone BR not making an empty line
- Fix BR with "display: block" not making an empty line
- Fix hyphens from soft-hyphens not part of highlighted segments
- Use libunibreak for line breaking
- Adds TextLangMan for text typography by language

Tweak ReaderHyphenation to work with the new TextLangMan
(even if it will be replaced soon by ReaderTypography).
4 years ago
Martín Fdez f756a6aaa7 stardict path override 4 years ago
Martín Fdez 8e831eb756 desktop: disable battery on touch menu and reader footer
isDesktop and isEmulator are now different entities
4 years ago
poire-z 635f784dfd [UX] Gestures: add action "Statistics calendar view"
Also flush current stats when showing calendar view.
4 years ago
poire-z 026140f809 Adds ReaderPageMap, to optionally show source pages numbers
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.
4 years ago
poire-z 8e68dc11db
Highlights: turn page when start or end crosses pages (#5984)
More generally: switch to the page that contains the highlight
edge that we are currently moving.
4 years ago
yparitcher 08359ee1b6
[UX] Next/Previous Bookmark Gestures (#5968)
Fixes #5965
4 years ago
mergen3107 73f1b1aad6
[UX] More compact dictionary download window (#5960)
Dictionary download window: combine the first two titles to save space and fit 3x complete dictionary selections on one page (Kindle PW3)

Closes #5955
4 years ago
Frans de Jonge ad0a7ed3a5
[fix] Support proper local links (#5945)
Only one style was supported.

Fixes <https://github.com/koreader/koreader/issues/5941>.

See <https://github.com/koreader/koreader/issues/5941#issuecomment-598633973> for discussion.
4 years ago
poire-z c1f19e943a
Make xpointers migration ConfirmBox non-dismissable (#5931)
Because dismissing it by tapping outside would have
"not for this book" selected, which is the least
welcome action.
4 years ago
poire-z 72f2cef472
Style tweaks: enable EPUB/FB2 in-page footnotes by default (#5908)
Set these 2 tweaks as default global tweaks for new users
(and existing users that have not set any global defaults).
One can disable them by long-press on each of them.
Only per-specs EPUB and FB2 footnotes (other in-page footnotes
tweaks may trigger on non-footnote content on some books, so
let enabling them be a user decision).
4 years ago
poire-z 8a3d4a1d25
TOC: validate and fix misordered page numbers (#5907)
Our code expects (rightfully) the TOC items to be ordered
and to have increasing page numbers, but we may occasionally
not get that from the engines (usually, because of bugs or
duplicated IDs in the document).
Check for that and fix page numbers (possibly making them
wrong) to have a working TOC.
4 years ago
poire-z 85a06ff995 Bookmarks: fix dogear not shown when highlights on same page
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.
4 years ago
poire-z a5232594d9 FB2 footnotes: handle them just as other footnotes
- FB2 footnotes are no more rendered in-page by default
- In-page rendering can be enable by the added Style tweak
- FB2 footnotes can also show in footnote popup (with
  some added not-so-nice CSS so MuPDF can render them
  as crengine)
4 years ago
poire-z 182dc60e00
[i18n] allow translation of time (12/24-hours formats) (#5898)
Discussion around https://github.com/koreader/koreader/issues/5359#issuecomment-590593945
4 years ago
Martín Fernández 5d103a41f8
Avoid writting highlights into read-only PDFs (#5889) 4 years ago
poire-z 5a4f5b4d59 bump crengine, migrate books to normalized xpointers
Enable new rendering feature COMPLETE_INCOMPLETE_TABLES
on all enhanced rendering mode, but have it disabled for
earlier cre_dom_version.
Also increase default_cre_storage_size_factor from 20 to 40.
4 years ago
yparitcher 7b1ae4e486
continuous: do not limit visible area to page area (#5885)
in scroll_mode allow visible area to be larger than one page

allows proper scrolling om tall aspect ratios. Fixes #5876
4 years ago
poire-z c2a5d3f3f3
FileManager: tell plugins to save settings on close (#5872)
So that Statistics settings modified while in FileManager
are saved.
Also allows resetting statistics when in FileManager
(where there is no current book id to exclude).
4 years ago
poire-z 30f9673c7d Font menu: show only 5 items per page
To get more room below to see how the text looks
with the selected font.
4 years ago
Frans de Jonge f8aacc6a99
Spelling: Wi-Fi, turn on/off, on/off (#5856)
Co-authored-by: Allan Nordhøy <epost@anotheragency.no>
4 years ago
Robert a7def7e833
Footer: bold font option (#5849)
cf. https://www.mobileread.com/forums/showpost.php?p=3946581&postcount=5 and https://www.mobileread.com/forums/showpost.php?p=3938492&postcount=5
4 years ago
yparitcher f6b23adb2c
skimto: add beginning and end as hold callback (#5820)
* first/last bookmark
4 years ago
yparitcher a3173ec275
end of document: add go to beginning (#5814)
* ReaderGoto: goto beginning and end

* end of the document: add go to beginning
4 years ago
poire-z f6a64de44a View HTML: adds another extended debug view
Split the extended debug view (rendering method + unicode
codepoints) into 2 distinct views, as it's more practical.
4 years ago
Robert dfd2baa3ad Footer: extend min and max values for font size (#5796) 4 years ago
poire-z 23d848acf4 Reader: strict ordering of tap & hold gestures (#5789)
The lack of proper overrides could make their
order/precedence/priority non-deterministic.
4 years ago
Robert 2e601640af [UX] Footer: update progress bar min width to 5% (#5788) 4 years ago
Robert 85da41afd9 [UX] Footer: add options to show title and current chapter (#5775) 4 years ago
NiLuJe f44b031702
Make Inverted Portrait a first-class citizen (#5783)
* Don't store stale screen/rotation modes in book's settings!

Gyro events *may* entirely bypass the local copy...
In any case, using a local copy was essentially asking for trouble...

Actually fix #5772

(because the issue was indeed that a Gyro swap from Portrait to Inverted
Portrait wasn't stored properly).

* Allow showing ScreenSavers in Inverted Portrait.

That works just fine, and won't lead to the confusing situation where a
lefty might pick up the device as a righty because the ScreenSaver
happens to be shown that way, only to have it rotate back to its lefty
orientation on wakeup...
4 years ago
poire-z 8110c68e29 [Fix] Update dogear when back from bookmarks list 4 years ago
poire-z 7eee758149
bump crengine: support inline-block, better text selection (#5763)
Includes:
- lvtinydom.cpp: fix Use-after-free
- lvtextfm: fix/cleanup lastnonspace code bits
- lvtextfm: fix vertical-align: top & bottom
- renderBlockElementEnhanced: minor fixes related to floats
- renderBlockElementEnhanced: compute baseline of block
- Add support for display: inline-block/inline-table
- Better selection highlighting by using getSegmentRects()
- getHtml(): add flag to get text soft-hyphenated

cre.cpp: toggable text selection highlighting method,
default to the new one using segments.

Update various cre flags to use the new features (and
to conform with some flags re-ordering):
- support display: inline-block in flat, book and web
  render modes.
- get HTML with soft-hyphens for footnote popups, so MuPDF
  can use them when rendering the footnote.
4 years ago
Robert 4a6b8587d7 [UX] Footer: add option to set progress bar min width (#5757)
Allow progress bar to be seen when "Show all at once" enabled
and many items selected (text part will then be truncated).
4 years ago
Robert 73a0f2f9d1 Remove DSCROLL_MODE and DGLOBALGAMMA (#5754) 4 years ago
poire-z acfc8c0440
CRE multipage text selection: mirror corners when inverse_reading_order (#5751) 4 years ago
Martín Fernández ffabb26aae close menu before sharing text 4 years ago
Martín Fernández 5ef329c19c android: share text (#5745) 4 years ago
Robert 8a0ce98149 [UX] Footer: add option to set font size (#5736) 4 years ago
poire-z 0599c440cc [RTL UI] Bidi-wrap filenames, paths, urls, metadata
bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
  as using LTR isolates seems uneeded when already LTR" (part
  of a628714f) which was a wrong assumption: we need proper
  wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
  trailing \n.

- Wrap all paths, directories, filenames in the code with
  these wrappers.
- Wrap all book metadata (title, authors...) with BD.auto(),
  as it helps fixing some edge cases (like open/close quotation
  marks which are not considered as bracket types by FriBiDi).
  (Needed some minor logic changes in CoverBrowser.)

- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
  following the recent addition of the page_gap_height option.
4 years ago
Mustafa Ali Mutlu 12adb96206 [feat] Option to change page gap in continuous mode (#5705)
Fixes #5656.
4 years ago
poire-z 908151a3b0 [feat] Adds Document> Auto-save book metadata sub-menu (#5687)
Replaces DAUTO_SAVE_PAGING_COUNT in defaults.lua with
a new option available in menu, that allows setting
an interval in minutes instead of a page count.
4 years ago
Robert dd0c6c0bb8 [UX] Footer - add option chapter markers width (#5708) 4 years ago
Robert 794598c1e9 fix: Crash FM after delete file from end of document action (#5684) 4 years ago
Robert e26ad2b287 [UX] Adds DoubleSpinWidget (#5679)
Replaces HyphenationLimits widget by making it more generic.
4 years ago
poire-z 04d9a557aa Use fsync() for more robust setting files saving
Bump base for util.fsyncOpenedFile() and util.fsyncDirectory().

Use these to force flush to storage device when
saving luasetting, docsetting, and history.lua.
Also dont rotate them to .old until they are at least
60 seconds old.
Also make auto_save_paging_count count right.

Also bump crengine: open (as text) small or empty files
4 years ago
poire-z 1e1ceedd4d [i18n] Add translator notes for footer letter prefixes 4 years ago
yparitcher b578d8aa8b Fix continuous scroll & footer overlap (#5657)
closes  #5654

like #5620 but for continuous mode.
5 years ago
poire-z 7952fa2c09 [RTL UI] update widgets and apps for UI mirroring
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
5 years ago
poire-z d6d49a64a7 [RTL UI] use auto or LTR text direction in some specific cases
Allow TextBoxWidget new text direction/lang parameters to be
set on upper widgets, and propagate them all the way to it
(ScrollTextWidget, InputText, InputDialog, TextViewer).

Use specific non-default ones in some specific cases:
- Force LTR text direction when showing HTML and CSS, and
  configuration files (in some plugins).
- Use Wikipedia server language and text direction when
  showing an article.
- Use auto with Dictionary results, as we don't know the
  dictionary language, and they may contain mixed content.
- Force LTR when showing some paths (still needs more of them)

TextEditor plugin: add 2 new options "Auto paragraph direction"
and "Force paragraph direction LTR".

Footnotes popup: grab HTML direction, and forward it
to MuPDF for proper display.
5 years ago
Martín Fernández a5069f1c26 android: make system fonts toggable (#5670)
Also add droid font back to android and remove the workaround
5 years ago
poire-z 3d191490d0
Touch zones: fix loss of overrides when re-registering a zone (#5658)
Happens with "Inverse reading order", which re-registers
the Reader tap forward/backward zones and would prevent
tap menu and bookmark from working.
Before, when removing them, we would lose all the override=
set on them by other touch zones (tap menu, bookmarks...),
and so they were no more ensured after re-adding the zone.
So, make sure we don't lose that info.
5 years ago
poire-z 5541d5f5d3 bump crengine: word spacing and hyphenation tweaks
Includes:
- New option to tune word spacing: space width scale percent
- Text: look for hyphenation in more words if needed
- CSS: fix "hyphens:none" should override inherited "hyphens:auto"
- getHtml(): grab dir= and lang= attributes from upper nodes

Replace our Word Gap/Space condensing toggle/setting with
a new Word Spacing toggle/setting, made of 2 values:
- 1st number scales the normal width of spaces in all font
  (100% uses the font space width untouched)
- 2nd number applies after the 1st has been applied, and
  tells how much these spaces can additionally be condensed
  to make more text fit on a line.
5 years ago
Robert 494b38e9c8 [fix] Dictionary font size: avoid crash in reader mode (#5650) 5 years ago
Robert b0738960df Dictionary: add menu item to set font size (#5647) 5 years ago
Robert d93206a841 Remove DCREREADER_PROGRESS_BAR (#5641) 5 years ago
NiLuJe d8e0b1759b
Other minor frontend.util cleanups (#5629)
* Resync fixUtf8 w/ upstream
* Fix lastIndexOf desc
* Drop unichar usage, it's a crappier unicodeCodepointToUtf8 ;).
5 years ago
yparitcher 6d3e7fcef6 [fix] PDF footer margins (#5620)
closes #5612 

the change in `ReaderView:recalculate()` causes the viewable page size to be calculated by not including the footer, causing the text not to get cut off.

since the page area was not drawing under the footer `ReaderView:drawPageSurround()` had to be fixed to draw the margin under the footer so when tapping the footer off the area should be dran the background color.
5 years ago
Robert 03fda96041 [fix] Empty directory path and crash on TextWidget (#5606) 5 years ago
Robert 679b592c80 [UX] Add Mark as read to end of document action (#5596) 5 years ago
NiLuJe b21b4c8776
Update nerdfonts symbol codepoints for the updated version with no PUA (#5595)
* Update nerdfonts symbol codepoints for the updated version with no PUA conflicts

Should no longer stomp on Arabic & CJK PUA stuff.
5 years ago
Robert e166a77eba [UX] Gesture to open Favorites (#5592)
Close: #5576 
+ default multigesture east - west - east -> open `Favorites`,
+ ability to add new gesture to open `Favorites`
5 years ago
yparitcher 816b197ab9 [UX] Thicker loading bar (#5581)
The current thickness for the loading bar when opening a document is to thin to really see on my KT4,
5 years ago
yparitcher 83b7d8de2b [UX] Default setting option always enabled (#5580)
as per https://github.com/koreader/koreader/pull/5522#issuecomment-548006595 do not grey out the current default
5 years ago
Robert 371e3336a5 [feat] Favorites: organize book into collections (#5527)
View, add, remove, sort, open book to/from collections.
For now, only one collection named Favorites.
5 years ago
poire-z 04ce1836d8 Avoid double flash when switching or reloading document (#5568) 5 years ago
poire-z 6baa2af5fb
cre: use 'best' (Harfbuzz) as the default kerning method (#5553)
It might be slower, but is needed to properly display
books in arabic, indic...
Also bump crengine: use FreeType "light" hinting algorithm,
which hints on the y-axis only (and so avoid messing with
advances and kerning on the x-axis).
5 years ago
NiLuJe 61a8b63757
Minor fixes after #5537 (#5538)
* Restore '+' prefix when charging in the footer w/ letters prefixes

Regression since #5537

* Don't use a full battery icon in the menu entry

Make it clear that one isn't in-sync with the current gauge
5 years ago
NiLuJe 8d281647ae
Unify battery meters look'n feel (#5537)
* Unify battery meters look'n feel

Switch to proper (vertical) battery icons (one per 10% steps).

Fix #5535

* Bump fonts (https://github.com/koreader/koreader-fonts/pull/7)

Because we need the new symbols from nerdfonts ;).
5 years ago
yparitcher 40d6a7665b [fix] Typo in #5522 (#5530) 5 years ago
yparitcher aa165cefe9 [UX] Set global settings independent of local setting (#5522) 5 years ago
yparitcher 6c68df42ec [feat] Open unsupported documents as text (#5497) 5 years ago
poire-z 240b75ac50
Fix screensaver menu stability (#5499)
With some particular document switching workflows, the
screensaver menu could lose its last item, and shrink
to having zero item, and eventually cause a crash.
5 years ago
NiLuJe f2f2aa6e4d
Minor state handling tweaks when the footer is disabled/invisible (#5494)
* Don't break `doc_pages` updates when it's completely disabled. (c.f., the commit's comment, doing it on every page turn seems a bit overkill, but I get that it's probably done that way because it was easier ;)).
* Detect the empty footerTextGenerator properly in `_updateFooterText` (it's `""`, not `nil`).
* Abort `_updateFooterText` early when the footer is invisible (and has been for a while/ever, i.e., when not requesting a repaint, like a mode switch would).
* Never send `SetBottomPageMargin` events twice.
* Minor tweaks to touchmenu & configdialog to avoid useless repaints (don't redraw the reader/fm unless we absolutely need to).
* Make sure we show the progress bar alone instead of nothing when disabling the last enabled mode in the menu.
5 years ago
Robert 40ba01fd72 Fix footer with no_mode/disabled progress bar (#5491) 5 years ago
yparitcher 65fcd385c0 [chore] Fix typos (#5474) 5 years ago
Robert 5209493ba8 [UX] Option to show progress bar at the bottom of the screen (#5442) 5 years ago
poire-z 50f3aa252f cre progress meter: avoid some warning with unit tests (#5464)
Quick fix for some warnings shown in unit tests output, see https://github.com/koreader/koreader/pull/5406#issuecomment-540059452
5 years ago
yparitcher 8ed088159c [Plugin] Per directory defaults (#5428) 5 years ago
Frans de Jonge 1db7f2e444
[fix] Try to make screensaver settings slightly less error-prone (#5460)
Regression inadvertently caused by #5369.

With the way this is constructed, this is almost guaranteed to happen.

Fixes #5459.
5 years ago
Frans de Jonge 0fa1b44782
[UX] Add … button to highlight edit (#5456)
Shows regular highlight dialog. Fixes #5455.
5 years ago
poire-z 529d2d91d6
cre: properly unmark link position markers (#5451)
By restoring the previous content instead of just drawing
a white rectangle.
5 years ago
Robert 27de8d9bdf Fix: Footer overflow screen after resize emulator window (#5439) 5 years ago
Frans de Jonge f7861bc1eb
[feat] Add haptic feedback (#5380)
References <https://github.com/koreader/koreader/issues/5374>.
5 years ago
Frans de Jonge d0f95ec669
[UX] Use ProgressWidget in frontlight (#5373)
This makes it behave like a pretty decent slider.

Cf. <https://github.com/koreader/koreader/issues/5314>.
5 years ago
yparitcher 09d49e29ad [UX] Add inverse reading order to gesture manager (#5423)
Also fixes #5354.
5 years ago
Robert 0778ec09fc Fix: incorrect chapter markers (#5425) 5 years ago
poire-z 5bc6bf046c
bump crengine, show progress meter on load/re-rendering (#5406)
Includes:
- Adds tinyNodeCollection::getStatistics()
- epubfmt.cpp: cleanup indentation and small optimisation
- Add more progress callback events
- Optimisation: avoid re-init for EPUBs with embedded fonts
- Fix: don't draw border when border-color: transparent
- CSS: ignore 'inherit' inside font-family

Show a small progress meter at top left of screen when
crengine is loading, re-rendering, and saving cache file
(after a 2 second delay to not be bothered on small books).

Also add a wrapper for the last remaining bit of code that
was accessing _document directly (:getPageOffsetX()).
5 years ago
Robert e2c771dd2d Two-line footer (#5405)
Close: #1933

New option that moves progress bar to separate line in footer.
5 years ago
Frans de Jonge d456a076af
[feat, UX] Ignore hold corners (#5404)
Closes <https://github.com/koreader/koreader/issues/5401>.
5 years ago
Robert 8c1610b4e9 Fix: Incorrect width of separator line (#5403)
Fix: #5399
5 years ago
Robert d08516bd89 Fix: footer offset when orientation changes (#5396)
Fix: #5395
5 years ago
Robert a7c358b080 [UX] Sort footer elements (#5389)
Close: #5329 

- new option for footer - `Sort items`
- new widget `SortWidget`
5 years ago
Robert deaa5d98e6 Disable show chapter markers when progress bar is hidden in footer (#5345) 5 years ago
Frans de Jonge ed4396821f
[fix] ReadSettings Inverse reading order (#5350)
`self.inverse_reading_order == nil and G_reader_settings:has("inverse_reading_order")` could easily be false, which would then incorrectly turn the setting off.

Fixes <https://github.com/koreader/koreader/issues/5346>.
5 years ago
Frans de Jonge 872c145f3a
[fix] ReaderGesture: Use getCurrentNetwork().ssid (#5334)
Otherwise ffi/util.template crashes on a table.
5 years ago
NiLuJe 5f189beba9 You have failed this city! (#5321)
Switch two finger swipe icons to double arrows
5 years ago
Robert 2d95a09e93 [UX] Option to show horizontal line separator in footer (#5309)
The separator is hidden by default.
5 years ago
Robert ae50569055 Frontlight - Add checkbox use system settings (#5307)
See: https://github.com/koreader/koreader/issues/5205#issuecomment-526935357

Devices with `hasLightLevelFallback = true` (for now Android) has extra checkbutton `Use system settings`. Default unchecked.
5 years ago
Frans de Jonge 4cdc3ab99b
[feat, plugin] Add AutoTurn (#5295)
Fixes <https://github.com/koreader/koreader/issues/3019>.
5 years ago
Robert d7d99d8b8b New memory icon for footer (#5300)
See: https://github.com/koreader/koreader/pull/5203#issuecomment-525849264
Old memory icon: ⌨
New: ≡
5 years ago
Robert 3f3443b2e2 [UX] Reorganize tap corner menu in Gesture Manager (#5294)
Reorganize submenu tap corner like other submenus
Settings -> Tap and gestures -> Gesture manager -> Tap corner
5 years ago
Frans de Jonge 37bab4fe89
[fix] Pass plain link to link:onGotoLink (#5286)
Internal links carry more baggage than external ones.

See <https://github.com/koreader/koreader/pull/5282#issuecomment-526813719>.
5 years ago
Frans de Jonge f1f6eebce0
[feat] Add MuPDF EPUB/FB2 dynamic font size (#5282)
Closes #4368.
5 years ago
Frans de Jonge f6270278aa
[feat] Implement fulltext search direction (#5283)
Closes <https://github.com/koreader/koreader/issues/5054>.
5 years ago
Frans de Jonge ac16c8d547
[UX] Treat inverse_reading_order as a proper setting (#5284)
This is supported by ReaderPaging and ReaderRolling, but the menu entry was only shown in ReaderPaging.

Hold now sets the global default.

Fixes <https://github.com/koreader/koreader/issues/4983>.
Fixes <https://github.com/koreader/koreader/issues/4089>.
5 years ago
Frans de Jonge dd4bfb0a45
[UX] Ignore page flipping toggle while bookmark flipping (#5276)
See https://github.com/koreader/koreader/issues/5265#issuecomment-525626930
5 years ago
Frans de Jonge 2104bb6f98
[fix] Distinguish bookmark/page flipping in menu (#5266)
Fixes <https://github.com/koreader/koreader/issues/5265>.
5 years ago
Frans de Jonge be87fb27a0
[chore] Convert a couple more todos (#5267)
Cf. <https://github.com/koreader/koreader/pull/5244>.

Also update check.
5 years ago
Frans de Jonge f3c3989b7f [chore] readertypeset: normalize string indentation
Same as <ece884a368/frontend/ui/widget/configdialog.lua (L1015-L1019)>.
5 years ago
Frans de Jonge 45a0f285f1
[fix, i18n] Make two strings translatable (#5256)
Fixes <https://github.com/koreader/koreader/issues/5255>.
5 years ago
Frans de Jonge 6ed58346a1
[i18n] Add translator notes (#5250)
Thanks to <https://github.com/koreader/koreader/pull/5237> we can now  extract the knowledge currently embedded in Transifex and put it directly in our source. This positively affects <https://github.com/koreader/koreader/issues/3754>.

Translation instructions and knowledge that comes out of localization-related questions should be preserved in the source, because Transifex is too ephemeral. For example, the links from <https://github.com/koreader/koreader/pull/2290> are no longer accessible. Even when they are, it's quite useful to have this information around while dealing with the code as well, and I also hope it'll be informative to contributors who seldom visit Transifex.

This commit also makes a few minor changes to obviate the need for comments where possible.
5 years ago
Frans de Jonge a2dcfe9aec
[doc] Tag @todo, @fixme and @warning (#5244)
This commit standardizes the various todos around the code a bit in a manner recognized by LDoc.

Besides drawing more attention by being displayed in the developer docs, they're also extractable with LDoc on the command line:

```sh
ldoc --tags todo,fixme *.lua
```

However, whether that particular usage offers any advantage over other search tools is questionable at best.

* and some random beautification
5 years ago
Frans de Jonge da988c15de
[CI] Switch to custom xgettext build to extract multiline strings (#5242)
Because let's face it, it just looks much better this way.

Docker image update in https://github.com/koreader/virdevenv/pull/43

Discussion in https://github.com/koreader/koreader/pull/5238#issuecomment-523675211 and https://github.com/koreader/koreader/pull/4524
5 years ago
Frans de Jonge e2ceace302
[fix, CI] Push to Transifex from master, fix multiline strings for xgettext (#5238)
Related to https://github.com/koreader/koreader/pull/5237
5 years ago
Robert 395503d6ba [fix] Prevent double run genFooterText (#5233) 5 years ago
Martín Fernández 3a957d71e3 [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220)
Fixes #5093
5 years ago
Robert 33e4c36a42 [UX] Move tap x y corner to tap corner submenu (#5225)
Ref: https://github.com/koreader/koreader/issues/5021#issuecomment-522308285
Close: #5021
5 years ago
Robert f56e9bcf98 Fix after #5203 (#5218)
https://github.com/koreader/koreader/pull/5203#issuecomment-522156268
https://github.com/koreader/koreader/pull/5203#pullrequestreview-276228925
5 years ago
poire-z d25d449a26
bump crengine and others, adds HTML extended debug view (#5219)
Bump crengine: background image and other fixes:
- View HTML: option to show text unicode codepoints
- Fix attribute parsing: decode &-encoded chars
- Text: allow wrap after more unicode spaces and hyphen
- Fix: no left hanging when hanging punctuation disabled
- lvtextfm.cpp: more comments, some formatting cleanup
- Optimize background image drawing
- CSS: fix background-image file path resolution

Bump luasec to 0.8.1
Bump harfbuzz to 2.6.0

cre.cpp:
Adds setBackgroundImage() proxy function to crengine
facility to set background textures (this is unrelated
to the background-image CSS fixes).
No frontend code (yet) to select such an image.

View HTML: adds a 3rd view (extended debug view), showing the
unicode codepoint of each char and crengine rendereing methods.
5 years ago
Robert 5da3312869 More footer options, default to use icons as prefixes (#5203)
- show icons or letters as prefix of items
- various footer separators
- progress percentage format with decimal digits
- time in 12/24 format
- two duration formats (1:30, 1h30')
- move some options into Settings submenu
5 years ago
Robert 939538cc25 [UX] Add gesture - poweroff and restart device (#5202)
Also abstract canRestart, canReboot and CanPowerOff.
5 years ago
Frans de Jonge a87c33f1f2
[lang] Change 5 years ago
Robert 0a2a1fffe8 [UI] Status bar alignment (#5195)
Close #5044
Option to align status bar without progress bar.
5 years ago
Robert f450936e9a Fix: conflict horizontal edge gesture with link swipe (#5189)
See: #5186
5 years ago
Robert 9baf055154 [UX] Add spread/pinch & font increase/decrease to gesture manager (#5188)
* Add spread/pinch gesture to gesture manager
ability to disable: 
https://www.mobileread.com/forums/showthread.php?t=321818
https://github.com/koreader/koreader/pull/4815#issuecomment-478462416

* Add increase/decrease font size action gesture
https://github.com/koreader/koreader/issues/4727#issuecomment-475950484
5 years ago
Robert aec112fa6b [UX] Add double finger up and down swipe gesture (#5183)
* Add double finger up and down swipe gesture
* Cleaning ReaderFrontLight
5 years ago
Robert dac2458427 [UX] Extend edge zones (#5181)
See: https://github.com/koreader/koreader/pull/5179#discussion_r310676845
5 years ago
Frans de Jonge ec6e34cb1e
Change default zoom mode & add warning message for fit page + scroll (#5170)
* [UX] Change default zoom mode to page width

Fixes #5166.

* Warning popup for weird scroll mode combinations
5 years ago
Robert 5245bc88ff [UX] Add horizontal edge gestures (#5179) 5 years ago
poire-z a82d7832b9 Dict lookups: have them always interruptible
They should be now interruptible when fuzzy search is disabled
and on Android.
5 years ago
Robert 825a3c4b52 Add gesture - show current book statistics (#5167) 5 years ago
Robert c6c8c5a037 Add vertical edge gesture (#5156)
* Add vertical edge gesture
* Add left/right edge swipe gesture
* Move kobolight plugin to ReaderFrontlight
* Remove kobolight plugin
5 years ago
Robert 803a143764 [sdl] Add support arrow key for next/prev page (#5149)
Close: #4997 
This PR add support arrow key and mouse scroll wheel for next/previous page.

- Document in page mode:

PageDown, Arrow down, Arrow right - go to next page
PageUp, Arrow up, arrow left - go to prev page
Mouse scroll wheel down - go to next page
Mouse scroll wheel up - go to prev page

- Document in scroll mode:

PageDown, Arrow right - go to next page
PageUp, Arrow, arrow left - go to prev page
Arrow down - scroll document down
Arrow up - scroll document up
Mouse scroll wheel down - scroll document down
Mouse scroll wheel up - scroll document up
5 years ago
Frans de Jonge f763839577
[fix] Typo miliseconds → milliseconds (#5145)
Follow-up to https://github.com/koreader/koreader/pull/5138
5 years ago
Robert 1f6af80817 [feat] Make gesture intervals configurable (#5138)
Discussion: #4842
Close: #4842
5 years ago
Robert 69ee8c48cc Fix: Status bar hides text with minimal bottom margin (#5135)
With very narrow bottom margin text is sometimes hidden by status bar.
5 years ago
Robert 39bf5a4677 [feat] File manager - add option to view unsupported files (#5129)
New option to show all files (also not supported by KOReader) in file manager. Default this option is disabled.
5 years ago
poire-z 0f3f2b660b TOC: baseline align chapter name and page number 5 years ago
poire-z 8b612142b7 Prettier CSS when viewing HTML
Avoid wraps on comma in properties values (eg. in font list,
in rgb() values).
Also prettify CSS included in the HTML in debug view.
5 years ago
poire-z 9f3c85ed83 cre: toggable enhanced rendering (floats, collapsed margins...)
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.
5 years ago
Martín Fernández b385e443e6 [Android] Add support for 3rd party dictionary apps (#5108)
Co-Authored-By: poire-z <poire-z@users.noreply.github.com>
5 years ago
Robert 7d093fc0b9 [feat] Delete book after reading (#5107) 5 years ago
NiLuJe 38e7975728
More robust Gyro toggle (#5104)
* Make toggling Gyro events more robust

Actually ask to turn it on/off depending on the setting, instead of a
blind toggle

A quick succession of suspend/resume events could otherwise leave it
in an unexpected state (i.e., off when it should have been on).
5 years ago
NiLuJe 4ccb1f3dd5
Allow disabling automagic image inversion in Nightmode in CRe (#5095)
* Allow disabling automagic image inversion in NightMode

Fix #4986
5 years ago
Frans de Jonge 7cbd56fcdd
[fix] End of document - go to file browser: swap openFileBrowser() close/open order (#5062)
Fixes #5060.

Cf. 89e002f236/frontend/apps/reader/modules/readermenu.lua (L42-L50) and 89e002f236/frontend/apps/reader/readerui.lua (L711-L718)
5 years ago
Frans de Jonge 8815cbe07a
[fix, chore] Abstract filename logic in util.getSafeFilename() (#5026)
Fixes https://github.com/koreader/koreader/issues/5025

The OPDS browser was doing some fancier stuff in a way that should be abstracted away in util (because it applies anywhere files will be saved):

eace8d25c1/frontend/ui/widget/opdsbrowser.lua (L482-L491)
5 years ago
poire-z eace8d25c1 cre: fix possible crash when switching books too fast
Noticable with "End of document action > Open next file",
and holding PgDn in a directory full of single page html
files.
5 years ago
poire-z 7c53fcd922 CRe margins: hide bottom menu on change (#5000)
So we can immediately see how's the bottom margin.
5 years ago
poire-z bf07c44009
CRe margins: add toggle to sync top and bottom margins (#4990)
Also fix DogEar size update on margin change.
Also re-order cre bottom tabs to be like with kopt.
5 years ago
NiLuJe 888d3591b2
Give more control over CRe margins (#4945)
Without having to resort to weird custom defaults.

* Split the current margins setting in three:
  * Horizontal margins (because you generally want those two to be balanced).
  * Top margin & Bottom margin (because you may want to tweak those separately to deal with quirky status bar/final line shenanigans).

* Also, add a "Reclaim bar height from bottom margin" toggle to the status bar menu, to optionally make sure the status bar won't eat into the bottom margin.

* Includes a free fix to diacritics popup refresh handling in the keyboard ;).
5 years ago
Frans de Jonge ff843e0eb7 [i18n] Change user-facing floating punctuation text to hanging punctuation
See https://www.mobileread.com/forums/showthread.php?t=316787
5 years ago
NiLuJe 9134594119
Allow toggling CRe's new dithering & scaling (#4922)
Smooth scaling toggle is per document, in the gear tab.
Dithering is in the Dev top menu ;).
5 years ago
Galunid 9759ffa381 [feat] GestureManager: Implement action to change highlight style using gesture manager (#4936) 5 years ago
Frans de Jonge 8882cdf0c5 [chore] Show FileManager in case of showReaderCoroutine failure
Same as https://github.com/koreader/koreader/pull/2956.

Fixes https://github.com/koreader/koreader/issues/4928.
5 years ago
NiLuJe 33946aa732
Some FL regression fixes after #4901 (#4921)
* Make hasNaturalLight* caps safe to call without a device check. (fix #4919)
Make it clear that it's expecting the NTX implementation, though.
* Don't turn the FL on on resume if it was off on suspend
* Make sure turnOn/turnOff actually updates hw_intensity in the process where it matters, instead of just in a short lived fork ;). (fix #4923)
5 years ago
NiLuJe 4005bf69aa
Slightly less crappy Nightmode (#4871)
Companion PR to https://github.com/koreader/koreader-base/pull/884
* Basically flags devices known to be stable when using PxP inversion.
* Plus, random fix for #4870 ;).
* A few FrontLight tweaks & cleanups on Kobo:
  * Moved the Kobo-specific startup status insanity to Kobo-specific init
  * Made turnOff/turnOn frontlight do a smooth ramp down/up
  * On Kobo, use turnOff/turnOn for suspend/resume, to get that smooth toggle
  * On Kobo, for NaturalLight w/ a mixer, only set warmth for setWarmth, and only set Brightness for setBrightness, otherwise, it tried to set both with not in-sync values, which made the FL widget jittery.
5 years ago
Frans de Jonge 8466af2c5b
[UX] Gesture manager: corner gestures (#4878)
Adds configuration to the top corners as well as the additional gestures hold and two-finger tap.

Deprecates `DTAP_ZONE_FLIPPING` and `DTAP_ZONE_BOOKMARK`.

Fixes #4877.
5 years ago
poire-z 5c38bcb8b7 [UX] Links menu and handling tweaks (#4867)
- Removed "Swipe to follow first link on page" menu item and
  handling code, as it feels not really as practical as
  "Swipe to follow nearest link".
- Removed recently added "External link action", as we can
  just always present a popup with the url and the available
  actions.
- Generic handling of these actions in onGoToExternalLink(),
  so they are proposed on the Wikipedia lookup popup too.
- Allow external link on PDF documents (previously, only
  internal links were handled).
- Have "Ignore external links on tap" available on all
  document types.
- Added "Ignore external links on swipe" (default to true,
  the current behaviour).
- Added multiswipe gesture "Follow nearest internal link"
  (the existing "Follow nearest link" now follows the
  nearest external or internal link)
- ButtonDialogTitle: added an option to look a bit more
  alike ConfirmBoxes.
- Footnote popups: fix link unhighlight when tap on external link.
5 years ago
Frans de Jonge 709207a621
[feat, UX] Add external link to Wallabag (#4863)
Offers a choice when Wallabag is available.
5 years ago
poire-z 7396abebf2 [chore] reformat all gestures "overrides" to be diff friendly 5 years ago
poire-z 44529dbbc9 Fix tap for top menu occasionally not working
It was missing some ordering hints to have it always
precede taps to change page.
(Somehow noticed only when we reached > 32 gestures
registered, which may have introduced some shuffling,
while previously the addition order was somehow
preserved...)
5 years ago
Frans de Jonge 433b89638a
[UX] Gesture manager: show selected two-finger swipe action (#4855)
As requested by @poire-z here: https://github.com/koreader/koreader/pull/4820#issuecomment-478220239
5 years ago
NiLuJe b72a2000b1
A few minor fixes after #4847 (#4850)
* Add a toggle to disable the C blitter in the Dev menu (depends on https://github.com/koreader/koreader-base/pull/882) (never shown if the JIT is disabled, grayed out if the C blitter is not installed)
* Fix a few sizeUtf8Text call sites that were doing a nil check in order to account for the new return type.
* Tweak statusbar handling to avoid spurious sizeUtf8Text warnings when it's hidden, and unify its behavior between being hidden via toggle, and hidden on book open (at least when all-at-once is not enabled).
* c.f., https://github.com/koreader/koreader-base/pull/882 (Android, PB, RGB32 & Legacy Kindle regression fixes).
5 years ago
Frans de Jonge db5bd8884d
[UX] Gesture manager: add diagonal two-finger swipes (#4820)
Follow-up to #4815. Pointed out as an easy target [here](https://github.com/koreader/koreader/pull/4815#issuecomment-473990141) by @poire-z.
5 years ago
NiLuJe 7210fb478d
Faster blitting @ BB8/BBRGB32 when no processing is needed (#4847)
* Pickup the eponymous blitting performance tweaks from koreader/koreader-base#878
* Cleanup BitOpts usage (require & cache)
* Unify oddness checks (MOD -> AND)
* Enforce the native Portrait orientation on Kobo (except @ 16bpp, i.e., KSM w/ 8bpp swap disabled), to allow for faster blitting when unrotted.
* Switch CRe BB to 32BPP on color screens
* Minor cleanups
5 years ago
NiLuJe abbb3ea747 Increase granularity of the font size fine tuning button
Should allow us to get at the full 12 to 30 range when scaled on a 300dpi
device (29 -> 72 or 26 -> 64 w/ a dpi override).
5 years ago
poire-z b98ee4583b Footnote popups: fix crash when used on some links
Fix crash when dismissing the popup when the link was
detected as "not coherent".
5 years ago
poire-z a47f3a2765 ReaderRolling: proper refresh when toggling scroll/page mode
When toggling between scroll and page modes multiple
times, _gotoXPointer() could find the xpointer to be
already positionned and avoid calling setDirty() (so
not enqueuing a whole screen refresh). But the page
will be slightly moved to account for the top margin
disappearing. We need that whole screen refresh in
such cases, so ensure one is enqueued.
5 years ago
poire-z cfd562697f
Fix Color rendering toggle not toggable (#4836)
Also refresh screen when toggling.
5 years ago
Frans de Jonge b1ed2838c8
[UX] Add Device:openLink() stub for Linux SDL (#4822)
References #4821.
5 years ago
Frans de Jonge 728bb187fa
[UX] Gesture manager: add two-finger swipe left and right (#4815)
Also add Device:hasMultitouch() to control whether the configuration menu is shown.

Cf. #4727.
5 years ago
Frans de Jonge 59d8a1852f
[fix, lang] ReaderGesture: toggle highlight action to cycle (#4809)
I overlooked this until I noticed it on Transifex today.

See https://github.com/koreader/koreader/pull/4791#discussion_r265546245

Also changing the internal name because for something that's only been in one or two nightlies there's no point in prematurely introducing legacy settings.
5 years ago
poire-z 454f14384b
Gesture manager: fix actions: Book cover, Book description (#4800)
Code removed from ReaderGesture and put into BookInfo where
it belongs, so we can just use Events.
Also convert description to plain text to not show HTML tags.
5 years ago
NiLuJe 645d41eda9
Add more granularity in line-height settings with CRe (#4785)
70 -> 130, in steps of 5 ;).
5 years ago
poire-z 2aa77a4879 Gesture manager: add actions: Book cover, Book description 5 years ago
poire-z c060595580
ConfigDialog: fix ButtonProgressWidget and some refreshes (#4793)
This internal ButtonProgressWidget widget was behaving
differently from all others (OptionTextItem, OptionIconItem
and ToggleSwitch) by duplicating some code from
ConfigDialog:onConfigChoose() instead of calling it directly.

While making it similar to others, I noticed that onConfigChoose()
did a full repaint, which was necessary for some settings to
be applied (ie: Contrast).
On CreDocument, this full repaint may cause some double drawing
on config changes (ie: Margins, drawing once after margin changes,
and then re-positionning to previous xpointer).
So, make the need for full repaint a condition on KoptOptions.
5 years ago
NiLuJe 2011cf1ad1 Various blitting related cleanups (#4789)
* Fix the "Enable debug logging" checkbox so that it properly disables "Enable verbose debug logging" when it gets disabled
* Avoid asking ImageWidget for alpha-blending when it's not useful
* Make ImageWidget's alpha-blending code-path double-check that alpha-blending actually is needed, and avoid it if possible
* In the same vein, only do alpha-blending in textboxwidget when absolutely necessary
* Prefer color constants over the gray() method, ensuring that they're part of the eInk palette

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

Fix #4774
5 years ago
Galunid f637555d93 [UX] Gesture manager: add action - cycle default highlight action (#4791)
Cf. https://github.com/koreader/koreader/issues/4727
5 years ago
Frans de Jonge 930731d67c
[UX] Gesture manager: add a little notification to the wifi on action (#4786)
Fixes #4783.

Perhaps this should be in NetworkManager instead.
5 years ago
poire-z 766b199880 cre 2-pages view: allow extending selection across pages
Similar to what's been added for 1 page view, but just turn
one page instead of switching to scroll mode when reaching
top left or bottom right corners.
Also make the selection start xpointer more accurate by
getting them in onHold(), instead of possibly too late in
onHoldPan() where we have already moved.
5 years ago
poire-z 220b2dcfc2 cre 2-pages view: fix markers when following links and back
Show markers in the middle margin when target is in the right page.
5 years ago
poire-z 22bc9dacb5 cre landscape view: adds 1 page / 2 pages toggable
Adds a toggle switch in the Orientation bottom config menu to
allow showing 1 page or 2 pages when in landscape mode.
Previously, this was hardcoded to be in 2-pages modes only
in some circumstances (device resolution + user dpi).
5 years ago
poire-z 0948a4b656 cre: tweak current page highlights detection
No need to use current page and xpointers. We can use
'pos', in both scroll and page modes, as it is always
accurate to show the y of the current view.
5 years ago
poire-z 1a4faad17c cre: Footnotes popup: fix markers disappearing too early
When following a footnote popup, the highlighted link
delayed clearing (when the link is hidden by the popup)
would clear the margin marker on the target page too early.
5 years ago
Galunid 14c705f11b Enable addNote button, by letting it edit highlight (#4773) 5 years ago
Frans de Jonge 80d7d1a530
[UX] Gesture manager: add action - show book information (#4777)
As requested by @ersi.

Cf. https://github.com/koreader/koreader/issues/4727#issuecomment-471766024
5 years ago
poire-z 658f513512 [fix] cre: fix position and page number after window resize (#4754) 5 years ago
Frans de Jonge 5ccc3ec352
[UX] Gesture manager: allow folder shortcuts as action in Reader (#4759)
Note that `self.ui:onClose()` properly closes open documents. There might be similar pieces of code around that don't do that.

Fixes #4755.
5 years ago
poire-z 2c98c81a0d
cre: fix highlights in 2-pages mode (#4753)
Also check for boxes in the 2nd page when in 2 page modes
(and fix onTapXPointerSavedHighlight(), too quickly cut
and pasted from drawXPointerSavedHighlight() recently).
Bump crengine and cre.cpp to correctly returns rect for
the first line of the 2nd page.
5 years ago
Frans de Jonge 511570f65d
[fix] ReaderUI Pass self in open with cancel callback (#4751)
I added a call to self in ReaderUI:showFileManager() in #4720, breaking this singular reference that wasn't passing self.

Reported on Gitter by @ptrm, see https://gitter.im/koreader/koreader?at=5c81465725e4e24c072f1a00
5 years ago
Frans de Jonge 52300ffb15
[fix] ReaderStatus showStatus to onShowBookStatus (#4750)
Overlooked in #4746, see https://github.com/koreader/koreader/pull/4746#issuecomment-470569106
5 years ago
Frans de Jonge dc829d0223
[UX] Gesture manager: add action - book status (#4746)
Marking a document as "finished" is important for Wallabag (see, among others, #4737, #4271). Also it's an obvious missing action.

Default to left, up. That keeps with the fullscreen dialog gestures generally go up. Also it was still unassigned.

* Remove separator on last item, see https://github.com/koreader/koreader/pull/4737#pullrequestreview-210948520
5 years ago
Frans de Jonge 5992bb6401
Bump fonts (#4744)
Fixes #4743 (shallow submodule + GitHub bug). Updated FreeSans fixes #4707 todo (swapped arrows).
5 years ago
Frans de Jonge 2f456dfb2f
[UX] Gesture manager: add actions - toggle wifi and wifi on/off (#4739)
As suggested by @poire-z.

https://github.com/koreader/koreader/issues/4727#issuecomment-469668338

I wanted to make the gesture a `W`, but that's a bit too unwieldy. Instead there's the suggestion of a (backward) `W`.

The default gestures for wifi on and off are diagonal multiswipe half circles, like an turnable on/off knob.
5 years ago
poire-z addd06c1de [fix, UX] Gesture manager: fix "Toggle rotation" action (#4740)
By using the same events used by the bottom menu toggles.

Reference #4724 (comment). Close #4738.
5 years ago
Frans de Jonge 29f52cce81 [feat] Gesture manager: add Wallabag download 5 years ago
Frans de Jonge bae83ad663
[UX] Gesture manager: add action - folder shortcuts (#4733)
See #4727.
5 years ago
poire-z c510a5b1b1 [UX] Gesture manager: add Exit and Restart action and a few gestures (#4725)
* [UX] Gesture manager: add action - Exit and Restart

Also:
- add and show some separators in the gestures list
- fix gesture removal, and also remove it from settings
- add missing east west east
- add 6 remaining of the 8 knob 3/4 rotations
- add 3 easy knob full rotation (down + east + west)

* Show and allow removing gestures only in settings

* small optimisation (no loop needed on each multiswipe check)

* keep menu open and updated when recording multiswipe
5 years ago
Qingping Hou 9e57e56f95 decouple UI definitions from document modules 5 years ago
Frans de Jonge 2ba480b41d
[UX] Gesture manager: add action - file search (#4720)
Also makes it callable from the reader.

Fixes #4717.
5 years ago
poire-z 3059ad8bce
Fix "fonts test HTML document" styles (#4718)
Needed some update after we made htm.css obsolete and
use epub.css instead.
5 years ago
Frans de Jonge c1b4085b93
[UX] Add cropping: none mapped to page width zoom (#4696)
Fixes #1923.
5 years ago
poire-z 93422d05f4 [UX] Gesture manager: add action - clear location history (#4716)
Also show notification when previous_location can't go
back because the location stack is empty.
5 years ago
Frans de Jonge 5b30ea1920
[fix, UX] Common menu & info menu: switch to dofile (#4713)
Require is kept in memory, including the modifications made to it by MenuSorter. This can cause trouble when switching between the FileManager and Reader.

Fixes #4703.
5 years ago
Frans de Jonge e96ac7e7dc
[UX] Gesture manager: add action - fulltext search (#4715)
Fixes #4687.
5 years ago
Frans de Jonge c9de46d656
[UX] Gesture manager: add action - follow nearest link (#4714)
Start your gesture on the link to follow it.

Defaults to southeast, northeast.

References https://github.com/koreader/koreader/issues/4687
See https://github.com/koreader/koreader/issues/4687#issuecomment-468827385
5 years ago
Frans de Jonge 614cbb509d
[fix] ReaderFooter: Don't hide progressbar if it's the only ticked option (#4648)
Fixes #3914.

Cf. #3056.
5 years ago
Frans de Jonge e4319ddaea
[feat, UX] Gesture manager: add support for diagonal swipes (#4710)
NB The north east and north west arrows are swapped, see https://github.com/koreader/koreader/issues/4707
5 years ago
Frans de Jonge 57ce8dc574
[UX] Gesture manager: add action - show dictionary/Wikipedia (#4699)
References #4687.
5 years ago
Frans de Jonge 3aa5ebb1df [fix] Gesture manager: most defaults should be reader-only 5 years ago
Frans de Jonge 8a1c0f6bd4 [UX] Gesture manager: add default previous/next chapter gesture
* Up, down, up for previous.
* Dow, up, down for next.
5 years ago
Frans de Jonge ba4bf7243d
[chore] Deprecate TapForward/TapBackward (#4689)
Also fix previous page action in gesture manager.
5 years ago
poire-z 1e4469fec2 [UX] Gesture manager: add actions - prev/next chapter (#4692)
Also adds rudimentary support for these in ReaderPaging.
5 years ago
Frans de Jonge 1475acdae7
[UX] Gesture manager: add action - go to (#4690)
Cf. <https://github.com/koreader/koreader/issues/4687>.
5 years ago
Frans de Jonge 332fa642e3
[UX] Gesture manager: add action - toggle reflow (#4688)
Cf. https://github.com/koreader/koreader/issues/4687
5 years ago
Frans de Jonge 4547b2d65f
[fix] GestureDetector: add PAN_DELAYED_INTERVAL (#4666)
When multiswipes are enabled, this fixes the long-standing complaint that swiping to open the menu could unintentionally trigger some light panning. With the introduction of multiswipes, this problem has become more noticeable.
5 years ago
Frans de Jonge 96823df503
[UX] Navigation settings for all devices (#4680)
Before multiswipes and the gesture manager this was impractical on touch-only devices, but no more!

Also includes some minor textual clarifications on some of the settings.
5 years ago
Frans de Jonge 060902534d
[fix] Gesture manager: more logical position for file browser (#4679)
See https://github.com/koreader/koreader/pull/4678#issuecomment-468378040
5 years ago
Frans de Jonge db0467c9f0
[UX] Introduce Taps & Gestures menu (#4677)
This more logically groups together various settings related to taps and gestures.

Cf. <https://github.com/koreader/koreader/pull/4655#issuecomment-466808273>.
5 years ago
Frans de Jonge 32d813dc92
[UX] Gesture manager: add action - go to file browser (#4678)
Fixes #4676.
5 years ago
Frans de Jonge 75501d5f83
[fix] ReaderGesture: enable/disable multiswipes without restarting (#4673) 5 years ago
Frans de Jonge 163853afdf
[UX] Gesture manager: add action - show menu (#4665) 5 years ago
poire-z 1c0a8c1ef9 cre scroll mode: fix last line of book hidden by footer
By scrolling last page a little bit further.

Also fix a few other scroll mode issues, all related
to doc_height not being updated (eg, in the middle of
a book, and doubling the font size, one would not
be able to turn pages and read the 2nd half of the
book...)
5 years ago
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.
5 years ago
Frans de Jonge f8f3132315
[UX] Gesture manager: add action - show frontlight dialog (#4664)
Rationale for the default `down, left` gesture: it's pointing at the location for the frontlight toggle.
5 years ago
Frans de Jonge ff14c7896d
[UX] Gesture manager: add north west = folder up as file manager default (#4662)
Up, left is also the traditional Opera gesture for parent directory.
5 years ago
Frans de Jonge 47ba296f17
[UX] Gesture manager: more multiswipe defaults (#4660) 5 years ago
Frans de Jonge 926150db58
[UX] Gesture manager: add action - go to latest bookmark (#4657) 5 years ago