Commit Graph

784 Commits (7210fb478d8d0c6aa5bb8e0ae3e0fc67dd730874)

Author SHA1 Message Date
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
poire-z b7b4cdd2a7 ConfigDialog: fix possible crash (#4838)
When one has set a default for toggles thad don't have 'values' in
their definitions (possibly only Orientation).
5 years ago
NiLuJe 003de939b0 [fix] Properly account for MuPDF feeding us premultiplied alpha (#4807)
* Properly account for MuPDF feeding us premultiplied alpha

* Bump base to pickup necessary backend changes

Also includes a bunch of CMake refactoring
(https://github.com/koreader/koreader-base/pull/865
https://github.com/koreader/koreader-base/pull/867
https://github.com/koreader/koreader-base/pull/868)
5 years ago
poire-z b16aa79636
ConfigDialog ButtonProgress: black border on default item (#4805)
Make the default (user set, or KOReader's default) item
among the button progress squares shown with a black border.
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
poire-z 9560bc2061
ConfigDialog: fix some gray mismatch in prev commit (#4797)
Remove gray underline on text items (font size items).
Adjust gray color of ButtonProgressWidget to match the
one of ToggleSwitch (just need to invert it, as it's
used to select button, which cause this color to be
inverted).
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
NiLuJe 930286d3f5 Slightly prettier virtual keyboard (#4776)
Add a thin border around keys (square)
5 years ago
Frans de Jonge 2536cc2645
[fix] widget/menu: Don't propagate ShowGotoDialog to other widgets (#4761)
Fixes #4760.
5 years ago
Qingping Hou 634fed5487 use device instead of canvascontext in UI modules 5 years ago
Qingping Hou 1605409c60 rename runtimectl to document/canvascontext 5 years ago
Qingping Hou adb5d5a52c use screen for UI color control 5 years ago
Qingping Hou d749591984 decouple device from pdfdocument, font & bgr checking 5 years ago
Qingping Hou 02eca23649 decouple device from document modules 5 years ago
poire-z 779909343c [UX] ButtonProgressWidget: thin grey buttons instead of black (#4700)
May help with ghosting when closing bottom dialog,
and fit better with the other grey toggles.
5 years ago
Frans de Jonge 1d1dc74290 [UX] creoptions: add more margin values
Fixes #4684.
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
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.
5 years ago
NiLuJe abc6d17a25
A few minor fixes after #4541 (#4561)
* Enforce dithering in PicDocument
* Ensure we'll get a flashing update on ScreenSaver exit
5 years ago
NiLuJe 8189945be9
A few graphics fixes after #4541 (#4554)
* Various FocusManager related tweaks to limit its usage to devices with a DPad, and prevent initial button highlights in Dialogs on devices where it makes no sense (i.e., those without a DPad. And even on DPad devices, I'm not even sure how we'd go about making one of those pop up anyway, because no Touch ;)!).
* One mysterious fix to text-only Buttons so that the flash_ui highlight always works, and always honors `FrameContainer`'s pill shape. (Before that, an unhighlight on a text button with a callback that didn't repaint anything [say, the find first/find last buttons in the Reader's search bar when you're already on the first/last match] would do a square black highlight, and a white pill-shaped unhighlight (leaving the black corners visible)).
The workaround makes *absolutely* no sense to me (as `self[1] -> self.frame`, AFAICT), but it works, and ensures all highlights/unhighlights are pill-shaped, so at least we're not doing maths for rounded corners for nothing ;).
5 years ago
NiLuJe 812e595608
Enable HW dithering in a few key places (#4541)
* Enable HW dithering on supported devices (Clara HD, Forma; Oasis 2, PW4)
  * FileManager and co. (where appropriate, i.e., when covers are shown)
  * Book Status
  * Reader, where appropriate:
    * CRe: on pages whith image content (for over 7.5% of the screen area, should hopefully leave stuff like bullet points or small scene breaks alone).
    * Other engines: on user-request (in the gear tab of the bottom menu), via the new "Dithering" knob (will only appear on supported devices).
  * ScreenSaver
  * ImageViewer
* Minimize repaints when flash_ui is enabled (by, almost everywhere, only repainting the flashing element, and not the toplevel window which hosts it).
  (The first pass of this involved fixing a few Button instances whose show_parent was wrong, in particular, chevrons in the FM & TopMenu).
* Hunted down a few redundant repaints (unneeded setDirty("all") calls),
  either by switching the widget to nil when only a refresh was needed, and not a repaint,
  or by passing the appropritate widget to setDirty.
  (Note to self: Enable *verbose* debugging to catch broken setDirty calls via its post guard).
  There were also a few instances of 'em right behind a widget close.
* Don't repaint the underlying widget when initially showing TopMenu & ConfigDialog.
  We unfortunately do need to do it when switching tabs, because of their variable heights.
* On Kobo, disabled the extra and completely useless full refresh before suspend/reboot/poweroff, as well as on resume. No more double refreshes!
* Fix another debug guard in Kobo sysfs_light
* Switch ImageWidget & ImageViewer mostly to "ui" updates, which will be better suited to image content pretty much everywhere, REAGL or not.

PS: (Almost 💯 commits! :D)
5 years ago
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.)
5 years ago
Sergey Avseyev 744316ea6f opds: add two more public servers (#4515) 5 years ago
Sergey Avseyev 3337e45381 opds: fix parsing OPDS from textos.info (#4514) 5 years ago
NiLuJe 81b255cb85 Better-than-nothing key repeat handling.
Mainly aimed at the Forma.
Still fairly terrible, as these things goes ;p.
5 years ago
poire-z 4d67dd59ca Rationalize Links> menu items
- Remove duplicated "Show footnote popup". Have the same setting
  applied for Tap or 'Swipe to follow nearest link'.
- Make some menu items enabled or disabled depending on if they would
  have some effect with the current state of other menu items, as
  some kind of visual self-documentation of these dependancies.
- Add menu item to set the footnote popup font size, relative to
  the book font size.
- SpinWidget: allow for showing some informative text
5 years ago
poire-z df28b90419 TouchMenu: show checkboxes in grey for disabled menu items 5 years ago
poire-z 77ec8e32e9 ConfigDialog: tweak widths computation
Small fixes to widths computation for a more balanced layout.
Decreased min width of names (on the left) from 33% to 25%, to
allow more room for toggles on the right.
(May make things a little bit too stretched out with english,
but should help with other languages that use longer words to
name things than english.)

Also ignore disabled option names in the names width calculation
(noticable on the PDF right most config menu, where toggles were
uneededly too small)
5 years ago
poire-z f533acb7f9 InfoMessage: avoid overflowing screen height with long messages
When no height= provided, and the InfoMessage would overflow
screen height when some long message is provided, decrease the
font size until the widget fit.
5 years ago
NiLuJe f6743a45db
Proper Forma support (#4414)
* Enforce a known rotation on startup, to make sure we handle touch input coordinates properly.
* Proper FrontLight warmth support (thanks to @cairnsh & @pazos in #4291)!
* Fix the PageTurn buttons mapping to match Nickel's defaults
* Properly remap PageTurn buttons depending on the current rotation.
* Actually enable the Mk.7 screen refresh codepath on *all* Mk.7 devices (I'd messed up the device check...).
* Full accelerometer handling (includes a touch of refactoring regarding orientation handling in general).
* Fix insidiously broken USBMS behavior in Nickel after we exit on FW >4.8.

Fix #4291
Fix #3002
5 years ago
endofline 295cc55e03 [fix] ODPS: socket.http redirect, where the target is a different host (#4420)
Split https/http code-path (as socket.http can adjust the Authorization/Host headers automatically)
Warn the user when the protocol differs from http/https
5 years ago
poire-z ed8f87f9f4 Fix diagonal refresh not working in TOC and History
By delegating diagonal swipe handling to GestureManager only
when the Menu or FileChooser instance is the FileManager one.
5 years ago
Sergey Avseyev 063071fcdf [UX] Set timeout for wifi result info message (#4371)
When Wifi is connected, the message "Connected." stays on the screen
waiting for the user feedback. The change sets reasonable timeout
for info message to disappear
5 years ago
poire-z 872c908a02 [UX] ConfigDialog: larger tap area around font and icons (#4351)
The font size items (Aa Aa ... Aa) and the align & column
items (for PDF) had a non-tapable spacing between them,
which could make hitting an item difficult.
This replaces this spacing by padding on each side of the item,
so a tap in between will always catch one item, for easier
selection.
6 years ago
poire-z f8199dd493
Fix a few edge cases crashes and issues (#4334)
- ReaderConfig does not need to call again self:initGesListener() on
  screen rotation/resize, as it uses the TouchZone infrastructure
  that deals itself with rotation. So, it was adding new gestures
  that were overriding tap on footer and preventing it from working.
- ReaderFooter: fix refresh area (which was too small when toggling
  from hidden to visible)
- ReaderToc: fix crash when showing TOC in scroll mode after rotation
- Menu: fix crash when no onReturn defined (could happen when tap on
  bottom left corner when showing an empty TOC)
6 years ago
poire-z 5d6807620f Fix footnote size after screen rotation (#4316) 6 years ago
Martín Fernández 1e69fae7bc [feat] Add support for BQ/Fnac devices (#4294)
Adds support for devices found in https://blog.bq.com/es/bq-ereaders-developers-program/. Tested on BQ Cervantes 4 (last BQ device from 2017).

It adds a new touch input event handler (discussed in #4275) which should work on other single touch devices (ie: Kobo Touch, Mini, Glo, Aura HD) but wasn't tested.

Includes base bump with: [feat] Add BQ/Fnac device support (https://github.com/koreader/koreader-base/pull/745)
6 years ago
Yann Muller 3fa2dad0b7 Fix for Internet Archive URL. 6 years ago
Yann Muller 030a02dfc4 Escape &, < and > when removing CDATA. 6 years ago
Yann Muller 9c251185eb Filter out CDATA. 6 years ago
Yann Muller 64d00b2969 [UX] Display the author in OPDS catalogs. (#4278) 6 years ago
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.
6 years ago
Qingping Hou a72f8b6338 decouple UI from core document code 6 years ago
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.
6 years ago
poire-z 0e2a3b6263 Selection menu: allow viewing HTML 6 years ago
Robert 6cf0a6473f OPDS - change url for Internet Archive (#4249) 6 years ago
Robert a29f0fb190 Add support for tiff and gif format in screensaver (#4250) 6 years ago
Robert 9fda983001 Add OPDS authentication (#4248) 6 years ago
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
6 years ago
Martín Fernández a6df153d2c add spanish keyboard with Ñ character (#4244) 6 years ago