Commit Graph

47 Commits (master)

Author SHA1 Message Date
hius07 dce12de09d
Profiles: fix update actions in gestures (#11175) 5 months ago
hius07 f6fb35fd98
QuickMenu: keep open on apply (#11135) 5 months ago
NiLuJe 2554aee7a3 Gestures: Make the edge swipe zones configurable
As "global defaults" (i.e., "advanced settings" in the UI).

These were the only zones not available there, for some reason (probably
they were new and we try to avoid adding new defaults).

Fix #11142
5 months ago
hius07 51f3115b90
Profiles: fix updating gestures (#11072) 6 months ago
hius07 b36ccc7249
QuickMenu: add long-press on profile (#10671) 9 months ago
hius07 86f4b3c18d
QuickMenu: anchor to gesture position 3 (#10646) 10 months ago
hius07 adfbbd9903
Disabled touch input: always active gestures (#10624) 10 months ago
hius07 483a005cc2
File browser: show Folder Menu on long-press on Home icon (#10298) 1 year ago
hius07 34ab0d8ac6
Folder Menu: sign for Home folder (#10288) 1 year ago
poire-z b1b7773237
TouchMenu: tweak menu search (#9926)
- Cleanup search and animation codes, fix inconsistencies
  between animation/no-animation opening, and refreshes
  glitches on eInk.
- Show menu item on tap, with buttons to either open
  directly, or to walk there (removed earlier "Animation"
  checkbox, so the choice can be decided later).
- Move event handlers into ReaderMenu/FileManagerMenu.
- Avoid duplicated and confusing results from gestures
  and font-family submenus.
1 year ago
NiLuJe 1ec6fb5fcf InputContainer/Dispatcher: Allow toggling touch input
This is made easier by the fact that only a single method in a single
widget actually handles Gesture, and that we barely ever overload it.
So, apply a bit of monkey-patching trickery to handle the magic :).

Fix #9695
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
yparitcher 8a754cd271 Dispatcher: Fixes, Sort & QuickMenu
Fix condition check, simplify getNameFromItem

Allow sorting Dispatcher items and displaying them as a QuickMenu
2 years ago
NiLuJe 62059f8d68
Misc: Get rid of the legacy defaults.lua globals (#9546)
* This removes support for the following deprecated constants: `DTAP_ZONE_FLIPPING`, `DTAP_ZONE_BOOKMARK`, `DCREREADER_CONFIG_DEFAULT_FONT_GAMMA`
* The "Advanced settings" panel now highlights modified values in bold (think about:config in Firefox ;)).
* LuaData: Isolate global table lookup shenanigans, and fix a few issues in unused-in-prod codepaths.
* CodeStyle: Require module locals for Lua/C modules, too.
* ScreenSaver: Actually garbage collect our widget on close (ScreenSaver itself is not an instantiated object).
* DateTimeWidget: Code cleanups to ensure child widgets can be GC'ed.
2 years ago
NiLuJe 8e1bb9bafc
GestureDetector: Full refactor for almost-sane(TM) MT gesture handling (#9463)
Should hopefully make two-contact gestures *much* more reliable, among other things.

See the PR for all the details ;).
2 years ago
zwim d5d5867d4e
DoubleSpinWidget, SpinWidget: add units, make usage more consistent (#9046) 2 years ago
zwim 9b9cfe29a4
[feat] Replace TimeVal (RIP) with time, fixed point time seconds (#8999) 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 8dbfead03d gestures: free long-press on FM home button 2 years ago
hius07 c7a3c17ce0
Gesture intervals spinwidgets - do not show default value in info-text (#8488)
Default values are now shown in SpinWidget default button.
Optimized SpinWidget calls.
2 years ago
yparitcher 1b2b4da9e5
Multiswipe menu: return to item page when going up from submenu (#8474) 2 years ago
Frans de Jonge aa3fa5abfa
[fix, plugin] Gestures migration: check if setting exists instead of assuming it does (#8409)
Fixes <https://github.com/koreader/koreader/issues/8406>.
3 years ago
yparitcher 1f8574cf7e Dispatcher:removeAction()
Gestures: use sub_item_table_func to allow the menu to refresh on change
3 years ago
hius07 ab4e27908b
Standardize: long-press/hold to long-press (#8185)
* Gestures: standardize hold to long-press

* Common settings menu: standardize hold to long-press

* Readerstyletweak: standardize hold to long-press

* Readersearch: standardize hold to long-press
3 years ago
yparitcher dc59391632
Dispatcher: use UIManager:sendEvent instead of the current instance (#7999)
This fixes inheritance issues when changing documents.
Also allow "Go to page" in FM.
3 years ago
NiLuJe a7f23efa65
Double tap: Update default tap zones (#7711)
Make 'em match backward & forward.
Now that we have working overrides and the gesture manager, trying to fit them in a weird superset of the top corner tapzones in a vain attempt to avoid bad interactions doesn't make much sense anymore, and just makes the Gesture Manager UI confusing.

Also make sure the corner zones override the L/R ones for double taps, like it's the case with other gestures.

Fix #7710
3 years ago
poire-z 4b6b12b799 Remove unused "pan_delayed_interval" support 3 years ago
poire-z d0165f8bd1 Fix scrolling, add inertial scroll on non-eInk devices
Add a new reader module: ReaderScrolling, that exposes
some Scrolling options to the menu (which are to be used
by and implemented in ReaderPaging and ReaderRolling
themselves) and implement some inertial scrolling logic
used by both of them.
Default to "Classic scrolling" which is the expected
behaviour on phones and tablets.
The old CreDocument buggy behaviour is available as
"Turbo scrolling" for both Paging and Rolling documents.
Added a "On release scrolling" option that might be
useful on eInk to avoid dynamic pan/scrolling.

Try to avoid bad interactions between pan and swipe,
cancelling unwanted panning if we ended up doing a
swipe or multiswipe.
3 years ago
hius07 752ec49c6f
FM: Make "Refresh content" an actual Event/Gesture (#7592)
* And enable it by default in the FM as the "hold on top-right corner" Gesture, instead of the onHold handler of the "+" button.
3 years ago
hius07 3845424808
Gestures menu optimization (#7609) 3 years ago
NiLuJe bf6c0cdd6c
LuaSettings: Add a method to initialize a setting properly (#7371)
* LuaSettings/DocSettings: Updated readSetting API to allow proper initialization to default.
Use it to initialize tables, e.g., fixing corner-cases in readerFooter that could prevent settings from being saved.
(Fixes an issue reported on Gitter).
* LuaSettings/DocSettings: Add simpler API than the the flip* ones to toggle boolean settings.
* Update LuaSettings/DocSettigns usage throughout the codebase to use the dedicated boolean methods wher appropriate, and clean up some of the more mind-bending uses.
* FileChooser: Implement an extended default exclusion list (fix #2360)
* ScreenSaver: Refactor to avoid the pile of kludges this was threatening to become. Code should be easier to follow and use, and fallbacks now behave as expected (fix #4418).
3 years ago
yparitcher b0a1077756
FileManager: fix Plus menu override (#6957)
manage it in FM not in gestures, as  #6918 made the menu tap zone the entire width so the tap is not passed through to the gesture plugin
3 years ago
Frans de Jonge fd51671478
[chore] Change single quotes to double quotes (#6949)
*Especially* in the hello world plugin.
3 years ago
NiLuJe 493eab92c9
[RFC] Make default UI tapzones more generous (#6918)
* Top menu & bottom menu tapzones are now full-width, thanks to the now sane override system.
* A separate, extra tapzone was also created for each of them to provide a taller, but narrower tapzone extension (one that doesn't clash with the prev/next tapzones).
* The footer tapzone was made much taller.
3 years ago
poire-z 8403154d4d
Reader: rationalize "Back" key/action handling (#6840)
Have ReaderBack be the sole handler of onBack.
Add 4 mutually exclusive options for the Back key,
to avoid ReaderLink and ReaderBack location stacks
from interfering (ReaderBack's stack being always a
superset of ReaderLink's stack).
So, remove "Enable back history", which is replaced
by Back option "Go to previous read page".
Fix a few possible crashes and inconsistencies (when
zoom, scroll or reflow have changed) with ReaderPaging
and ReaderView when restoring previous page/view.
4 years ago
poire-z 74c1813a82 GestureDetector: add Tap interval on keyboard setting
Follow up to b90f6db8: allow specifying an other
value for tap interval when the keyboard is shown
(a good value for tap interval on reader and UI
elements might be too long on the keyboard, and
prevent typing fast).
4 years ago
poire-z b90f6db876 GestureDetector: add Tap interval setting, to avoid bounces
Also fix info_text not displayed, and add more
descriptive ones.
4 years ago
yparitcher 34b3d5541d Gestures/Profiles: make sure dispatcher is initalized
even when the menu is not opened. this was causing a crash when the event name was parsed from creoptions
4 years ago
NiLuJe 99045b4311
Minor util & ffi/util cleanups (#6657) 4 years ago
yparitcher 986f45871a
Dispatcher: show selected number (#6472)
followup to #6441
4 years ago
Galunid 55a5f0c1a3
Cleanup after #6449 (#6484)
* Better description in spinwidget
* Rename SpinWidget title from "Hold pan rate" -> "Text selection rate"
4 years ago
Galunid 627716db9c
Allow setting text selection rate (#6449) 4 years ago
yparitcher 7583571707
Dispatcher Gestures Profiles: only flush settings when changed (#6471) 4 years ago
yparitcher 2d8c50708f
Fix gesture migration when user never had custom multiswipes (#6467) 4 years ago
yparitcher 9e0ac734ba Gestures: Refactor to use Dispatcher 4 years ago
yparitcher 2a99b014a2 initial refactor of ReaderGesture into Gestures plugin 4 years ago