Commit Graph

1103 Commits (ce624be8b83e880b1a81106a143e1440eeda4aab)

Author SHA1 Message Date
poire-z 5aab341ed0
Fix bottom menu item titles truncation (#6273)
Revert bit from #6267 , see https://github.com/koreader/koreader/pull/6267#issuecomment-644903608.
4 years ago
NiLuJe b23af97914
Fix partial HW dithered refreshes sometimes appearing to shift refreshed content (#6267)
* Fix HW dithered partial refreshes sometimes behaving as if the refreshed
content had moved a few pixels to the side...

Probably a kernel issue with the alignment fixup in the EPDC?

* Get rid of the legacy coordinates fixup

It shouldn't be necessary anymore.
And I'd rather fix the root cause, anyway.

* Bump base

(https://github.com/koreader/koreader-base/pull/1116)

* Missed a few DIVs in #6224
4 years ago
NiLuJe 1f994f8ede
Floor dimension computations (mul/div). (#6264)
* floor most every dimension computations involving MUL or DIV
Should avoid passing nonsensical floating point coordinates/dimensions
to the UI code.

* Update base

* https://github.com/koreader/koreader-base/pull/1113
* https://github.com/koreader/koreader-base/pull/1114
* https://github.com/koreader/koreader-base/pull/1115

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/230
https://github.com/koreader/android-luajit-launcher/pull/231
4 years ago
poire-z c1be488a11 Keyboard: better isolation of FR/ES/TR from EN base
dofile() wasn't enough to copy en_keyboard, as the references
to key popups would still be shared, and hacks to them (as
done by the FR keyboard) would be active on the EN keyboard.
Also, for the FR Keyboard:
- bring M key popup too when moving it to 2nd row.
- keep original ',' and '.' as on EN keyboard.
- add ';' instead of ',' as the added key, and let it have
  some key popup too, with keys helpful when CSS editing.
4 years ago
poire-z 886b3063e7
Style tweaks: adds "Book-specific tweak" menu item (#6244)
Allows editing a CSS snippet to be applied to this
book only, without the need to create and edit
a User style tweak.
Allows copying any other tweak CSS by just taping
on it (and pasting into this with Hold).
Limit User style tweaks nb of items per menu page
to 6 (like we try to do for other tweaks menus).
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
poire-z c65c33d75f
Statistics: some fixes, reordering and rewording (#6194)
- Fix wrong values for books opened (or first opened)
  from April 14th to May 20th: highlights and notes
  possibly being NULL was preventing nb of pages and
  last_open from being fetched.
- Re-order current book and all books stat items to some
  hopefully more sensible order.
- Some rewording for clarity.

KeyValuePage:
- Have value_overflow_align="right" only align right
  when value overflows 1/2 screen width, but not
  when only key overflows that.
- Show truncated text also on Tap when there is no
  callback.
4 years ago
poire-z 1e244d0358 [UX] Add fine tune for Word Spacing
Using DoubleSpinWidget.
Also keep SpinWidgets open on Apply.
Added little trick: if widget has been moved, close
bottom config menu on next Apply to show more of
the book.
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 6a98b2dce9
Text widgets, crengine: fix wrong vertical positioning (#6093)
Noticable with nastaliq arabic fonts.
bump crengine: fix wrong usage of Harfbuzz y_offset
Same in TextWidget and TextBoxWidget
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
Frans de Jonge aa4bcd8c22
Screenshot: use month number instead of name (#6062)
Fixes #6055.
4 years ago
poire-z abdaf6e18c
Non-Touch: fix hang on bottom config menu navigation (#6047) 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 1cb3be324a TextBoxWidget: fix infinite loop when very small width 4 years ago
Sergey Avseyev 7a0fe89ab7
Add DJVU MIME type to OPDS browser (#5982) 4 years ago
poire-z 8d8b8cd0f7 FB2 footnotes: some more tweaks
- Add some style tweaks to allow displaying FB2 end notes
  in-page too - and to allow showing them without a smaller
  font size.
- Show footnote number in bold in popup footnotes.
4 years ago
Jon d65f2c8367
Add additional MIME types to OPDS Browser (#5940)
added a few new mime types to the OPDS browser as a temporary workaround for #5478
4 years ago
poire-z 8502a96a6a
PathChooser: fetch 'show_hidden' setting on each use (#5923) 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
poire-z 7d7781b768 ConfirmBox: avoid overflowing screen height when long text
Just like what's been done previously for InfoMessage.
Also tweak 'other_buttons' option (not yet used anywhere)
to allow multiple rows of such other buttons.
4 years ago
poire-z 611c423727
TextBoxWidget: handle tabs and tabstops (#5870)
Don't display a tofu glyph when meeting a tab (none of
our fonts have a glyph for it).
New parameter: TextBoxWidget.tabstop_nb_space_width,
that defaults to 8, to ensure tabstops in the usual
left aligmnent (or right when para is RTL).
4 years ago
poire-z 95d18fe8d9
Statistics: revamp settings, add calendar settings (#5867)
Also adds options to remove statistics for books
with low reading duration (to clean up stats for
books just quickly browsed and not yet read).
Also adds TextWidget:getFontSizeToFitHeight()
even if we ended up not using it.
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
poire-z d22924c550 Footnote popups: CSS: remove some vertical margin
To fit more lines in the popup, and to look more like
how crengine epub.css would render the content.
Also normalize some horizontal margins.
4 years ago
Frans de Jonge 159fe03f47
Make dictionary margin depend on font size (#5865)
The default left margin on blockquote and dd is `40px`, but unfortunately that doesn't scale. rem is calculated using a hardcoded16px, so em or % is the best compromise in this case.

PS If we assume 1em = 16px then 40px is actually 2.5em, not 1em. This reduction in indentation is mainly intended for the benefit of smaller E Ink devices.

Closes <https://github.com/koreader/koreader/issues/5859>.
4 years ago
yparitcher 3e00e686b6
file count: Fixes #5843 (#5858) 4 years ago
poire-z 3ca46577bf
Statistics: new Calendar view (#5854)
Also fix RTL UI mirroring in OverlapGroup when
overlap_offset are used.
4 years ago
Frans de Jonge 0cdbd7bd38
[chore] Add translator comment for Alexandre Dumas (#5851)
The "author:" prefix looks like some kind of special search syntax, but it doesn't seem to be.
4 years ago
Frans de Jonge 1d3842ffa0
[fix] More accurate count in FileChooser (#5846)
Fixes <https://github.com/koreader/koreader/issues/5843>.
4 years ago
Frans de Jonge 6dfe65279c
[chore] FileChooser: "traditional" for loop for ~15-25% better performance (#5827)
Apparently there's less overhead this way.

See https://github.com/koreader/koreader/pull/5819 for context.
4 years ago
Sergey Avseyev 2420625be1
Add searchable version of flibusta OPDS catalog (#5826) 4 years ago
bateast fa94e6bbf6
Add “searchable” capabilities to OPDS catalogs (#5823)
OPDS catalogs may have search query capabilities. It is very usefull to find a
book in huge catalog, even when they are organized as directories. This commit
provides the possibility to add a %s mark in an OPS catalog URL, that would
trigger a search box when browsing the OPDS in koreader.
4 years ago
Frans de Jonge e0ce993c61
[fix] Don't waste time on dir/file attributes in subdirs (#5819)
An awful lot of effort was wasted getting attributes just for getting a count of the number of files/directories in subdirectories. Getting the count is pretty fast. Getting all the attributes is not, and in this context we don't even use the attributes.

See <https://www.mobileread.com/forums/showthread.php?t=327085> and <https://gitter.im/koreader/koreader?at=5e3ac3b9e8a838355918ba13> for discussion.
4 years ago
NiLuJe 80c1e5290c
File search & BookInfo: Don't traverse hidden folders if we're not showing them (#5816)
* File search: Don't traverse hidden folders if we're not showing them

Re https://www.mobileread.com/forums/showpost.php?p=3949194&postcount=21

* Ignore macOS resource forks, too.

* Apply the same logic to the BookInfo directory walker

* And never ever show resource forks in the FM, either.
4 years ago
NiLuJe 3c2353e439
Stop using the "calibre catalog" wording (#5813)
It's extremely confusing, as it has nothing to do with calibre catalogs,
which are actual things the user can generate manually.

What it's using instead is actually a metadata cache in a flatfile db
that's always present, as long as "Send To Device" was used to upload
the content to the device.
4 years ago
NiLuJe 5499d85cbc
Allow running shell scripts from the FileManager/Favorites (#5804)
* Allow running Shell/Python scripts from the FM

* Show an InfoMessage before/after running the script

Since we're blocking the UI ;).

* Allow running scripts from the favorites menu, too.
4 years ago
Mustafa Ali Mutlu 5724971466 add turkish f keyboard layout (#5795) 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
poire-z 2d02ade498 Footnote popups: drop justification if RTL content
MuPDF does not handle "text-align: justify" correctly on
RTL text: the last line is left-aligned, but it should be
right-aligned.
Not using justify makes it correctly right align the whole
text.
4 years ago
poire-z c449d0ad1e [UI] Render metadata text with book language
Gives the book language to Text*Widget (and XText) when
drawing title, authors and other metadata text.
Might be needed to properly display a Japanese book title
when the UI language is Chinese.
4 years ago
WaseemAlkurdi c8b3942bf4 [UX] Keyboard for Arabic and languages with Arabic script (#5569) 4 years ago
poire-z 605f6026bb
TextWidget: adds getFittedText() (#5776)
bump base for xtext:getText().
4 years ago
poire-z e3b4116f4d opds: add one public server (Gallica) 4 years ago
poire-z e172926af5 LoginDialog: fix crash on focus switch (#5749) 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
poire-z a31abf79de TextBoxWidget: fix some truncation ellipsis issues
Ellipsis was sometimes not displayed when text is right aligned,
because width was not updated with ellipsis size.
bump base/xtext: fix truncation ellipsis position in bidi text
so it stays nearer to previous logical order char, instead of
sometimes being thrown away to start or end of line.
4 years ago
poire-z 378dfdc1df ConfirmBox: prevent lower widgets from responding to tap 4 years ago
poire-z a628714f51 [RTL UI] Bidi wrapping tweaks
- Alias everything to Bidi.nowrap() when in LTR UI, as using
  LTR isolates seems uneeded when already LTR.
- Better wrapping of RTL filename by using auto direction and
  LTR-isolating only the suffix so it's always on a side.
- menu.lua: handle bidi_wrap_func outside getMenuText(), which
  may be used in other contexts.
- Add BD.filepath() and BD.dirpath()
4 years ago
poire-z d89317e820 bump crengine, fribidi, xtext
- bump crengine: (Upstream) DocX: fix paragraphs with single hyperlink
- bump fribidi to 1.0.8 (for nested isolates fix)
- xtext.makeLine(): return no_allowed_break_met=true when that
  happens, so we know the line breaks inside a word.

TextBoxWidget: add forgotten property (when use_xtext=true) when no
line break opportunity was found: has_split_inside_word=true.
(Only used by CoverBrowser Mosaic mode to make nicer text covers
by reducing font size when that happens.)
4 years ago
poire-z a838a6eb1d TextBoxWidget: fix crash when empty last line and alignment center/right (#5691) 4 years ago
poire-z ea67b9be77 TextBoxWidget: fix crash on hold after end of text (#5689) 4 years ago
Robert e26ad2b287 [UX] Adds DoubleSpinWidget (#5679)
Replaces HyphenationLimits widget by making it more generic.
4 years ago
poire-z 55f3575a10
UI font rendering: use available bold fonts for bold (#5675)
A few fixes and enhancement related to bold text:
- When using bold=true with a regular font, use its bold
  variant if one exists (can be prevented by manually
  adding a setting: "use_bold_font_for_bold" = false).
- When using a bold font without bold=true, promote bold
  to true, so fallback fonts are drawn bold too.
- Whether using a bold font, or using bold=true, ensure
  fallback fonts are drawn bold, with their available bold
  variant if one exists, or with synthetized bold.
- When using a bold variant of a fallback font, keep using
  the regular variant as another fallback (as bold fonts
  may contain less glyphs than their regular counterpart).
- Allow providing bold=Font.FORCE_SYNTHETIZED_BOLD to
  get synth bold even when a bold font exists (might be
  interesting to get text in bold the same width as the
  same text non-bold).
- Use the font realname in the key when caching glyphs,
  instead of our aliases (cfont, infont...) to avoid
  duplication and wasting memory.
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 36ce82d8c2 [RTL UI] update low-level widgets to handle mirroring
These updated low-level widgets will handle 90%
of the needed UI mirroring.
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
poire-z 3c280f6e5f KeyValuePage: proper padding between key and value
Use some HorizontalSpan for padding between key and value,
instead of prepending a space to the value text (which
won't work as expected if value text is RTL, as it would
be put on the right side of screen).
5 years ago
poire-z ef08f50336 DictQuickLookup: properly truncate title text 5 years ago
poire-z e9032a2b2a TextBoxWidget: slightly better cursor positionning in RTL text 5 years ago
poire-z 588c35967f TextBoxWidget: minor optimisations
It's best to do all free'ing via :free(), and not :onCloseWidget(),
as :free() is more logically called in cascade when upper widgets
are closed.
5 years ago
Mihai Vasiliu 2541440bb8 [UX] Add Romanian keyboard layout (#5660)
This adds a new separate Romanian keyboard layout, with popup support.

- Functional buttons are translated.
- Pages 5&6 contain 3 groups of characters (I tried my best to group them logically):
  - On the left: traditional Romanian cyrillic pre-1850s
  - On the middle latinised forms from 1850s onwards
  - On the right modern diacritics from 1900s to today
- Pages 7&8 add only large double quotes and section/paragraph mark.
- Popups are only avalable for most common diacritics. Swipe up for circumflex, swipe down for breve.

I can really call this the most complete though-the-ages Romanian keyboard. :)
5 years ago
poire-z a1247160a1 TextWidget: minor optimisations
Also fix possible crash with NumberPickerWidget.
5 years ago
Robert b0738960df Dictionary: add menu item to set font size (#5647) 5 years ago
poire-z 397211644d Keyboard: properly handle keyboard layout height change
The japanese keyboard being taller than the others, when
switching to/from it from/to another layout:
- re-init InputDialog for proper sizing and positionning
- refresh the whole screen, to remove any trace of
  a previous taller keyboard

Also add calls to :free() here and there to free keyboard
keys' TextWidgets' XText C objects without waiting for GC.
5 years ago
poire-z 13fa6d962c Korean keyboard: unwrap InputText on layout change
The korean keyboard wraps InputText and overrides some
of its methods to process input in some specific way.
When switching to another keyboard layout, the original
methods need to be restored.
5 years ago
NiLuJe 4778d3db3b
[RFC] Switch remaining keyboard icons to glyphs (#5639)
* Switch the last few remaining icons to true glyphs
(Del/Backspace & Enter).
Also, allow a glyph to be rendered in (fake) bold, and use it for Enter.
* Update fonts
Pickup the tweaked nerdfonts for the backspace symbol
5 years ago
Robert 03fda96041 [fix] Empty directory path and crash on TextWidget (#5606) 5 years ago
Frans de Jonge 7775233688
[fix] Prevent xtext crash by not freeing TextWidget prematurely (#5616)
Fixes <https://github.com/koreader/koreader/issues/5614>.
5 years ago
Frans de Jonge 15fe0fef07
[chore] Extract Cyrillic/Russian keyboard (#5610)
Follow-up to #5583.

* Add separate Cyrillic/Russian keyboard

* And remove that from English

* Update French keyboard (is easy)

* Remove yahzhert, that was just a double of QWERTY

* Update Spanish keyboard

* Reduce Japanese to 4 layers and add globe

* Reduce Korean to 4 layers

* Reduce Greek to 8 layers
5 years ago
Frans de Jonge 67b57834da
[lang] Minor touchups (#5611) 5 years ago
yparitcher 5e8d1227ef [feat, UX] Pick keyboard layout from keyboard (#5583)
* Tap goes to next activated keyboard.
* Hold opens a selection popup.
5 years ago
poire-z 89c0bd0886 ConfigDialog: allow larger toggle title text
Avoid a few truncated text, as some fit when allowed
to bite a bit on the (large) left padding.
5 years ago
poire-z dc8696bd34 TextBoxWidget: add new properties, use them in Menu
- height_adjust: if true, reduce height to a multiple of
  line_height (for nicer centering)
- height_overflow_show_ellipsis: if height overflow, append
  ellipsis to last shown line
(Implemented in both use_xtext and legacy code path.)

Use them in Menu.lua to clean up/shorten the code used for multiline
menu items by delegating the work to TextBoxWidget, or using
TextWidget when we end up needing only a single line.
5 years ago
poire-z e699a1ee22 TextBoxWidget: use xtext for text shaping
Alternative code to size, split lines and draw text with
the help of the xtext Lua C module.
Enabled by default (can be disabled via an added menu
item in "Developer options").

New properties can be specified by calling widgets, only
used when xtext is used:
- lang: use specified language instead of the UI language
- para_direction_rtl: true/false to override the default
  direction for the UI language
- auto_para_direction: detect direction of each paragraph
  in text
- alignment_strict: prevent the inversion of the specified
  alignment= that is done when a paragraph direction is
  set or detected as RTL.

Also: fix possible memory leak (present even when not using xtext)
by calling :free() in onCloseWidget() like it's done in ImageWidget.
5 years ago
poire-z 22e3e34c45 TextWidget: use xtext for text shaping
Alternative code to size and draw text with the help
of the xtext Lua C module.
Enabled by default (can be disabled via an added menu
item in "Developer options").

New properties can be specified by calling widgets, only
used when xtext is used:
- lang: use specified language instead of the UI language
- para_direction_rtl: true/false to override the default
  direction for the UI language
- auto_para_direction: detect direction of each paragraph
  in text
5 years ago
poire-z 272d8857a2 TextBoxWidget: fix two minor bugs 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
Frans de Jonge 2855fdfdac
[feat] Support callback function in VirtualKeyPopup (#5588)
Required for <https://github.com/koreader/koreader/pull/5583>.
5 years ago
Frans de Jonge 425c808c18
[UX] Switch ButtonTable to COLOR_GRAY (#5585)
Same as the menu.

See <https://github.com/koreader/koreader/pull/5584>.
5 years ago
Robert 98555908c8 [fix] Enable rewind button in sort widget (#5579)
See: #5578
Close: #5578
5 years ago
Robert 2ae91ac6f6 [fix] Prevent crash on local calibre OPDS server (#5572)
Close: #5476 
- Prevent segmentation fault when we enter incorrect address of calibre opds server (eg http://192.168.1.1:8080/ instead of proper http://192.168.1.1:8080/opds
- prevent unnecessary infos in Gutenberg OPDS
5 years ago
poire-z 0885e9947d Keyboard: avoid additional key stroke on hold release (#5573) 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 eb8795e4e0
ButtonTable: taller buttons for easier tap (#5554) 5 years ago
Robert 7b6a3f3cb2 [fix] Handle max_width in time widget (#5540)
Set max_width like in #5503
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 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
Robert c7ecd08d9d Menu: new algorithm for multi-lines items (#5496)
(used by bookmarks list and classic file browser)
When text is too long or line too tall:
first: we try to decrease the number of lines (eg from 3 to 2 and from 2 to 1 line)
second: when 1 line is too tall, we try to decrease font size (-1)
And at the end we try to add or remove chars to better fit text.
5 years ago
poire-z f05e62c1fb
TextWidget: small refactoring, better handle max_width (#5503)
Lots of code was doing some renderText calls to get the size
of some text string, and truncate it to some width if needed,
with or without an added ellipsis, before instantiating
a TextWidget with that tweaked text string.

This PR fixes/adds some properties and methods to TextWidget
so all that can be done by it. It makes the calling code
simpler, as they don't need to use RenderText directly.
(Additionally, when we go at using Harfbuzz for text rendering,
we'll just have to update or replace textwidget.lua without
the need to update any higher level code.)

Also:
- RenderText: removed the space added by truncateTextByWidth
  after the ellipsis, as it doesn't feel needed, and break
  right alignment of the ellipsis with other texts.
- KeyValuePage: fix some subtle size and alignment issues.
- NumberPickerWidget: fix font size (provided font size was
  not used)
5 years ago
Nick ef22e85469 UI Changes (#5508)
* Changed File Browser text

KOReader looks nicer than KOReader File Browser,

* Remove the "page x of x" if only one page

Removes it from the bottom of the file browser

* Remove the "page x of x" if only one page

Removes it from the top menu, if there is only one page, why show page 1 of 1

* Renamed ~ to Home

Since the file browser can be considered "Home"

* Added 12 hour time option

Also tweaked the charging icon,  looks nicer than +, tweaked seperator between time and battery, - instead of @
5 years ago
Nick daacb84114 [UX] Add timeout to Wi-Fi connected message (#5514)
Resolves #5501
5 years ago
Frans de Jonge 761f332d47
[doc] Update InputDialog example (#5510)
Make it work out of the box, add some cross-references, and update a few minor things.

In response to @dontcrash.

Cf. <https://gitter.im/koreader/koreader?at=5dac431978e4974ace8c4213>.
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 5209493ba8 [UX] Option to show progress bar at the bottom of the screen (#5442) 5 years ago
Max CW a7ff9ba0dc ImageViewer: start with image fullscreen with no buttons shown (#5446)
Tap any part of screen to toggle bottom buttons visibility.
Swipe south to quickly close it (as long as image is scaled
to fit, and there's no need for panning).
5 years ago
Robert 7badb67e3d Fix crash on book status change (#5453) 5 years ago
Robert 056a4f9129 Fix: Crash toggleswitch when args are empty (#5438)
Fix: #5434
5 years ago
Frans de Jonge f7861bc1eb
[feat] Add haptic feedback (#5380)
References <https://github.com/koreader/koreader/issues/5374>.
5 years ago
Robert a934d2d52e [UX] Add fine tune for zoom(dpi) and font size (#5432)
Close: #5312
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
Robert 3de3ea04ff [UX] Better align buttonprogress in configdialog (#5427)
Similar to #5420
5 years ago
Robert 67abf9a26a Better align toggleswitch in configdialog (#5420) 5 years ago
Robert 02218cb9e2 [UX] Add fine tune in contrast (#5413) 5 years ago
yparitcher 31b9f78384 [UX] Add Hebrew keyboard (#5414) 5 years ago
Robert 28e2e664b1 fix: Truncate text in spinwidget (#5393) 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 b7d464ae4b Set screenshot output folder (#5382)
Close: #4230
5 years ago
Robert 54568d4dcd [UX] Add fine tune in line spacing (#5375)
See https://github.com/koreader/koreader/issues/5312#issuecomment-528506421

Progress widget has a new extra button ⋮ that triggers SpinWidget.
5 years ago
Robert 9163a85b3c Messages in numberpicker widget (#5353)
See: #5342
5 years ago
Frans de Jonge 17e437dbd0
[UX] Allow keyboard layout selection (#5318)
Fixes <https://github.com/koreader/koreader/issues/3998>.

This isn't quite what I want but I've been letting this slip for
too long due to fancier keyboard interaction concepts.
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
NiLuJe d66cf7ab61 [fix] Allow setting a fine-tuned font size as default (#5306)
And a couple bugfix this unearthed:

* Always set the default as the *current* value, no matter what (by chance, this was not an issue for margins).
* Don't crash on the hold gesture in the -/+ buttons for the horizontal margins (regression since #5303).
5 years ago
Frans de Jonge 4cdc3ab99b
[feat, plugin] Add AutoTurn (#5295)
Fixes <https://github.com/koreader/koreader/issues/3019>.
5 years ago
Robert b038fa3046 [UX] Add fine tune buttons to horizontal margins (#5303)
Similar to top and bottom margins I add fine tune buttons to L/R margins.
5 years ago
Frans de Jonge 0b62fc56ee
[doc] Add NumberPickerWidget developer docs (#5298) 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 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 2c555830f9
[feat, i18n] Implement ngettext (#5257)
Fixes <https://github.com/koreader/koreader/issues/5249>.

See https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html and https://www.gnu.org/software/gettext/manual/html_node/Translating-plural-forms.html for more information.

Usage:
```lua
local T = ffiUtil.template
local _ = require("gettext")
local N_ = _.ngettext

local items_string = T(N_("1 item", "%1 items", num_items), num_items)
```
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
Robert dc6d4085ea Fix: Unable to hold top right corner in FileManager (#5248)
Close: #5247
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
Edoardo Putti 0906b69c06 [fix] Handle OPDS catalog responses accordingly (#5241)
- handle moved permanently HTTP 301
- handle authentication required HTTP 401
- handle authentication errors HTTP 403
- handle catalog not found HTTP 404
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 c57beada27 [chore] Remove Polish keyboard (#5223) 5 years ago
NiLuJe 9e4a7797c9
Honor the alpha channel in our icon for the About popup (#5208)
It ends up with a black background otherwise.
(Old regression that dates back to my alpha shenanigans a few months
ago)
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 a10fc83a4a Fix: hold bottom left corner doesn't work properly (#5177) 5 years ago
Robert 1743c0ca23 [UX] Extend the touch zone for up button in touch menu (#5175)
See: #5155
Close: #5155
5 years ago
Robert a38ba01b6e [chore] SpinWidget default_text instead of defaults_text (#5153) 5 years ago
Robert b71d0a19b8 [UX] Set font size for menu items (#5146)
Ref: #4757
This PR add option to changing the font size of items in menu widget (filemanger in classic mode, TOC) in single line mode.
Close: #4757
5 years ago
Robert 1f6af80817 [feat] Make gesture intervals configurable (#5138)
Discussion: #4842
Close: #4842
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
NiLuJe 2e7a910178
Some BookStatus QoL tweaks (#5100)
* Make the cover thumbnail respect the cover's AR in the widget
* Add a "Mark as read/unread" button in the FM's longpress menu.
* Make sure the cover_info cache is wiped if necessary (sidecar purge/BookInfo cache clear).
5 years ago
poire-z 03bbba249a
MovableContainer: avoid refresh glitches on close (#5094)
The contained widget may not have integer position/dimen
(which should probably be fixed in those that don't ensure
that), and our maths could eventually make them even more
shifted by fractional parts.
In the end, when closing the widget, the refresh code may
miss painting/cleaning 1px and leave a border of the widget
on the screen.
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 fca51757af
[fix] OPDS crash with fewer than 4 servers (#5092)
Regression introduced in <https://github.com/koreader/koreader/pull/4249>.

Fixes <https://github.com/koreader/koreader/issues/5091>.
5 years ago
limerainne 53b6e3d018 [i18n] Add Korean keyboard (2-beolsik) (#5053) 5 years ago
limerainne 98b681bb4f [fix] InputText: fix ignoring first char when carat not in front of hint (#5052) 5 years ago
poire-z 34e6f41e05
cre: fix 2 footnotes issues, bump crengine (#5031)
- Popup footnotes: workaround strange behaviour of MuPDF
  which is adding some unwanted margin above elements
  with an "id=" attribute.
- In-page footnotes: also remove any left and right margin,
  to keep footnotes aligned with the main text.
  Also add 2 classnames (witnessed in quite a few recent
  french books) to the list of classic classnames.
- Also bump crengine: CSS: fix parsing of multi classnames
  and attributes selectors
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
Frans de Jonge 2968f558eb
[fix, UX] Ignore first hold release when keyboard opened with hold (#5011)
Fixes #4902.
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
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
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
NiLuJe f63ca005c6 [fix] Update AutoWarmth state on resume (#4901)
Regression since #4871
Fix #4895

* Hide the "Configure" button in the FL/NL widget on devices where it
won't do anything

(i.e., those w/ a NL mixer).
5 years ago
Frans de Jonge 021f1d9107
[fix] VirtualKeyboard: always fall back to en (like it used to) (#4900)
Fixes #4899.
5 years ago
Frans de Jonge 4ba826ca3c
[fix] VirtualKeyPopup close refresh (#4897)
See https://github.com/koreader/koreader/pull/4891#issuecomment-481866246
5 years ago
Frans de Jonge 3f59dee721
[UX] VirtualKeyPopup: variable size (#4892)
This makes the code a lot more complex, but it looks much better.
5 years ago
Frans de Jonge fd50dc34a6
[UX] VirtualKeyPopup: close on hold release (#4891)
As suggested by @poire-z.
5 years ago
Frans de Jonge 80953b5c4c
[UX] Keyboard: add @ and A diacritics (#4889)
Also rename std to en_keyboard.
5 years ago
Frans de Jonge 69e3830bc1
[UX] VirtualKeyPopup: respond to hold & pan release (#4887)
As suggested by @poire-z in https://github.com/koreader/koreader/pull/4886#discussion_r273569802

This is actually much better than before.

It subtly changes the behavior of every key this way, but I don't think that's a bad thing.
5 years ago
Frans de Jonge 23f903274a
[UX] Keyboard character selection popup (#4886) 5 years ago
Frans de Jonge 2760b98582
[UX] Add keyboard swipes (#4884)
Only the `e` and `E` are added in this initial commit.
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
Frans de Jonge 22db71c075
[fix] OPDS last-modified check (#4874)
Fixes #4873. Unfortunately this will introduce a slight delay but I don't see any other quick & reasonable solution.
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 0a314e3ab8
[fix] widget/scrollhtmlwidget: default_font_size same as infofont and Screen:scaleBySize() (#4864)
Otherwise it's:

1. Too small on virtually all devices due to a lack of scaling.
2. Unusably small by default.

It's currently scaled by the callers (dictquicklookup & footnotewidget) based on other properties, but you shouldn't have to change it from the default just to get something usable. ;-)
5 years ago
poire-z 8f019b8183 Night mode: keep some images non-inverted
Have the code pre-invert some images when in night mode,
so they get inverted back to normal by night mode.
This will allow images to be displayed normally in
the following contexts:
- images in credocument pages
- long-press on images in credocument viewed in ImageViewer
- cover thumbnails in File browser and History
- full size covers when viewed in ImageViewer
- images in Wikipedia lookup results
5 years ago
poire-z e2b4099228 Footnote popups: fix link unhighlight when closing with keys 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
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