Commit Graph

1011 Commits (24424e505eab617949ed34e8d4bf8c1a2d4097cc)

Author SHA1 Message Date
poire-z 24424e505e Update UI layout code to use new SVG icons
- Add IconWidget, use it for icons instead of ImageWidget.
  Specify icons by name only, look for them (with either
  .svg or .png suffixes) in multiple directories (including
  koreader/settings/icons/ to allow customizing them).
  Don't crash when icon name not found, shown a black
  background warning icon instead.
- Don't trust the icons' native sizes: replace
  scale_for_dpi=true with width/height=DGENERIC_ICON_SIZE,
  so all icons get the same (tunable) size - except in
  a few specific use cases.
- Top and bottom menu bars: normalize, and have icons
  properly centered in them, extend vertical line
  separators up to the edges.
- TOC: adjust expand/collapse icons size to items size
3 years ago
John Beard 3b1b9fe7cb
Radius corners of more boxes (#6997)
This gives a more uniform look than having some boxes rectangular and some
with radiused corners
3 years ago
NiLuJe e2dd68bd13 RenderImage: Fix __gc handling for GifDocument
* Via ffi/__gc, as this is a plain table.
3 years ago
NiLuJe d80d6dc562 Handle the BlitBuffer struct changes
* stride is now a size_t
  On some platforms, that's 64 bits, which means it's no longer
  automatically converted to a Lua number to avoid precision loss.
  Do that ourselves, because lua-serialize doesn't know how to handle an
  uint64_t cdata ;).
