Commit Graph

115 Commits (master)

Author SHA1 Message Date
SomeGuy 1aefd80ea6
ReaderBookmark: "bookmark current page" removed from NT kindles (#11907)
Discussed https://github.com/koreader/koreader/issues/11834#issuecomment-2132411929 onwards.
2 days ago
Frans de Jonge 8f2bd5420d
Introduce Device:useDPadAsActionKeys() (#11900)
1. Non-Kindle-specific `hasFiveWay` behavior is changed to `hasDPad and useDPadAsActionKeys`. For now they remain Kindle-specific in practice, unless one sets `useDPadAsActionKeys = yes` in a user patch.
2. With that disambiguation out of the way, `hasFiveWay` itself is further disambiguated into `hasScreenKB` and `hasSymKey`, as per the actual property being used, rather than something that tends to correlate with it. (It needn't be Kindle-specific per se, but non-Kindle devices have equivalent shortcuts with for example `Shift`.)
  Running the emulator with `DISABLE_TOUCH=1` will set `hasSymKey = yes`, which can be tested with right shift.

Closes #11887.
3 days ago
Frans de Jonge a21db40745
[i18n] ReaderBookmark: don't bother translators with a space (#11902) 3 days ago
SomeGuy 577c5d454f
Non-touch DPad improvements (#11749)
Closes #11295.
1 week ago
hius07 6b192c346a
Annotations: Bookmark list improvement (#11825) 2 weeks ago
hius07 12c3c190b0
Annotations: fixes 2 (#11788)
* readerbookmark: fix index for reverse sorting

* readerhighlight: fix pdf tap on highlight detection
3 weeks ago
hius07 725df17c45
Annotations: fixes (#11761) 3 weeks ago
hius07 d82815952e
Annotations, part 1 (#11563)
New format to handle annotations (page bookmarks, highlights, notes) and store them in the book metadata files.
4 weeks ago
hius07 5414858b74
Menu widget: fix item property name (#11534) 3 months ago
hius07 8df885438c
Bookmarks: edit highlighted text (#11484) 3 months ago
hius07 f4a5a2b60a
TextViewer: add dialog to set font size and justify text (#11210) 6 months ago
hius07 684fc22ffc
TextViewer: font size (#10911) 8 months ago
hius07 be125af949
Actions for Go to first/last bookmark (#10899) 9 months ago
hius07 23feb0c9cd
Bookmarks: filter by highlight style (#10549) 12 months ago
hius07 57f4ff2c68
ReaderHighlight: manage overlapped highlights (#10492) 1 year ago
hius07 9db74f1f01
ConfirmBox: add widgets (#10364) 1 year ago
hius07 af45ec75c3
ReaderThumbnails: update cached page thumbnail on bookmark note change (#10303) 1 year ago
hius07 827581ac72
readerbookmark: fix writing pdf annotation (#10287) 1 year ago
poire-z 3006348585 PageBrowser: toggle page bookmark with long-press on thumbnail 1 year ago
hius07 91ff6ce2d8
ReaderBookmark: fix comparing positions (#10109) 1 year ago
hius07 ee75abd4a0
Statistics: show correct number of notes in a book (#9928) 1 year ago
hius07 05cd59ebe5
ReaderBookmark: indicate current page with dimmed page numbers after current (#9872) 1 year ago
hius07 cd56dd2edf
ReaderHighlight: pdf multi-page highlights (#9850) 2 years ago
NiLuJe 925fd647dc InputContainer/FocusManager: Simplify key_events clearing on unplug
Thanks to @poire-z for the idea, it's indeed much nicer this way ;).
2 years ago
NiLuJe 09498d4bbb ReaderUI: Refresh key_events handlers on keyboard hotplug 2 years ago
NiLuJe 1e24a1c7a3 ReaderUI: Properly neuter gesture handling from InputContainer modules
None[1] of them actually rely on their own onGesture handler, they
all register their own stuff to ReaderUI's.
Hotfix #9710 revealed that the way this was handled didn't exactly
work as expected ;).

The only thing that consumes ges_events is InputContainer's onGesture
method. All these modules *extend* InputContainer, but none of them
*implement* a custom onGesture, so self.onGesture = nil was just a NOP,
they always access InputContainer's method via inheritance.
If we actively want to neuter it, we *have* to implement it in that
module (with a NOP).

[1] The exception being ReaderZooming, but that only when in flip mode.
2 years ago
NiLuJe b523c2e8b9 InputContainer: Fall cleanup ;).
Get rid of the doc & seqtext fields, as they are not actually used (nor
are they particularly useful, the event handler's name should be pretty
self-explanatory).

Also, tweak the key_events documentation to highlight the quirks of the
API, especially as far as array nesting is involved...

Random drive-by cleanup of the declarations of key_events & ges_events
to re-use the existing instance object (now that we know they're sane
;p) for tables with a single member (less GC pressure).
2 years ago
NiLuJe fadee1f5dc
Clarify our OOP semantics across the codebase (#9586)
Basically:

* Use `extend` for class definitions
* Use `new` for object instantiations

That includes some minor code cleanups along the way:

* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
  * ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2 years ago
hius07 f67469bab4
Highlight: add note marker (#9395) 2 years ago
Philip Chan 107156c0a8
[feat] Non-touch improvements (#8859)
FocusManager: fix round x use y layout
FocusManager: add tab and shift tab focus navigation support
FocusManager: handle Press key by default
FocusManager: make sure selected in instance level
FocusManager: add hold event support
FocusManager: Half move instead of edge move
FocusManager: add keymap override support
FocusManager: refocusWidget will delegate to parent FocusManager
Focusmanager: refocusWidget can execute on next tick
inputtext: can move out of focus on back
inputtext: fix cannot exit for non-touch device
inputtext: fix cannot input text with kindle dx physical keyboard
fontlightwidget: add non-touch support
datetimewidget: add non-touch support
datetimewidget: fix set date failed in kindle DX, fix datetimewidget month range to 1~23 by default
datetimewidget: make hour max value to 23
multiinputdialog: add non-touch support
checkbox: focusable and focus style
virtualkeyboard: no need to press two back to unfocus inputtext
virtualkeyboard: collect FocusManager event key names to let VirtualKeyboard disable them
openwithdialog: add non-touch support
inputdialog: can close via back button
enable all InputDialog and MultiInputDialog can be close by back
keyboardlayoutdialog: non-touch support
readertoc: non touch device can expand/collapse in toc
bookstatuswidget: non touch support
keyvaluepage: non-touch support
calendarview: non-touch support
2 years ago
hius07 1c863f76aa
Bookmarks: start Add note with empty text, add some buttons (#8738)
- New button Go to bookmark in Bookmark details dialog.
- New button Latest bookmark in the popup menu.
- Empty input box for new note, new button Paste to
  paste highlighted text (auto-text).
- Allow duplicated bookmarks to avoid orphaned highlights.
- TextBoxWidget: fix enabled up-arrow on empty box in InputDialog.
2 years ago
hius07 1c2b01a51e
Bookmarks: fix compare invalid xpointers (#8690) 2 years ago
hius07 2a244278e3
Translator: copy translation to clipboard or save to note (#8669) 2 years ago
poire-z 99171b5267
ReaderBookmark: fix issue with unit tests (#8645)
Revert some bits from 55532b13, as the otherwise uneeded
CenterContainer is used by unit tests.
2 years ago
hius07 55532b1397
Menu widget: insert TitileBar (#8639) 2 years ago
hius07 00b08d7b54
Bookmarks: fix sort within one page (#8616)
Accurate sorting of bookmarks located in one page depending on their positions in text.
2 years ago
poire-z bc16b32395 Add Book map and Page browser features
- Book map: shows a map of content, including TOC,
  boomarks, read pages, non-linear flows...
- Page browser: shows thumbnails of pages.

- ReaderThumbnail: new Reader module that provides
  a service for generating thumbnails of book pages.
  It makes available these 2 new fullscreen widgets.
- ReaderBookmark, ReaderLink, Statistics: add methods
  to return new views of bookmarks, previous locations
  and read pages, that are needed by BookMapWidget.
- ReaderToc: compute TOC max_depth.
- ReaderBookmark, ReaderHighlight: send events on
  bookmark add/update/remove so thumbnails of the
  pages impacted can be trashed.
2 years ago
hius07 3450290af9
Bookmarks/Highlights: left button, show note in book (#8600)
Bookmark list: added title bar left button for multiple actions
Highlighted text: show note on tap
2 years ago
hius07 19271c08c4
Checkbutton widget optimization (#8522)
-checkmark toggling is separated from the callback
-default width added
3 years ago
hius07 785eb5f3ef
Bookmark search (#8504)
From bookmark list, main menu and with a gesture.
3 years ago
Dylan Garrett 7495ea29ef
InputDialog: add 'use_available_height' option (#8467)
Use it with bookmark edit, to allow entering longer notes.
3 years ago
hius07 1c9e21389d
Backup and restore bookmarks/highlights: fix logic (#8473) 3 years ago
hius07 0eeb8bd2b7
Backup and restore bookmarks/highlights when switching engines (#8455)
Bookmark/highlight formats in crengine and mupdf are incompatible.
This backups and restores bookmarks and highlights when opening the
document with an incompatible engine, instead of deleting them.
3 years ago
hius07 c7229d90bc
ReaderHighlight: allow for 2-steps text selection (#8432)
Add a "Select" button in the highlight dialog to initiate
text selection; on the next text selection, the text between
these 2 points will be selected.
Limited to a single page with non-CRE documents.
Also move "Search" button at end, so it's the one that
will be wide in case of an odd number of buttons.
3 years ago
hius07 f301ca59b7
Bookmarks: icon by type, combined view, filter, bulk remove (#8347)
- Add an icon to distinguish between page bookmarks, plain
  highlights, and highlights with an added note
- Bookmark details: show both highlighted text and added note
- Bookmark list: allow filtering by type and/or by keyword
- New bookmark selection mode, to allow multiple removals
- New option: show separator line
3 years ago
hius07 f0b992d425
Bookmarks: new settings and tweaks (#8301)
Bookmarks list:
- page numbers are displayed
- page bookmarks are marked with a star
- new setting: Sort by largest page number (default: checked)
New bookmark setting: Add page number / timestamp to bookmark
- If enabled (default), bookmark name is 'Page # notes @ time'.
- If disabled, bookmark name is equal to the notes field.
Rename bookmark dialog:
- page number and timestamp are displayed in the input
  dialog description
- blank input renames bookmark to the default name in
  accordance with the new setting
Also fix: changing boundaries of the highlight: the name of the
highlight is not changed if it was previously edited by the user.
3 years ago
hius07 1e47cd7e5f
SpinWidget: similar size in portrait and landscape (#8226) 3 years ago
NiLuJe 90d4d22ba6
ReaderBookmark:renameBookmark: Better nil guard (#8176)
When matching a highlight to a bookmark *really* fails.

(Noticed in the log from #8175)
3 years ago
NiLuJe 5f9f7ce1da ReaderBookmark: Don't confuse bookmarks with highlights
Attempting to update a highlight when matching on a bookmark doesn't
make sense, and no longer works since #7411

Also, switch to ipairs(), and stop piggybacking on a new local that
shadows or uses the function's item argument.
It works in Lua, but it's super weird and error-prone.

Fix #7520 (regression since #7411).
3 years ago
Toromtomtom 3706196bfe
Update PDF annotations when changing bookmark text (#7411) 3 years ago