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

1158 Commits

Author SHA1 Message Date
Rowan Decker
60e0e3ef45
Add color highlight menu (#11044) 2024-08-30 22:10:43 +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
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
hius07
415ce40f84
Touch menu: always go up to correct parent page (#12378) 2024-08-21 20:53:45 +03:00
zwim
004311e2aa
Fix terminal broken cursor and backspace (#12375)
This shall fix #12271

Use $SHELL env-variable if available. (thanks to @Frenzie)

Use a read line wrapper (either rlfe or rlwrap) if available so that dash can be used as interactive shell.
2024-08-19 20:18:37 +02:00
zwim
92de5821bb
[AutoWarmth] Delay front light actions after resume (#12315) 2024-08-09 19:42:13 +02:00
Frans de Jonge
880b7c5ed1
Profiles: make sure to close menu/quickmenu before executing action (#12299)
Mainly a difference without distinction, but in some edge cases like screenshots it keeps the menu on the screen.
See <https://github.com/koreader/koreader/pull/12293#issuecomment-2269680044>.

The "Show as QuickMenu" is really just for balance; it makes little to no difference.
2024-08-06 15:15:08 +02:00
David
3992438872
[CoverBrowser.MosaicMenu] Increase focus underline thickness (#12189) 2024-08-05 10:19:16 +02:00
zwim
f6f8b38cac
[plugin] Reader footer: check if header resp. footer are available (#12264) 2024-08-03 16:38:56 +02:00
hius07
a24bb70066
Annotations: fix exporting (#12261) 2024-08-01 13:14:46 +03:00
NiLuJe
d59c837714
Kobo: Refactor various aspects of the Kaleido/MTK support (#12221)
* UIManager: Let the fb backend deal with Kaleido wfm promotion. This fixes a number of quirks that poisoned the refresh queue with spurious full-screen refreshes. See https://github.com/koreader/koreader-base/pull/1865 for more details.
* This also means we now disable Kaleido waveform modes when color rendering is disabled (remember to trash your thumbnail cache if you don't want to mix color w/ grayscale thumbnails, though).
* UIManager: Merge refreshes that share an edge, because that was driving me nuts (and would have most likely been merged by the kernel anyway). A perfect test-case is the FM, which trips two separate refreshes because of its title bar.
* ReaderFlipping: Use sensible dimensions, so that we only refresh the icon's region.
* ReaderBookmark: Only refresh the dogear instead of the whole page when toggling bookmarks.
* NetworkSetting: Make it a real boy, so it consistently refreshes properly on dismiss instead of relying on UIManager saving the day.
* Kobo: Aggressively prevent *both* suspend & standby while MTK devices are plugged-in, as both will horribly implode the kernel (we previously only prevent standby while charging).
* Kobo: Switch to 8bpp on B&W MTK devices (or when color rendering is disabled on Kaleido panels).
2024-07-28 01:19:40 +02:00
hius07
8cb221c6c6
Annotations: pageno honors reference pages and hidden flows (#12214) 2024-07-24 18:35:48 +03:00
zwim
df48d51eca
AltStatusBar/Footer: add the read timer value (#12002)
Closes #11950
2024-07-19 22:55:31 +02:00
Martín Fernández
4f75e41636
exporter: fix remaining OOM (#12126) 2024-07-03 21:55:42 +02:00
Arpan Ghosh
e88bfbed97
[plugin] Exporter: include book author name in myclippings export format (#12106) 2024-06-28 14:19:08 +02:00
Mochitto
138e26a4fc
[plugin] Exporter: solved my_clippings OOM (#12107)
Closes #10745.
2024-06-28 12:03:54 +02:00
weijiuqiao
e19bed3371
VocabBuilder: fix and improve non-touch device experience (#12030)
Fix #12026.
2024-06-16 13:10:37 +02:00
Benoit Pierre
088ae7d4ee lint: fix issues reported by newer shellcheck / shfmt 2024-06-15 23:02:52 +02:00
hius07
ded709e3a1
InputContainer: consistent input type in onInput() (#12012) 2024-06-15 09:54:17 +03:00
mergen3107
0a021d5e5e
Statistics Plugin: Skip adding never opened marked as finished books (#11991)
Closes #11201
Thank you very much @hius07 !
2024-06-10 14:22:54 +02:00
NiLuJe
0a5dcf885d Calibre Metadata: Flag array & objects as such in the "safe" parser 2024-06-09 19:28:21 +02:00
NiLuJe
8d80acf720 Calibre Metadata: Make sure self.books is always flagged as a JSON array
Ditto for self.driveinfo
2024-06-09 19:28:21 +02:00
NiLuJe
1ca443195b Calibre Metadata: Don't lose rapidjson object/array tagging in slim 2024-06-09 19:28:21 +02:00
Martín Fernández
79c13bee0c
Calibre: Metadata parser improvements (#11922)
* Added a safe pure-Lua SAX JSON parser (via LunaJSON).
* Updated RapidJSON.
* Also implemented a calibre-specific SAX parser in Lua-RapidJSON, and use it by default instead of the full RapidJSON one.
* Raised the file-size threshold to switch between the fast & safe parsers to 50MB.
* Added an UI option to switch between the three parsers.
2024-06-06 01:06:46 +02:00
Frans de Jonge
e2682e2d98
[plugin] AutoDim: reset counter on page turn (#11984)
Even if not from input.

Closes #11979.
2024-06-05 21:17:49 +02:00
hius07
ed550948a9
mosaicmenu: fix collection mark (#11969) 2024-06-05 07:48:29 +03:00
hius07
bd42f6984e
Gesture manager: make long-pressing on top left corner non adjustable in FM (#11971)
It is overridden by the folder tree, so the Gesture manager setting doesn't work.
2024-06-04 21:12:51 +02:00
NiLuJe
08f02bf915 OPDS: Don't append Search twice for feeds with an OpenSearchDescription 2024-06-04 20:28:34 +02:00
NiLuJe
8a37917e5c OPDS: Fixup the last commit
We don't want to actually change the page when we request a fill on the
initial fetch.
2024-06-04 20:28:34 +02:00
NiLuJe
04ccd80b86 OPDS: Fix progressive fill on pagination
I have... no idea how this could have ever worked, the Menu handler has
*always* been called OnNextPage o_O.
2024-06-04 20:28:34 +02:00
NiLuJe
f3a67a4f4d OPDS: Handle searching in Calibre's OPDS server
Re: #11968
2024-06-04 20:28:34 +02:00
hius07
14519bc076
Dispatcher: add File browser actions 'Set display mode', 'Sort By' (#11921) 2024-06-01 10:33:14 +03:00
zwim
d2ff789543
[plugin] AutoWarmth: add more gestures for autowarmth activation (#11946)
Fixes #11274.
2024-06-01 08:42:09 +02:00
nairyo
c7a59145a3
[fix] VocabBuilder: restore erroneously removed onShowVocabBuilder function (#11915)
Fixes #11913.
2024-05-27 20:17:00 +02:00
Piotrek Marciniak
9b1a21ef82
Export highlights: empty annotations as nil instead of empty string (#11912)
Fixes Readwise exports
2024-05-27 19:18:11 +02:00
SomeGuy
eb63cf655f
CoverBrowser: update MosaicMenu FocusManager grid view to 2D (#11906)
This PR [and #11884] are for #11834.
2024-05-27 11:03:06 +02:00
hius07
c6e6d72cf3
Collections: add collection mark to books (#11868) 2024-05-26 08:18:44 +03:00
NiLuJe
4d9c6523ad
Input: Some more followups to the input device auto-detection stuff (#11855)
Switch to a new `input.fdopen` API & wrapper so we can keep the fds opened by `fbink_input_scan` instead of closing them to re-open them right after that...

This should hopefully help on racy zForce devices that attempt to handle power management when opening/closing the device. We know this sometimes horribly fail to re-activate the IR grid (c.f., our manual activation on resume), but this apparently could also happen here (re: #11844) because of the quick succession of open->close->open.
2024-05-19 22:53:14 +02:00
nairyo
126c01e1b5
Replace tweak_buttons_func with an event instead (#11777)
Also see https://github.com/Ajatt-Tools/anki.koplugin/issues/22
2024-05-16 20:44:01 +02:00
NiLuJe
fd5260f2ce
Support auto-detection of input devices via fbink_input (#11807)
* Kobo: Drop a bunch of if ladder crap and switch to auto-detection of input devices via fbink_input
* Kindle: Drop an even larger bundle of crap to do the same ;p. (re: #11392)
* ExternalKeyboard: Switch to fbink_input to whitelist keyboards instead of the manual parsing of caps via its FindKeyboard class
* Input: Extended open/close wrappers to handle logging & tracking of dupe open/close calls.
2024-05-15 05:42:48 +02:00
Nico Hirsch
3e04184638
calibre: add wireless connectionstart/stop actions (#11806)
* Register start stop connection actions

* Match code order

* Title to lowercase
2024-05-13 00:16:17 +02:00
peicuiping
a7e34673e6
chore: remove repetitive words (#11785) 2024-05-09 12:10:53 +02:00
hius07
c47d3b3177
Menu widget: cleanup (#11759) 2024-05-07 09:34:30 +03:00
zwim
bf58723af1
[CoverImage] Honor rotation after opening of a book (#11752)
If rotation changes, create a new cache entry and use that if necessary.

Fixes #11713.
2024-05-06 22:53:13 +02:00
SomeGuy
e51b71f463
[Gestures.plugin] Clarify some rotation gesture strings (#11753) 2024-05-06 17:59:00 +02:00
poire-z
03d16270d9 Statistics: handle correctly page change when reading paused
As currently we only handle ReadingPaused/Resumed on suspend
and resume, no page change should happen while paused, so
there is no current issue to fix. But let's get ready for
other use cases (which may be brought in by user patches,
ie. pausing while the SkimWidget is displayed, and obviously
triggers page changes).
2024-05-05 21:02:21 +02:00
poire-z
1c9a6509a2 HttpInspector: allow browsing global variables 2024-05-05 21:02:21 +02:00
hius07
d82815952e
Annotations, part 1 (#11563)
New format to handle annotations (page bookmarks, highlights, notes) and store them in the book metadata files.
2024-05-03 09:08:57 +03:00
hius07
6b0d97bf22
Multiple collections (#11693) 2024-05-01 09:01:59 +03:00
Max Ignatenko
87c85bf94d
NewsDownloader: use <content:encoded> from RSS item, if available (#11694)
This makes it work much nicer for feeds that provide the full content in the feed itself.
2024-04-18 13:24:08 +02:00