3 years ago
NiLuJe 32bf53cfdf
ReaderFooter: Don't duplicate a 12h clock time format option (#6973)
* ReaderFooter:
	* Honor the global twelve_hour_clock setting, instead of
	  duplicating a local one.
	  (Re #6969)

* os.date is a thin wrapper around strftime, so we might be able to get
away with some not-quite-standard extensions...

These are *definitely* supported on Linux, but are *NOT* the glibc
extension (that'd be e.g., %-I), so, hopefully, they're somewhat
portable...

They are also supported on BSD/macOS.
They are *not* supported by the MS UCRT. That means MinGW-w64, too.
This *appears* to be supported on current Bionic (it might even support
said glibc format altering extensions).

* And of course, Windows is terrible, so, make this terribly ugly to not
break it there...

* Turns out BSD also supports the dash trim format extension, so, leave
the trimming to the libc, and handle the special-casing in a way that
doesn't create stupid locals.

* Random unrelated cleanup ^^.

(https://gitter.im/koreader/koreader?at=5fd24be492aa1c4ef5d11f31)

* Update the testsuite

(Because the default used to be 24h clock).

Changed the default to 24h clock ;p.

* Explain why we don't try to fix it in Lua
3 years ago
poire-z a0eb91d6ab
Some RTL UI fix up after #6885 (#6975)
Avoid crash with RTL UI after options we moved.
Swap Zoom direction items when RTL UI.
Also don't check show_func when sizing the names
on the bottom menu, to avoid icons moving or
resizing when toggling options.
3 years ago
poire-z c20ad8f5e9
RenderImage: add renderSVGImageFile() (#6950)
ImageWidget: allow picking SVG versions of provided
PNG icons if available.
3 years ago
NiLuJe 6162c287e8
ReaderDictionary: Avoid an irritating refresh when dismissing the InfoMessage (#6934)
* ReaderDictionary: Don't refresh when dimissing the lookup info
InfoMessage

Re #6932

* Fix dict_largewindow in Landscape

Have to leave some room for the UI chrome
3 years ago
NiLuJe 493eab92c9
[RFC] Make default UI tapzones more generous (#6918)
* Top menu & bottom menu tapzones are now full-width, thanks to the now sane override system.
* A separate, extra tapzone was also created for each of them to provide a taller, but narrower tapzone extension (one that doesn't clash with the prev/next tapzones).
* The footer tapzone was made much taller.
3 years ago
Galunid 059ffc0040
Fix bad authentication handling in opds browser (#6942)
Fixes #6941.
3 years ago
John Beard 5bd055206d
Use Unicode minus in ButtonProgressWidget (#6939)
Change the text in the button from a hypen (-) to a
Unicode minus size (−, U+2212). This is the same width
as the + sign.

The NaturalLightWidget and FrontLightWidget controls
already use minus signs in this way.
3 years ago
jperon 8eeb010dc9
Paged documents: rework zoom options (#6885)
- Move zoom options from top menu to bottom config
- Add option to manually define zoom (relative to
  page width) and overlap (in percent)
- Add options to zoom to columns or rows, possibly
  with overlap. Add panning direction options when
  page forward in these modes
3 years ago
NiLuJe 960b2ae62a
OPDS*: Mangle Calibre feeds some more so that they don't confuse luxl/us (#6902)
By essentially dropping the whole XHTML block, instead of trying to salvage each and every tag one by one as we did before.

Also, as that's usually the result after broken parsing, handle nil URLs slightly better in the frontend, so that they get caught/reported properly instead of doing nothing and/or crashing half the time.
4 years ago
Jellby 5e3c554dd7 Hide non-linear fragments
Add option to hide (skip) non-linear fragments, only working
in 1-page mode. Tweaks mostly to footer, toc and skim code
to make it clear(er) which pages belong to linear or non-linear
fragments.
4 years ago
Jellby f892d4559f Fix typos 4 years ago
Jellby dba7112390
Footer: ensure minimum height for the in-fill in progress bar (#6878) 4 years ago
poire-z 314ac1973a Dict/Wiki: update footer on full refresh 4 years ago
jperon 43ba8a1173
Qrcode support (#6844)
2 new widgets:

- QRWidget, that's like an ImageWidget, but with a text property that will be converted to a QR code ;
- QRMessage, that's like an InfoMessage, but shows the message as QR code.
Moreover, it adds the ability to export QR codes to the text editor.

1 new plugin:

- Generate QR codes from clipboard

Changes to text editor plugin:

- Add the ability to export QR codes.
4 years ago
poire-z 74c1813a82 GestureDetector: add Tap interval on keyboard setting
Follow up to b90f6db8: allow specifying an other
value for tap interval when the keyboard is shown
(a good value for tap interval on reader and UI
elements might be too long on the keyboard, and
prevent typing fast).
4 years ago
NiLuJe dfe3502b91
ReaderStatistics: Data collection improvements (#6778)
* Update the data collection format & handler to make it much less tortuous
* Update the pagecount & resync the stats on document layout changes
* Update the database schema to allow doing most queries against a SQL view that rescales the collected data to be accurate regardless of document layout (thanks to @marek-g for the SQL magic ;)).
* Add a "reset stats for current book" entry in the list of reset options, one that won't horribly break stats in said book ;).
* Fixed a couple of resource (SQL connection) leaks (in ReaderStatistics:getCurrentBookStats & ReaderStatistics:getCurrentBookStats).
* Flush stats to the DB on periodical metadata saves.
* Minor cosmetic tweaks to the code
4 years ago
yparitcher fca89a816b
InfoMessage: accept options for lang and para direction (#6766) 4 years ago
Marek Gibek 20a413389c
[UX] Add Polish keyboard layout (#6762) 4 years ago
poire-z eb137d720e Font menu: show font names with their own font 4 years ago
georgeto 0fa45c21cf SortWidget: Fix moving of items over several positions
Previously items weren't actually moved, but swapped with the item
at their new position. That works well if you move an item for one position.
However, if you move an item over several positions, you won't get the
expected behaivor.
4 years ago
georgeto b668791c9c SortWidget: Toggle checked status when tapping on checkmark
In a checkable SortWidget a tap on a checkmark now toggles the checkmark,
instead of selecting the corresponding item.
4 years ago
georgeto ace3525ce1 SortWidget: Add support for checkmarks 4 years ago
NiLuJe d6cecc9ee3
Bump base to bring in a few fixes & cleanups (#6753)
* Bump base

https://github.com/koreader/koreader-base/pull/1205
https://github.com/koreader/koreader-base/pull/1206
https://github.com/koreader/koreader-base/pull/1207

* The strcoll shenanigans have been moved to ffi/util
4 years ago
poire-z a50774003f ImageViewer: allow saving current view as an image
And to make it the screensaver image.
Done on two-finger large diagonal tap on multitouch
devices (like regular ScreenShoter) as long-diagonal
swipe is reserved for panning.
Fallback to tap in the bottom left corner on
non-multitouch devices.
4 years ago
ezdiy 7a40b496fb
blitbuffer: fixups for base (#6714)
fixups for base bumped to https://github.com/koreader/koreader-base/pull/1201
otherwise tilecache breaks
4 years ago
poire-z b4214d3f16 Footnote popups: allow setting an absolute font size
In the "Set footnote popup font size", allow toggling
between setting a relative (to the document) font size
and setting an absolute font size (that won't change
with the document font size).
4 years ago
poire-z fca426c17c Footnote popups: CSS: add more styles for FB2 elements
Add styles for some more non-HTML FB2 tags, so MuPDF
can render them as expected.
4 years ago
poire-z 62d0cf5dfa Wikpedia EPUBs: fix failure saving some files
Since 8815cbe0 and getSafeFilename() taking additional
parameters, and :gsub() returning multiple values,
filesystem type wasn't really checked and replacements
were not ensured, so saving articles like "Portal:Stuff"
failed on VFAT devices as ':' wasn't replaced.
4 years ago
NiLuJe 99045b4311
Minor util & ffi/util cleanups (#6657) 4 years ago
NiLuJe 078b579081
More verbose debug logging around OPDS caching (#6653)
Re #6649
4 years ago
poire-z f15aa7103f
Allow following links and footnotes with keys (#6619)
Only with CreDocuments (as no way currently to highlight links
in PDFs).
Tab or Shift-Tab to select next or previous links.
Press to follow (or show footnote in popup, and in there Press
to follow), back to go back.
4 years ago
Galunid 0d501f2308
[chore] Fix a few typos (#6601) 4 years ago
poire-z 85a16d0064 Open with: add Text Editor plugin 4 years ago
poire-z cfa45f8d88 History: show last read date instead of file size
In classic and list display modes.
4 years ago
poire-z bafc52afd1 util: adds util.secondsToHour(), util.secondsToDate() 4 years ago
poire-z 5c1ccda314 FileChooser: allow traversing unreadable directories 4 years ago
poire-z 29d83b67d3 Text/HTML widgets: allow scrolling with the scrollbar
By tapping on or panning the scrollbar.
4 years ago
Martín Fernández b9ffb2e0d0
pocketbook: warmth lights support (#6531)
* also enables natural light controls for the emulator
4 years ago
Martín Fdez 9037a1f4f2 bump luajit-launcher and remove frontlightwidget leftovers 4 years ago
Frans de Jonge 49a5aa179b
[fix] Allow closing SortWidget (#6464)
For now, close on any keypress.

Cf. https://github.com/koreader/koreader/issues/6463
4 years ago
Gauthier f91a855dd7
add more media types to OPDS browser (#6450)
following #6443 i thought i would check the other types

application/x-mobi8-ebook is replaced by application/vnd.amazon.mobi8-ebook (see https://www.iana.org/assignments/media-types/application/vnd.amazon.mobi8-ebook)
application/djvu doesn't seem to be an official one. image/x-djvu was the previous one, and is replaced by image/vnd.djvu (https://www.iana.org/assignments/media-types/image/vnd.djvu)
4 years ago
Gauthier 072d960b68
Add additional media types to OPDS Browser (#6443)
* Add additional media types to OPDS Browser

The media types for CBZ and CBR (added in #5940) are deprecated, and replaced by `vnd.comicbook+zip` and `vnd.comicbook+rar`. In addition, many OPDS servers will use the actual media type of the file, ie `application/zip` and `application/x-rar-compressed`.

See here about the new `vnd` types:
- https://www.iana.org/assignments/media-types/application/vnd.comicbook+zip
- https://www.iana.org/assignments/media-types/application/vnd.comicbook-rar

* added vnd.rar also
4 years ago
NiLuJe 37a01100b7
Various Wi-Fi QoL improvements (#6424)
* Revamped most actions that require an internet connection to a new/fixed backend that allows forwarding the initial action and running it automatically once connected. (i.e., it'll allow you to set "Action when Wi-Fi is off" to "turn_on", and whatch stuff connect and do what you wanted automatically without having to re-click anywhere instead of showing you a Wi-Fi prompt and then not doing anything without any other feedback).
* Speaking of, fixed the "turn_on" beforeWifi action to, well, actually work. It's no longer marked as experimental.
* Consistently use "Wi-Fi" everywhere.
* On Kobo/Cervantes/Sony, implemented a "Kill Wi-Fi connection when inactive" system that will automatically disconnect from Wi-Fi after sustained *network* inactivity (i.e., you can keep reading, it'll eventually turn off on its own). This should be smart and flexible enough not to murder Wi-Fi while you need it, while still not keeping it uselessly on and murdering your battery.
(i.e., enable that + turn Wi-Fi on when off and enjoy never having to bother about Wi-Fi ever again).
* Made sending `NetworkConnected` / `NetworkDisconnected` events consistent (they were only being sent... sometimes, which made relying on 'em somewhat problematic).
* restoreWifiAsync is now only run when really needed (i.e., we no longer stomp on an existing working connection just for the hell of it).
* We no longer attempt to kill a bogus non-existent Wi-Fi connection when going to suspend, we only do it when it's actually needed.
* Every method of enabling Wi-Fi will now properly tear down Wi-Fi on failure, instead of leaving it in an undefined state.
* Fixed an issue in the fancy crash screen on Kobo/reMarkable that could sometime lead to the log excerpt being missing.
* Worked-around a number of sneaky issues related to low-level Wi-Fi/DHCP/DNS handling on Kobo (see the lengthy comments [below](https://github.com/koreader/koreader/pull/6424#issuecomment-663881059) for details). Fix #6421 
Incidentally, this should also fix the inconsistencies experienced re: Wi-Fi behavior in Nickel when toggling between KOReader and Nickel (use NM/KFMon, and run a current FW for best results).
* For developers, this involves various cleanups around NetworkMgr and NetworkListener. Documentation is in-line, above the concerned functions.
4 years ago
poire-z 1c49f817fd
Fix ConfigDialog's ButtonProgress Fine tune updating presets (#6433)
Witnessed with "L/R Margins": tapping on a button
sets the value to the preset table, by reference.
Tapping the -/+ fine tuning buttons was updating
these tables in-place, in effect modifying the presets.
4 years ago
Martín Fernández ca21d1401a SDL: use platform as model for desktop computers, report battery if available 4 years ago
poire-z cc653ef5b0 Style tweaks: limit EPUB/FB2 footnotes to these formats
Avoid conflicts having "In-page EPUB footnotes (smaller)"
affects FB2 documents that use "<a type=note>12</a>" which
would then get smaller if both tweaks are enabled (which
they are, by default).
Also switch "-cr-hint: strut-confined" from being set on "*"
to being set only on "body", now that it is inherited.
Footnote popups: add styles for some non-HTML FB2 tags,
so MuPDF can render them as expected.
4 years ago