2
0
mirror of https://github.com/koreader/koreader synced 2024-11-04 12:00:25 +00:00
Commit Graph

1404 Commits

Author SHA1 Message Date
NiLuJe
da65ac8b02
Cleanup various varargs shenanigans (#9624)
* Iterate over varargs directly via select if possible
* Use table.pack otherwise (https://github.com/koreader/koreader-base/pull/1535).
* This allows us to simplify a few Logger calls, as logger now handles nil values.
2022-10-12 19:59:48 +02:00
weijiuqiao
8508689cea
[feat] Add Thai keyboard (#9620)
This PR adds support for a Thai keyboard. Layout mostly copied from my phone, with difference in diacritics placements: phone has only one key for all of them, while here we have a couple more. Swipe in different directions needed for inputing them.
2022-10-12 11:25:43 +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
68dcc4f36c
Bump base (#9618)
* Bump base (https://github.com/koreader/koreader-base/pull/1534)
* And some fixups following #9617
2022-10-10 20:25:18 +02:00
NiLuJe
6ac7a0cd40
UIManager: Fix handling of toast widgets in sendEvent (#9617)
The ultimate goal is for toast widgets (i.e., Notification when flagged as such) to:
  * Not stop event propagation
  * Close themselves when the event was emitted by user input.

Instead of doing event filtering in UIManager, we simply overload the onGesture & onKey* handlers in Notification to do just that, and just make sure UIManager will *send* those events to toasts, but without affecting the usual semantics of top widget selection and event propagation (which is as simple as just calling handleEvent on them unchecked ;p).

Thanks to @poire-z for the brainstorming in https://github.com/koreader/koreader/issues/9594 ;).

This also happens to fix a bug in which we might have looped on the top widget twice, because of an array vs. hash mishap ;).
2022-10-10 18:55:29 +02:00
NiLuJe
a62f076e56 DictQuickLookup: The window_list array needs to be a static class member
Also, make sure references are actually dropped,
no matter how the widget is closed, by relying on onCloseWidget ;).

Enable the "long-press-on-close" trick on the actual Close button,
too, instead of only on the title bar's cross.

Fix: https://github.com/koreader/koreader/pull/9586#issuecomment-1272332275
2022-10-09 05:30:28 +02:00
NiLuJe
eef938996f MultiDialog: Fix an extremely nasty API misuse
Stuff was poking at the class object, not the instance's :s.

Fix #9599
2022-10-06 19:28:26 +02:00
NiLuJe
5c24470ea9
Logger: Use serpent instead of dump (#9588)
* Persist: support serpent, and use by default over dump (as we assume consistency > readability in Persist).
* Logger/Dbg: Use serpent instead of dump to dump tables (it's slightly more compact, honors __tostring, and will tag tables with their ref, which can come in handy when debugging).
* Dbg: Don't duplicate Logger's log function, just use it directly.
* Fontlist/ConfigDialog: Use serpent for the debug dump.
* Call `os.setlocale(C, "numeric")` on startup instead of peppering it around dump calls. It's process-wide, so it didn't make much sense.
* Trapper: Use LuaJIT's serde facilities instead of dump. They're more reliable in the face of funky input, much faster, and in this case, the data never makes it to human eyes, so a human-readable format didn't gain us anything.
2022-10-06 02:21:03 +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
hius07
c5505879c3
ConfigDialog: fix bug in DoubleSpinWidget default values (#9580) 2022-10-04 07:44:55 -04:00
hius07
b0eb0ce0e1
FileManager: add Select button to the file long-press menu (#9571) 2022-10-04 07:44:17 -04:00
poire-z
defd9d1e02 TouchMenu: add support for checkmark_callback
Allows having a toggable checkmark on menu items
leading to a sub-menu.
2022-10-03 23:27:44 +02:00
weijiuqiao
24edbe162f Vocabulary builder: support manually adding words to vocabulary builder 2022-10-03 01:23:00 +02:00
zwim
82d1381d49
Documentation: Fix documentation of infomessage (#9577) 2022-10-02 20:24:00 +02:00
NiLuJe
9bf19d1bb3
Assorted bag'o tweaks & fixes (#9569)
* UIManager: Support more specialized update modes for corner-cases:
  * A2, which we'll use for the VirtualKeyboards keys (they'd... inadvertently switched to UI with the highlight refactor).
  * NO_MERGE variants of ui & partial (for sunxi). Use `[ui]` in ReaderHighlight's popup, because of a Sage kernel bug that could otherwise make it translucent, sometimes completely so (*sigh*).
* UIManager: Assorted code cleanups & simplifications.
* Logger & dbg: Unify logging style, and code cleanups.
* SDL: Unbreak suspend/resume outside of the emulator (fix #9567).
* NetworkMgr: Cache the network status, and allow it to be queried. (Used by AutoSuspend to avoid repeatedly poking the system when computing the standby schedule delay).
* OneTimeMigration: Don't forget about `NETWORK_PROXY` & `STARDICT_DATA_DIR` when migrating `defaults.persistent.lua` (fix #9573)
* WakeupMgr: Workaround an apparent limitation of the RTC found on i.MX5 Kobo devices, where setting a wakealarm further than UINT16_MAX seconds in the future would apparently overflow and wraparound... (fix #8039, many thanks to @yfede for the extensive deep-dive and for actually accurately pinpointing the issue!).
* Kobo: Handle standby transitions at full CPU clock speeds, in order to limit the latency hit.
* UIManager: Properly quit on reboot & exit. This ensures our exit code is preserved, as we exit on our own terms (instead of being killed by the init system). This is important on platforms where exit codes are semantically meaningful (e.g., Kobo).
* UIManager: Speaking of reboot & exit, make sure the Screensaver shows in all circumstances (e.g., autoshutdown, re: #9542)), and that there aren't any extraneous refreshes triggered. (Additionally, fix a minor regression since #9448 about tracking this very transient state on Kobo & Cervantes).
* Kindle: ID the upcoming Scribe.
* Bump base (https://github.com/koreader/koreader-base/pull/1524)
2022-10-02 03:01:49 +02:00
weijiuqiao
05aba404b7
Keyboard: add Chinese stroke-based layout (#9572)
Basically it uses 5 keys for 5 basic stroke types and
inputs characters by their stroke order.
See https://en.wikipedia.org/wiki/Stroke_count_method
2022-10-02 01:58:36 +02:00
NiLuJe
4d48b6e2fe
Misc: Use the ^ operator instead of math.pow (#9550)
And some minor code simplifications, thanks to @zwim ;).
2022-09-28 01:11:34 +02:00
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.
2022-09-28 01:10:50 +02:00
hius07
46f729c248
ConfigDialog: show button with default values in spinwidgets (#9558) 2022-09-25 08:37:22 -04:00
hius07
46cdf8ed78
TextViewer: add navigation buttons (#9539) 2022-09-22 08:46:15 +02:00
NiLuJe
b0d8919399
ImageViewer: Followup to #9529 (#9544)
* ImageViewer: Minor code cleanups
* GestureDetector: Fix the `distance` field of `two_finger_pan` & `two_finger_swipe` gestures so that it's no longer the double of the actual distance traveled. Get rid of existing workarounds throughout the codebase that had to deal with this quirk.
2022-09-21 23:26:22 +02:00
NiLuJe
38919c22eb
ImageViewer: Clamp zoom factor to sane values (#9529)
Should avoid egregious values that would potentially alloc insanely large buffers (and likely fail to do so).

In the process, tweak the scale_factor computations when zooming so as to produce slightly less annoying behavior.
2022-09-19 23:25:18 +02:00
hius07
b81a407690
Profiles: add QuickMenu (#9526) 2022-09-17 18:11:03 -04:00
hius07
e89d856ad9
textboxwidget: add math.floor (#9516) 2022-09-13 19:04:03 -04:00
hius07
56388aa491
TextViewer: add Find (#9507) 2022-09-13 17:09:49 -04:00
poire-z
76a7d83079 CRE/ImageViewer: get scaled blitbuffer when long-press on SVG
Get a Lua userdata wrapping a crengine LVSvgImageSource object
when long-press on a SVG image, and have crengine/LunaSVG render
it smoothly scaled to the requested size by ImageViewer.
2022-09-12 00:40:08 +02:00
zwim
d972b7fcfa
[core] Remove a bunch of superflous semicolons (#9449) 2022-09-08 21:52:06 +02:00
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 ;).
2022-09-04 02:38:27 +02:00
poire-z
d352579d06
BookMap: allow tap on ToC titles and outside page slots (#9400)
This helps jumping to page when ToC chapters are short
and the bookmap page rows narrow.
Also fix crash when invoking BookMap and PageBrowser
on a PicDocument (considered DocLess by Statistics).
2022-08-03 08:45:45 +02:00
weijiuqiao
30915546f0
vocabbuilder.koplugin: always show more button, add book filtering (#9393)
Always show more button instead of delete regardless of review count per #9383.
Adds book filtering per #9256 (from menu or by swiping up).
2022-07-31 09:02:09 +02:00
hius07
460d42293a
PathChooser: add creating folder (#9354) 2022-07-27 12:02:37 -04:00
hius07
bff1e8deb7
InputText: fix 'number' hint (#9362)
When input_type == "number" convert the hint to "string" type.
Closes #9359.
2022-07-26 12:04:40 +02:00
poire-z
b6f951e523
Screensaver: add option to require a gesture after resume (#9316) 2022-07-11 13:50:28 +02:00
poire-z
3fd550bd50 TouchMenu: don't allow swipe south to close menu
This is mostly needed because opening the menu with swipe
is actually done by handling a pan south event, and so the
final swipe event is another event, that is then handled
by TouchMenu, which would straight away close itself.
2022-07-08 21:18:42 +02:00
poire-z
eb883b8a94 TouchMenu: add swipe south to go back to parent menu 2022-07-07 00:32:07 +02:00
Frans de Jonge
3ffa65d24f
[chore] NumberPickerWidget: remove stray newline in string (#9302) 2022-07-06 21:47:28 +02:00
zwim
16d35f61aa
NumberPickerWidget: add method to avoid min-max checks and input math expressions. (#9182) 2022-07-05 18:23:38 +02:00
poire-z
e4eb1c61d1 Footnote popup: allow using book font as popup font
Also move footnote popup settings into a submenu.
2022-06-25 19:53:50 +02:00
NiLuJe
6ea292ef13 ImageWidget: Always return a bb, even on decoding failure.
(In which case we return a checkerboard pattern).

ScreenSaver: Make sure the choose image/folder/document settings
report what the code actually does on empty settings...
2022-06-13 02:37:01 +02:00
zwim
def02846ec
AutoDim: Don't update footer if not necessary (#9192) 2022-06-12 19:16:46 +02:00
poire-z
c825d50c8f CRE: add "CJK width scaling" option
The setting is handled like all other bottom menu options
but, as it's really not useful and its target audience is
very limited, make it not shown in the bottom menu, but
available via another button in the (also quite not useful)
Word Expansion fine tuning widget.
2022-06-06 01:08:59 +02:00
zwim
05d51997f1
SpinWidget, DoubleSpinWidget: add units to bottom menu (#9126)
* Units to bottom menu

* add ¹’¹ to 96dpi
2022-06-04 09:35:33 +02:00
weijiuqiao
e1b137339c
[feat, plugin] Vocabulary builder (#9132)
Made the old dictionary lookup history into a flashcard-ish vocabulary builder.
2022-05-31 22:11:35 +02:00
zwim
5a033f1221
DateTimeWidget: don't make ":" and "/" translatable (#9145)
* And the ellipsis
2022-05-29 22:32:16 +02:00
NiLuJe
ae5b2d68ca
AutoSuspend: Don't send LeaveStandby events from a zombie plugin instance (#9124)
Long story short: the LeaveStandby event is sent via `tickAfterNext`, so if we tear down the plugin right after calling it (in this case, that means that the very input event that wakes the device up from suspend is one that kills ReaderUI or FileManager), what's in UIManager's task queue isn't the actual function, but the anonymous nextTick wrapper constructed by `tickAfterNext` (c.f., 
https://github.com/koreader/koreader/issues/9112#issuecomment-1133999385).

Tweak `UIManager:tickAfterNext` to return a reference to said wrapper, so that we can store it and unschedule that one, too, in `AutoSuspend:onCloseWidget`.

Fix #9112 (many thanks to [@boredhominid](https://github.com/boredhominid) for his help in finding a repro for this ;)).
Re: #8638, as the extra debugging facilities (i.e., ebb81b9845) added during testing might help pinpoint the root issue for that one, too.

Also includes a minor simplification to `UIManager:_checkTasks`, and various other task queue related codepaths (e.g., `WakeupMgr`) ;).
2022-05-25 23:36:41 +02:00
zwim
d5d5867d4e
DoubleSpinWidget, SpinWidget: add units, make usage more consistent (#9046) 2022-05-24 00:25:50 +02:00
zwim
13274d6212
datetimewidget: simpler usage, allows 2 to 6 numberpickers for date and time (#9070) 2022-05-23 20:32:59 +02:00
yparitcher
8f316b1e8c
Merge discardEvents & inhibitInput (#9065)
Rename `discardEvents` to `inhibitInputUntil`
only discard Input events
2022-05-23 13:52:52 +02:00
NiLuJe
60b043ebe9
ReaderFooter: Refresh the footer on frontlight state changes issued by the frontlight widget (#9084)
c.f, https://www.mobileread.com/forums/showpost.php?p=4220159&postcount=7
2022-05-09 08:36:13 +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
zwim
9b9cfe29a4
[feat] Replace TimeVal (RIP) with time, fixed point time seconds (#8999) 2022-05-05 21:00:22 +02:00
NiLuJe
86c35ad066
A host of low power states related tweaks (#9036)
* Disable all non power management related input during suspend. (This prevents wonky touch events from being tripped when closing a sleep cover on an already-in-suspend device, among other things).
* Kobo: Use our WakeupMgr instance, not the class.
* WakupMgr: split `removeTask` in two: 
* `removeTask`, which *only* takes a queue index as input, and only removes a single task. Greatly simplifies the function (i.e., it's just a `table.remove`).
* `removeTasks`, which takes an epoch or a cb ref, and removes *every* task that matches.
* Both of these will also *always* re-schedule the next task (if any) on exit, since we can have multiple WakeupMgr tasks queued, but we can only have a single RTC wake alarm set ;).
* `wakeupAction` now takes a `proximity` argument, which it passes on to its `validateWakeupAlarmByProximity` call, allowing call sites to avoir having to duplicate that call themselves when they want to use a custom proximity window.
* `wakeupAction` now re-schedules the next task (if any) on exit.
* Simplify `Kobo:checkUnexpectedWakeup`, by removing the duplicate `WakerupMgr:validateWakeupAlarmByProximity` call, now that we can pass a proximity window to `WakeuoMgr:wakeupAction`.
* The various network activity timeouts are now halved when autostandby is enabled.
* Autostandby: get rid of the dummy deadline_guard task, as it's no longer necessary since #9009.
* UIManager: The previous change allows us to simplify `getNextTaskTimes` into a simpler `getNextTaskTime` variant, getting rid of a table & a loop.
* ReaderFooter & ReaderHeader: Make sure we only perform a single refresh when exiting standby.
* Kobo: Rewrite sysfs writes to use ANSI C via FFI instead of stdio via Lua, as it obscured some common error cases (e.g., EBUSY on /sys/power/state).
* Kobo: Simplify `suspend`, now that we have sane error handling in sysfs writes.
* Kobo.powerd: Change `isCharging` & `isAuxCharging` behavior to match the behavior of the NTX ioctl (i.e., Charging == Plugged-in). This has the added benefit of making the AutoSuspend checks behave sensibly in the "fully-charged but still plugged in" scenario (because being plugged in is enough to break PM on `!canPowerSaveWhileCharging` devices).
* AutoSuspend: Disable our `AllowStandby` handler when auto standby is disabled, so as to not interfere with other modules using `UIManager:allowStandby` (fix #9038).
* PowerD: Allow platforms to implement `isCharged`, indicating that the battery is full while still plugged in to a power source (battery icon becomes a power plug icon).
* Kobo.powerd: Implement `isCharged`, and kill charging LEDs once battery is full.
* Kindle.powerd: Implement `isCharged` on post-Wario devices. (`isCharging` is still true in that state, as it ought to).
2022-05-01 23:41:08 +02:00
hius07
428edf90bd textviewer: add close_callback 2022-04-17 09:37:29 +02:00
Tesseract Cat
e38a82453a
ImageViewer: allow browsing images list with keys (#8927) 2022-04-14 09:28:07 +02:00
Philip Chan
77accf6546
Non-touch: highlight movement improvement and enable page crop (#8947) 2022-04-14 08:59:36 +02:00
poire-z
658991ed5e SpinWidgets: keep movable position/alpha after Apply
Since eda8379e8c, on Apply, the widget is fully rebuild,
and was repositionned at its initial position (centered)
and fully opaque.
2022-04-11 22:42:56 +02:00
NiLuJe
930fa9ac1f Make sure InputText has a consistent API, regardless of hasDPad
Fix #8967
Regression since #8859
2022-04-05 02:07:53 +02:00
NiLuJe
2aa310a931
ScreenSaver: Minor refactor to avoid code duplication and weird rotation shenanigans (#8943)
* Handle said rotation shenanigans inside ScreenSaver & ScreenSaverWidget, which allows a more targeted approach; and prevents said rotation from affecting other widgets. (Also, gets rid of duplicated code).
* Handle the corner-case or exiting early from a "keep on screen for n sec" screensaver better, by unscheduling the extra refresh, since an early tap took care of that already.
2022-04-02 18:21:40 +02:00
NiLuJe
23bce343bb
ButtonProgressWidget: Make hold_callback optional (#8940)
We don't need one in FrontLightWidget ;).

Fix https://github.com/koreader/koreader/issues/8913#issuecomment-1074915143
2022-03-22 20:38:23 +01:00
NiLuJe
d761b62076
FrontLightWidget: Unbreak warmth on full-granularity devices (#8935)
Fix #8913
Regression since #8856

Change tacks, to allow full granularity with the +/- buttons.
2022-03-22 09:58:29 +01:00
Utsob Roy
357bc65217
Keyboard: add Bengali Probhat layout (#8887)
Add keyboard with Bengali Probhat layout.
Bump koreader-fonts for added Noto Sans Bengali UI,
and include it among our fallback fonts.
2022-03-15 23:13:13 +01:00
NiLuJe
217a73f3c0
Initial Kindle PW5 support (#8856)
* Rejig frontlight warmth API to more closely match the existing API, and, hopefully, clarify some of its quirks, and reduce boilerplate and duplicate code in platform implementations.
* Tweak Kindle:setDateTime to prefer using the platform's custom script, as in interacts better with the stock UI. And make the fallbacks handle old busybox versions better.
* Add Kindle PW5 support ;).
* Add warmth support to the Kindle platform.
* Random TextBoxWidget cleanups: make sure we immediately free destroyed instances.
* FrontLightWidget: Refactor to make it slightly less obnoxious to grok and update; i.e., separate layout from update, and properly separate brightness from warmth handling. Move to simpler widgets instead of reinventing the wheel.
* TextBoxWidgets: Implement `setText` to match TextWidget's API, as some callers may be using the two interchangeably (i.e., Button).
* NaturalLightWidget: Make sure we pass a string to InputText
* InputText: Add debug guards to catch bad callers not passing strings ;).
2022-03-14 19:56:18 +01:00
Philip Chan
4f849c23ab
Non-touch: highlight support (#8877)
readerhighlight: non-touch support
focusmanager: fix same type container share same selected field
radiobuttonwidget: non touch support
sortwidget: non touch support
openwithdialog: fix layout contains textinput, checkboxes added to layout twice
2022-03-12 12:16:50 +01: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
poire-z
831488b9e9
Bidi: keep invert() generic, handle settings in ReaderView (#8876)
Follow up to 42dd5aad. Handle settings only in
ReaderView:shouldInvertBiDiLayoutMirroring().
2022-03-08 21:27:11 +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
59a63c11b1
RadioButtonTable: CheckButton does not have onFocus (#8847)
Fixes #8841
2022-02-27 09:02:47 +01:00
hius07
ee593e6b17 naturallightwidget: revert movable 2022-02-22 16:30:22 +01:00
hius07
ed4290089b frontlightwidget: revert movable 2022-02-22 16:30:22 +01:00
yparitcher
73bb76f92d menu: separate indentation from text 2022-02-20 16:09:39 +01:00
yparitcher
60f68023d8 BD invert: enable for TOC BookMap & PageBrowser 2022-02-20 16:09:39 +01:00
yparitcher
62c6c757cc _mirroredUI do not set at require time 2022-02-20 16:09:39 +01:00
hius07
8bb08b503a
Cloud storage: enhance download dialog, fix Dropbox uploading (#8809)
(1) ButtonDialogTitle: new method setTitle()

(2) OPDSbrowser
-use setTitle() instead of open/close ButtonDialogTitle (no visual changes to the download dialog)
-reduce logger.info output to avoid flooding crash.log

(3) CloudStorage
-enhance download dialog (similar to OPDS), much optimized code of downloadFile
-fix a bug: cannot create new folder or upload files to the root of the Dropbox storage
2022-02-17 10:53:15 +01:00
hius07
c7666221ec Pathchooser: add folder shortcuts 2022-02-07 22:08:26 +01:00
hius07
b02ffa7c10 RadioButtonTable: RadioButton replaced with CheckButton with RadioMark 2022-02-07 22:02:54 +01:00
hius07
e7b3952fa2 CheckButton: insert RadioMark 2022-02-07 22:02:54 +01:00
hius07
aaa3a980f3 NaturalLightWidget: insert TitleBar, movable 2022-02-07 22:01:22 +01:00
hius07
fe19ca2478 FrontLightWidget: insert TitleBar, movable 2022-02-07 22:01:22 +01:00
poire-z
5e224d541f
PageBrowser: allow changing nb of chapter levels shown (#8772)
Instead of using the depth configured in Book map, start
with max depth, and allow decreasing (and reseting when
at 0) with long-press on the (i) top left icon.
2022-02-05 01:46:24 +01:00
hius07
12344261f0
RadioMark: down shift (#8771) 2022-02-04 06:08:07 +02:00
hius07
cb7e670c4a
MultiInputDialog: do not refresh full screen on show (#8760)
Fix ugly full screen flashing on show.
2022-02-02 20:31:24 +01:00
hius07
99edc53919 BookStatusWidget: insert TitleBar 2022-02-02 17:05:28 +01:00
NiLuJe
0408816a54 ReaderFooter: Take the PowerCover into account in the battery level
widget

Since we only use a single icon, we have to take a few shortcuts:

* The icon itself is computed based on the average of both batteries.
* The actual value is the sum of both batteries.
* Much like everywhere else, charging means the *aux* battery charging
  (i.e., connected to a power source).

Re #8741, which does the same for ReaderHeader.
2022-02-02 00:37:05 +01:00
hius07
c1c89dd611
TouchMenu: use radio buttons for single choice menu items (#8757) 2022-02-01 20:56:28 +01:00
poire-z
f764a61b69 KeyValuePage: allow for more fancy callbacks
Add support for hold_callback.
Provides kv_page and kv_item to callbacks.
Allow for item removal and refresh.
2022-01-31 23:57:48 +01:00
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.
2022-01-28 22:59:25 +01:00
Philip Chan
978aa2006a
FocusManager:focusTopLeftWidget(): only if hasDPad (#8737)
Focusing (highlighting/inverting) widgets should not
happen on touch devices withoud DPad.
2022-01-28 22:55:26 +01:00
zwim
f2557a7aa6
Terminal emulator: full rewrite, real vt52 emulator (#8636)
New real terminal emulator, replacing the old plugin.
The emulator is basically a vt52 terminal (enriched with
some ANSI-sequences, as ash, vi and mksh don't behave well
on a vt52 term).
So far working: ash, mksh, bash, nano, vi, busybox, watch...
The input supports: tab-completion; cursor movement;
backspace; start of line, end of line (long press);
page up, page down (long press).
User scripts may be placed in the koterm.koplugin/scripts/
folder, aliases can be put in the file aliases and startup
command in the file profile.user in that folder.
2022-01-28 20:33:09 +01:00
poire-z
eb5e0f9be2 BookMap: long-press on (i) to switch current/initial views 2022-01-25 21:33:19 +01:00
poire-z
95b35ec669 Allow any multiswipe to close some fullscreen widgets
For consistency with BookMap and PageBrowser widgets
where swipe south (the usual gesture to quick close)
can't be used for closing and we had to use any
multiswipe instead, allow any multiswipe to close
these other fullscreen widgets too:
Menu (ToC, Bookmarks), KeyValuePage, ImageViewer,
BookStatusWidget, ReaderProgress, CalendarView.
2022-01-25 21:33:19 +01:00
Philip Chan
3af268dd7a
Non-Touch: improve bottom menu usability (#8712)
- FocusManager: allow managing sub widgets by merging their
  "layout" in the main one; make "press" support simpler by
  handling it as a fake tap event at the center of the
  focused widget.
- Setup gestures on non-touch devices for new focus manager.
- ToggleSwitch: use child layout.
- ButtonProgressWidget: use child layout.
- SpinWidget and DoubleSpinWidget: add keyboard navigation.
2022-01-25 01:32:46 +01:00
hius07
2e49b780bd InputText clipboard: disable Paste if empty 2022-01-24 22:27:45 +01:00
hius07
0cdbe91e2a KeyboardLayoutDialog: insert TitleBar 2022-01-24 22:27:45 +01:00
hius07
a3e901dcd3 OpenWithDialog: movable, addWidget 2022-01-24 22:27:45 +01:00
poire-z
16e3b2f0ac Allow Backspace to work as back button 2022-01-24 08:50:47 +01:00
John Beard
ccc49036aa Handle arrow keys and enter in emulator text fields 2022-01-24 08:50:47 +01:00
comphilip
f468f873bd
Support non-touch device to choose file or folder (#8696)
## Background
`pathchooser.lua` does not support non-touch device to choose file or folder due to those device cannot generate long press event.

## Choose File
Non-touch device can select file in list, it is good enough to choose file without long press to confirm.

## Choose Folder
`pathchooser.lua` changes the label of current directory `.` to `Long-press to choose a folder`. It is user friendly, while for non-device, it is a very good place to let user tell the system I want the current folder to be chosen without extra long press.
2022-01-21 18:28:04 +01:00
hius07
7783d9c8e3
InputDialog: insert TitleBar (#8695)
into InputDialog, MultiInputDialog, OpenWithDialog, LoginDialog widgets.
2022-01-20 12:36:35 +02:00
NiLuJe
dc98384177 PowerD: Add a framework to report the status of auxiliary batteries
Implement it on the Kobo Sage, for the PowerCover

TouchMenu: Display auxiliary battery status

Kobo: More accurately report the PowerCover's charging status

i.e., try to actually figure out if the auxiliary battery is charging
instead of just checking the reader's battery (because that one will
often swap between the charging and discharging state as it drains the
aux battery...).

PowerD: Use a cached timestamp when doing battery pull checks
2022-01-19 12:44:35 +01:00
poire-z
0216493c43 Wikipedia: rework wiki languages internal handling
Fix various issues with stacked Wikipedia lookup results,
and follow up lookups when invoked from Wikipedia lookup
history (where going to a search for language LL would
not use language LL when hitting "Full wikipedia").
2022-01-19 12:23:38 +01:00