Commit Graph

226 Commits

Author SHA1 Message Date
hius07
b59734dfab Minor fixes (#13930) 2025-06-13 07:42:08 +03:00
hius07
20fee6536d Coverbrowser: optimize display mode switching (#13822) 2025-05-22 18:00:35 +03:00
hius07
c2d41f2c41 menu: restore go to letter for folders (#13460) 2025-03-26 10:30:24 +01:00
hius07
93ee0a1415 File browser: sort by metadata (#13437) 2025-03-24 19:12:46 +02:00
hius07
5463ab641e CoverBrowser list mode: fix shortcut icon position (#13429) 2025-03-19 08:01:09 +02:00
hius07
b707d0f593 Menu widget: "Go to letter" everywhere (#13405) 2025-03-16 08:03:14 +02:00
hius07
e6b45e7ff7 ReaderSearch results: search string always in bold (#12940) 2024-12-27 08:27:13 +02:00
hius07
8b710d183c Focus: fixes (#12688) 2024-10-30 20:09:59 +02:00
mergen3107
f8446538c0 Fix KOReader spelling in the code (#12670) 2024-10-24 10:46:46 +02:00
NiLuJe
fdd342de40 Menu: Fix fallout from #12583 on hasDPad devices (#12657)
Tweak `mergeTitleBarIntoLayout` to keep the current selection (adjusted for the added rows) instead of resetting the focus.

It only actually called `moveFocusTo` on `hasDPad` devices, which explains why this was missed during testing.

Fix https://github.com/koreader/koreader/pull/12583#issuecomment-2423554770
2024-10-21 13:35:44 +02:00
hius07
ce7fcff360 Menu widget: draw focus on focused item (#12583) 2024-10-13 18:02:51 +03:00
hius07
76deedfb73 Menu widget: rotation handler (#12573) 2024-10-10 10:54:59 +03: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
d706a129fa [Menu] Remove title bar buttons from layout on hasSymKey or hasScreenKB devices (#12328) 2024-08-13 08:43:40 +02:00
hius07
c46578aece BookInfo: rating, review (#12313) 2024-08-11 17:01:15 +03:00
hius07
975efae929 ReaderSearch: "All text" improve (#12287) 2024-08-06 19:12:16 +03:00
David
041ca074fb [NT] MenuWidget: add keyboard shortcuts for start/end (#12065) 2024-06-21 18:07:10 +02:00
hius07
ded709e3a1 InputContainer: consistent input type in onInput() (#12012) 2024-06-15 09:54:17 +03:00
David
2d07a82ea2 Add menu key event to Menu widget (#11966)
As seen here https://github.com/koreader/koreader/pull/11918#issuecomment-2137290809
2024-06-05 08:07:03 +02:00
hius07
b06272592d Annotation list: flexible item heights (#11918) 2024-06-01 10:32:15 +03:00
SomeGuy
d217f5c161 Menu widget: limit right as hold to hasFewKeys (#11890)
Addresses concerns in #11884.
2024-05-26 15:33:06 +02:00
SomeGuy
81575ae24f Global long press on K4, 'ScreenKB' + 'Press' (this time for real) (#11884)
discussed #11834

then merged #11872, then reverted #11881
2024-05-25 11:11:53 +02:00
Frans de Jonge
07b507370f Revert "Global long press on K4, 'ScreenKB' + 'Press' (#11872)" (#11881)
This reverts commit 3f64ecfd28.
2024-05-24 16:34:08 +02:00
SomeGuy
3f64ecfd28 Global long press on K4, 'ScreenKB' + 'Press' (#11872)
discussed #11834
2024-05-21 23:48:54 +02:00
hius07
6b192c346a Annotations: Bookmark list improvement (#11825) 2024-05-16 21:57:04 +03:00
hius07
c47d3b3177 Menu widget: cleanup (#11759) 2024-05-07 09:34:30 +03:00
poire-z
67cd647d1a ReaderToc: add option to show chapter lengths (#11546) 2024-03-20 10:09:44 +01:00
hius07
5414858b74 Menu widget: fix item property name (#11534) 2024-03-12 08:51:33 +02:00
hius07
8df885438c Bookmarks: edit highlighted text (#11484) 2024-03-09 17:03:43 +02:00
poire-z
c65d128032 Menu, DictQuickLookup, TextViewer: allow mousewheel scrolling (#11525)
We also need to catch it in TrapWidget so we can
interrupt Wikipedia articles images loading.
2024-03-09 09:11:23 +01:00
NiLuJe
90ae4acca6 Chore: Review FrameContainer constructors for shared dimen objects
Nothing else seems problematic, this is mostly just cosmetic sanitization
around Geom objects.
2024-01-19 00:08:10 +01:00
NiLuJe
65e22ceafc Widgets: Fix a bunch of regressions after the FrameContainer change in #11364
FrameContainer now preserves its self.dimen, which means it cannot be
shared with another widget or container that might also modify it during
painting ;).

Fix #11370
Fix https://github.com/koreader/koreader/pull/11364#issuecomment-1894454657
Fix #11379
2024-01-19 00:08:10 +01:00
hius07
ea9ef6781c CoverBrowser: adjustable mosaic grid (#11232) 2024-01-12 08:13:50 +02:00
hius07
042a529fab File manager: fix height of menu widget (#11251) 2023-12-22 08:01:11 +02:00
hius07
5a4e70a19d History, Collection: title bar in FM style (#11243)
These changes make the title bar in File manager, History and Collection windows of the same height.
The items and book covers thumbnail dimensions in Mosaic and Detailed list display modes are now equal, and up/down scaling of the thumbnails is not needed when switching between File manager, History and Collection.
2023-12-19 09:22:53 +02:00
hius07
da8e23c011 InputDialog: tap outside to close dialog if keyboard is hidden (#11094) 2023-11-12 07:44:56 +02:00
hius07
ed5c1cef20 ButtonTable: remove unused (#10926) 2023-09-22 09:06:30 +03:00
hius07
1544ca28af FileManager: truncate left in selected files list (#10783)
Truncate the path to view the filename in full. Closes #10760.
2023-08-10 17:01:07 +02:00
hius07
dee1c902ec ReaderUI: minor optimization (#10634) 2023-07-03 17:43:13 +03:00
hius07
4d26650ad6 Filesearcher: add search in book metadata (#10198) 2023-03-28 16:16:53 +03:00
hius07
aedb713f82 Menu widget: cleanup (#10241) 2023-03-25 09:48:30 +02:00
hius07
05cd59ebe5 ReaderBookmark: indicate current page with dimmed page numbers after current (#9872) 2022-12-09 09:08:14 +01:00
NiLuJe
e0bfebb0b5 FileManager: Refresh key_events handlers on keyboard hotplug 2022-11-02 03:48:39 +01:00
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).
2022-10-29 22:55:20 +02:00
zwim
4969811c08 Optimization: Use constant folding for divisions not a power of two (#9609) 2022-10-10 22:21:27 +02:00
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.
2022-10-06 02:14:48 +02:00
Philip Chan
d6ff983243 Show TitleBar left and right buttons on non-touch devices (#9041)
Titlebar button navigation in menu, including ListMenu and MosaicMenu in FileManager, History, Favourites and Shortcuts.
Hide show password checkbox in non-touch devices
2022-05-06 10:44:25 +02:00
hius07
a6d6ba3606 Menu widget: fix no items (#8838)
Avoid showing "Page 0 of 0" in non-classic dispaly modes.
2022-03-12 11:30:26 +01:00
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
2022-03-04 21:20:00 +01:00
yparitcher
73bb76f92d menu: separate indentation from text 2022-02-20 16:09:39 +01:00