2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
Commit Graph

5955 Commits

Author SHA1 Message Date
hius07
963aa9ac7c filemanagerhistory: fix update list after deleting a file 2024-08-31 15:18:18 +02:00
hius07
ee5a4169d1 webdavapi: fix 'resourcetype' property check 2024-08-31 15:18:18 +02:00
hius07
84ed68ba82 inputtext: fix deleting a word by backspace swipe north 2024-08-31 15:18:18 +02:00
Rowan Decker
60e0e3ef45
Add color highlight menu (#11044) 2024-08-30 22:10:43 +02:00
NiLuJe
ca71bb2917
Input: Ignore ABS_X, ABS_Y & ABS_PRESSURE for snow_protocol (#12427)
On Monza, the lift frame can report these for *multiple contacts* without an id or a slot, which is super-duper invalid -_-".

(And we have ABS_MT_POSITION_X & ABS_MT_POSITION_Y for the "saner" frames, plus these devices generally don't support pens, so we don't make use of pressure).

(Also, switched to a dedicated handler like for the phoenix quirks, to avoid bogging down the standard handler with hacks for broken drivers).

Fix #11910
2024-08-30 16:04:28 +02:00
NiLuJe
a486acf48b
FileManagerSetDefaults: Handle strings that we default to nil (#12433)
The actual defaults table is a hash, so we have no way of salvaging it from there without using a custom NULL type or another kind of sentinel value.
But since everything that actually *uses* the offending defaults expects a nil, don't rock the boat, and just fix the Advanced Settings widget to be able to deal with it.

Fix #11679
Regression since #9546
2024-08-30 16:02:24 +02:00
poire-z
d51179690d
PageBrowser: fix drawing of thicker thumbnail frame on tap (#12432)
Bottom and right edges were not drawn since some
recent FrameContainer tweak.
2024-08-30 14:40:14 +02:00
NiLuJe
7e52c15de2
FileManager: Handle the FlushSettings event (#12425)
It's used on Android when we're murdered by the task switcher, and when doing an OTA update.

Fix #12124
2024-08-29 11:28:16 +02:00
NiLuJe
5fc5386e87 ReadTimer: Don't blindly repaint the footer in update_status_bars
Send a dedicated event that will let ReaderFooter check if we actually have anything relevant to display, and will do the usual "should I repaint/refresh" checks ;).

Fix #12323
Regression since #12002
2024-08-28 23:53:38 +02:00
NiLuJe
a86271b8f1 ReaderFooter: Use maybeUpdateFooter in onBookMetadataChanged
I'm not sure that one could ever have been truly problematic, but let's
be cautious ;).
2024-08-28 23:53:38 +02:00
jonnyl2
f3005906d4
Readerfont: current font on top in menu; new fonts from current session on top in font test doc (#12410)
* Move down call setupFaceMenuTable(); list current font on top in menu if sorted by recently selected.

* New fonts from current session listed on top in fonts test documents; small wording changes
2024-08-26 22:51:29 +02:00
David
dd9f96eddb
ReaderFooter: fix page-turn item (#12388)
Account for per-document reading order direction adjustments.
2024-08-25 22:44:19 +02:00
poire-z
96312bfa10 HtmlBoxWidget: help MuPDF with block elements it doesn't know
MuPDF's own stylesheet is incomplete, and doesn't specify that
a few common (and uncommon) elements are display:block, so it
would consider them inline, and render them badly (MuPDF also
doesn't handle well <BR/> inside inline elements, so this
fixes <br/> ones in these elements).
Fix this in HtmlBoxWidget so it solves any issue in HTML
dict and popup footnote.
For popup footnotes, also include crengine internal block
elements, as we may indeed get them in the HTML content.
2024-08-25 22:39:31 +02:00
poire-z
837b32906a TextBoxWidget: fix handling of Home/End keys on a scrollable edit box 2024-08-25 22:39:31 +02:00
poire-z
9f308399f9 Book style tweak editor: fix double notification on discard
Avoid two identical stacked notifications "Book tweak not modified"
after Close + Discard when text was modified.
2024-08-25 22:39:31 +02:00
poire-z
db8786f058 ReaderRolling: fix batched notifications sometimes not shown
When a profile changes a few settings (ie. font), a few notifications
may be stacked, before the single rerendering happens. If that rendering
takes some time, the notifications' timeout may close them as soon
as it is done, before they get a chance to be painted/refreshed.
So, delay a bit more that rerendering to be sure the notifications
are shown.
2024-08-25 22:39:31 +02:00
NiLuJe
9cd305177e
FocusManager: Fix focus_flags check in moveFocusTo, and deal with the fallout (#12361)
* FocusManager: Fix `focus_flags` check in `moveFocusTo` (0 is truthy in Lua, can't do AND checks like in C ;).)
* FileManager+FileChooser: Pass our custom title bar directly to FileChooser (which also means we can now use FC's FocusManager layout directly).
* FileChooser/Menu: Get rid of the weird `outer_title_bar` hack, and simply take a `custom_title_bar` pointer to an actual TitleBar instance instead.
* FileManager/Menu/ListMenu/CoverMenu: Fix content height computations in `_recalculateDimen` (all the non-FM cases were including an old and now unused padding value, `self.header_padding`, leading to more blank space at the bottom than necessary, and, worse, leading to different item heights between FM views, possibly leading to unnecessary thumbnail scaling !)
* ButtonDialog: Proper focus management when the ButtonTable is wrapped in a ScrollableContainer.
* ConfigDialog: Implement a stupid workaround for a weird FocusManager issue when going back from `[⋮]` buttons.
* ConfigDialog: Don't move the visual focus in `update` (i.e., we use `NOT_FOCUS` now that it works as intended).
* DictQuickLookup: Ensures the `Menu` key bind does the exact same thing as the hamburger icon.
* DictQuickLookup: Ensure we refocus after having mangled the FocusManager layout (prevents an old focus highlight from lingering on the wrong button).
* FileChooser: Stop flagging it as no_title, because it is *never* without a title. (This behavior was a remnant of the previous FM-specific title bar hacks, which are no longer a thing).
* FileChooser: Stop calling `mergeTitleBarIntoLayout` twice in `updateItems`. We already call Menu's, which handles it. (Prevents the title bar from being added twice to the FocusManager layout).
* FocusManager: Relax the `Unfocus` checks in `moveFocusTo` to ensure we *always* unfocus something (if unfocusing was requested), even if we have to blast the whole widget tree to do so. This ensures callers that mangle self.layout can expect things to work after calling it regardless of how borked the current focus is.
* FocusManager: Allow passing `focus_flags` to `refocusWidget`, so that it can be forwarded to the internal `moveFocusTo` call.
* FocusManager: The above also allows us to enforce a default that ensures we do *not* send a Focus event on Touch devices, even if they have the hasDPad devcap. This essentially restores the previous/current behavior of not showing the visual feedback from such focus "events" sent programmatically, given the `focus_flags` check fix at the root of this PR ;).
* InputDialog: Fix numerous issues relating to double/ghost instances of both InputText and VirtualKeyboard, ensuring we only ever have a single InputText & VK instance live.
* InputDialog: Make sure every way we have of hiding the VK play nice together, especially when the `toggleKeyboard` button (shown w/ `add_nav_bar`) is at play. And doubly so when we're `fullscreen`, as hiding the VK implies resizing the widget.
* InputText: Make sure we're flagged as in-focus when tapping inside the text field.
* InputText: Make sure we don't attempt to show an already-visible VK in the custom `hasDPad` `onFocus` handler.
* Menu: Get rid of an old and no longer used (nor meaningful) hack in `onFocus` about the initial/programmatically-sent Focus event.
* Menu: Get rid of the unused `header_padding` field mentioned earlier in the FM/FC fixes.
* Menu: Use `FOCUS_ONLY_ON_NT` in the explicit `moveFocusTo` call in `updatePageInfo`, so as to keep the current behavior of not showing the visual feedback of this focus on Touch devices.
* Menu: Make sure *all* the `moveFocusTo` calls are gated behind the `hasDPad` devcap (previously, that was only the case for `updatePageInfo`, but not `mergeTitleBarIntoLayout` (which is called by `updateItems`).
* MultiInputDialog: Actively get rid of the InputText & VK instances from the base class's constructor that we do not use.
* MultiInputDialog: Ensure the FocusManager layout is *slightly* less broken (password fields can still be a bit weird, though).
* TextViewer: Get rid of the unfocus -> layout mangling -> refocus hack now that `refocusWidget` handles this case sanely.
* VirtualKeyboard: Notify our parent InputDialog when we get closed, so it can act accordingly (e.g., resize itself when `fullscreen`).
* ScrollableContainer: Implement the necessary machinery for focus handling inside ButtonDialog (specifically, when scrolling via PgUp/PgDwn).
* TextEditor: Given the above fixes, the plugin is no longer disabled on non-touch devices.
* ReaderBookMark: Make sure we request a full refresh when closing the "Edit note" dialog, as CRe highlights may extend past its dimensions, and if it's closed separately from VK, the refresh would have been limited to its own dimensions, leaving a neat InputDialog-sized hole in the highlights ;).
2024-08-25 19:34:31 +02:00
David
4910afffdd
Add numerical key_codes to event_map on kindle 3 (#12358) 2024-08-24 14:17:40 +02:00
Frédéric Brière
39fa008e21
Bookmarks: refresh list entry when closing Bookmark details dialog with X (#12390)
Also: refresh dogear state for current page when closing Page browser
or Book map, as we may have toggled bookmark on it.
2024-08-21 23:46:51 +02:00
hius07
9c001a660a
PDF: no "Contrast set to" notification on opening (#12391) 2024-08-21 20:57:22 +03:00
hius07
64094435f2
filemanagercollection: fix context menu (#12383) 2024-08-21 20:55:02 +03:00
hius07
415ce40f84
Touch menu: always go up to correct parent page (#12378) 2024-08-21 20:53:45 +03:00
David
698fc35c3f
Minor keyboard corrections (#12372) 2024-08-20 12:01:27 +02:00
charrarr
ab47bd10a4
Screensaver: add option to rotate to fit screen (#12366) 2024-08-19 20:57:02 +02:00
hius07
ed9cde8feb
UX minor fixes (#12374) 2024-08-19 08:10:14 +03:00
hius07
f0c9a642d1
ReaderStatus, Book status widget: cleanup (#12343) 2024-08-19 08:05:19 +03:00
charrarr
91c15d5277
ReaderFont: display preview of italic-only fonts in italic (#12351)
In font selection menus, ask creengine for italic versions
of fonts if there's no regular version to preview.
Also prevents a crash when a font can't be previewed in
the font family menu.
2024-08-18 09:28:23 +02:00
NiLuJe
cfd42254ac SortWidget: Preserve the cancel's button highlight when changing its icon
setIcon recreates the frame without preserving the current frame's
invert status (which is arguably a bug, but button is so ubuquitous that
I dare not touch that behavior...).

So, instead, rely on the rarely used preselect flag to preserve it.
2024-08-17 20:10:08 +02:00
NiLuJe
c21ad4edcc SortWidget: Cleaner FocusManager behavior
With less code, yay.
2024-08-17 20:10:08 +02:00
NiLuJe
0ae11f8cf4 ScreenSaver: Fix comment typo
Link to the right issue ;).
Typo dates back to the original commit, way back in #5928
2024-08-17 20:10:08 +02:00
NiLuJe
ca546f831d SortWidget: Reset focus on page changes
A bit clunky because I have no idea how FocusManager works,
but that works *mostly* sensibly...

Fix #12342
2024-08-17 20:10:08 +02:00
NiLuJe
89b92b6768 FootnoteWidget: Flag as covers_footer
When footnotes are displayed as "popups", they're displayed over ReaderUI
in a BottomContainer, so they pretty much always cover the footer ;).

(i.e., they're really really not popups *at all* :D).

This prevents spurious status bar auto-refreshes.

Re #12323
2024-08-17 20:10:08 +02:00
David
49a991e82f
[TextViewer] Add hamburger menu to FocusManager and Menu key (#12365) 2024-08-17 17:04:44 +02:00
Benoit Pierre
c2d58e525e
czmq & libzmq: update to 4.2.1 & 4.3.5 respectively (#12350) 2024-08-17 17:02:56 +02:00
hius07
20ac3c3489
Dispatcher: minor wording fixes (#12356) 2024-08-15 09:19:19 +02:00
NiLuJe
a51bd7a7fd
Nit: Make some cache keys prettier (#12354)
Completely pointless commit because I got triggered by a missing pipe in a log ;).
2024-08-15 04:53:18 +02:00
David
3450aaba99
Bug Fix: DPad conflict on Kindle Keyboard (#12341)
* fix conflicting panning and content selection

* accurate keyboard info message
2024-08-13 22:54:08 +02:00
hius07
27e2efcbd2
Annotations: fix page numbers (#12324) 2024-08-13 22:18:24 +03:00
David
f3c0af49c2
Support 'Ctrl' shortcuts on hasKeyboard (#12347) 2024-08-13 20:34:34 +02:00
David
d706a129fa
[Menu] Remove title bar buttons from layout on hasSymKey or hasScreenKB devices (#12328) 2024-08-13 08:43:40 +02:00
NiLuJe
4264d915b1
Kobo: Refactor suspend in order to be able to catch input events sent during the 2s window of ntx madness (#12330)
I don't even remember how badly things broke (at least on old devices) without it, despite it making absolutely no sense at all (state-extended just flips a global that dictates whether some things get flagged as wakeup sources or not).

So, don't rock the boat too much: we don't remove it, but instead of using a sleep, we use a task deadline instead, which ensures we'll keep processing input events in the right order in the meantime. We'll already have neutered input by this point, so we'll only process power events anyway.

That means that the only iffy things are potentially *when* and *where* we have to potentially cancel that task. Resume makes sense, of course, and we log an info message to make the log flow clear; but we also do so in suspend... just in case. With a warning log because that probably indicates something fishy went on.

Also cleanup the comments while I'm there, and actually rewrite the wakeup_count stuff properly so it could actually theoretically be used if ntx kernels were actually reliable. Spoiler alert: they're not, this is still horribly broken on at least Mk < 7. Works just fine on a Forma, though, so, yay.

Fix #12325
2024-08-12 03:47:43 +02:00
NiLuJe
59476d38f4
OTM: Unbreak #11999 (#12337)
Steps need to happen in chronological order, (mostly) always.

Fix https://github.com/koreader/koreader/issues/12326
2024-08-12 03:47:19 +02:00
NiLuJe
4689e4f257
ImageWidget: Don't attempt to pan if we haven't rendered the bb yet (#12331)
Input events from ImageViewer can be caught between it clearing an old
ImageWidget & instantiating a new one, but before the new one has had a
chance to actually render anything.

Fix #12327
2024-08-12 03:46:45 +02:00
hius07
c46578aece
BookInfo: rating, review (#12313) 2024-08-11 17:01:15 +03:00
David
466971c0e2
ReaderFooter: add page-turn item (#12249) 2024-08-10 10:09:23 +02:00
zwim
dc3b638378
TextWidget: allow numbers in setText and updateSize (#12310)
Closes #12318.
2024-08-09 22:06:53 +02:00
NiLuJe
cafa9c8251
Disable the legacy ReaderRotation module (#12309)
AFAICT, this has never worked since the KPV -> KOReader refactor, as it relies on a weird little DrawContext "feature", while the actually in-use rotation framework is handled via BlitBuffer.

That kludge pollutes *a lot* of both the backend and frontend code, so I plan to annihilate that in a followup PR.

See #12303 for more context
2024-08-08 04:53:04 +02:00
NiLuJe
46a5d20513
Document: Do not cache panel-zoom tiles to disk and fix their caching and rendering (#12303)
* Use a dedicated cache hash for partial tiles from panel-zoom
* Never dump them to disk, as it confuses DocCache's crappy heuristics that rewinds the cache to skip over the hinted page to try to dump the on-screen page to disk.
* Apply the zoom factor in the exact same way as any other page rect (i.e., floor coordinates, ceil dimensions), and make sure said rect is actually a Geom so it doesn't break the cache hash, which relies on Geom's custom tostring method for rects. Said scaling method *also* belongs to the Geom class anyway.
* Handle such pre-scaled rects properly in renderPage, so as not to apply the zoom factor to the full page, which would attempt to create a gigantic buffer.
* And now that the rect is rendered properly in an appropriately-sized buffer, use the rendered tile as-is, no need to blit it to another (potentially way too large because of the above issue) blank BB.
* The zoom factor is now computed for a scale to best-fit (honoring `imageviewer_rotate_auto_for_best_fit`), ensuring the best efficiency (ImageViewer won't have to re-scale).
* Cache: Reduce the maximum item size to 50% of the cache, instead of 75%.
* Warn about the legacy ReaderRotation module, as it turned out to be horribly broken. The whole machinery (which is spread over *a lot* of various codepaths) is left as-is, peppered with notes & fixmes hinting at the problem. Thankfully, that's not how we actually handle rotation, so it was probably hardly ever used (which possibly explains why nobody ever noticed it breaking, and that nugget possibly dates back to the inception of the kpv -> ko refactor!). (#12309)
2024-08-08 04:52:24 +02:00
David
2900eef276
Show/Hide Virtual keyboard and more keyboard shortcuts (#12162) 2024-08-07 18:09:40 +02:00
hius07
975efae929
ReaderSearch: "All text" improve (#12287) 2024-08-06 19:12:16 +03:00