Commit Graph

172 Commits (5871132c2559f5456ca4b8398957a7e6832c190e)

Author SHA1 Message Date
NiLuJe 5871132c25
UI Behavior tweaks (#3983)
* Switch all initial highlights to "fast" update

i.e., everything that does an invert
Plus a few other things that refresh small UI elements onTap
Re #3130

* Tweak refreshtype for a number of widgets:
  * Fix iconbutton dimen
  * Make touchmenu flash on close & initial menu popup. Full-screen on close.
  * Use flashing updates when opening/closing dictionary popup. Full-screen on close.
  * Switch FileManager to partial.
    It's mostly text, and we want flash promotion there.
  * Make configdialog & menu flash on exit
  * Make FLWidget flash on close
  * virtualkeyboard: flash on layout change & popup.
  * Potentially not that great workaround to ensure we actually see the
highlights in the FM's chevrons
  * Flash when closing BookStatus Widget
  * Optimize away a quirk of the dual "fast" update in touchmenu

* Promote updates to flashing slightly more agressively.

* Document what each refreshtype actually does.

With a few guidelines on their optimal usecases.

* Switch remaining scheduleIn(0.0) to nextTick()

* Tighter scheduling timers

Shaving a hundred ms off UI callbacks...

* Cache FFI C Library namespace

* Ask MuPDF to convert pixmaps to BGR on Kobo

Fix #3949

* Mention koxtoolchain in the README

re #3972

* Kindle: Handle *all* fonts via EXT_FONT_DIR instead of bind mounts insanity

* Make black flashes in UI elements user-configurable

(All or nothing).

* Jot down some random KOA2 sysfs path
6 years ago
onde2rock e502bf04d3 [feat, UX] Support the virtualKeyboard on non touch-device (#3796)
* [VirtualKeyboard] Add support for keynaviguation

Also rename the variable "layout" to "keyboard_layout" because conflict
with the layout from the focusmanager

* Make the goto dialog compatible with key naviguation

My solution is to change the order of the widget. The last one will the
virtualkeybard so it catch all the keybinding, and below it, make the
dialog "is_always_active = true" so it can receive touch event.

* Correctly show the virtual keyboard on dpad devices

* change the order to call the virtualKeyboard so it end up on top

* Handle the multi input dialog

* Support reopening the virtualKeyboard by the Press key

* add check focusmanager

* Fix https://github.com/koreader/koreader/issues/3797

* MultiInputDialog : Now work on non touch-device

* Set the virtualkeyboard to be a modal widget

* Fix the layout in multiinputwidget

* Fix for the various combination of
hasKeys,hasDpad,isTouchDevice

* [Focusmanager] Better handling of malformed layout
6 years ago
Frans de Jonge 3ead3f0da4
[fix] Kobo suspend when touching screen (#3809)
As in https://github.com/koreader/koreader/issues/3706#issuecomment-370336452 Suspend kept being rescheduled on every touch while we should just ignore it.

Fixes #3706.
6 years ago
poire-z 5e47a83e6a
UIManager: avoid painting widgets covered by a full screen widget (#3770)
Navigating the TOC, viewing a full screen image, browsing
reading stats... would call paintTo() on ReaderUI (so, asking
the engine to render the page) or FileManager (so, rendering cover
images) even though their content is hidden.
Widgets registering to UIManager have to explicitely states
they cover the full screen (UIManager can't know, parts of their
dimen may be transparent, e.g. if it is a CenterContainer).
6 years ago
poire-z 0ef948f60d Trapper: adds dismissableRunInSubprocess() + new TrapWidget
New TrapWidget: invisible full screen widget for catching UI events. Can
optionally display a text message at bottom left of screen (ie: "Loading..."),
used by default by Trapper:dismissable functions when no widget provided.
Added Trapper:dismissableRunInSubprocess() to run a lua function in
a sub-process, allowing it to be dismissed, and returns its return
value(s).
6 years ago
Fabian Müller-Knapp 88c03c08d1 Partial fix for 3477 (#3568)
Partial, as it will safe the state when suspending the reader by pressing the power-button.

However, it will still not safe the state when Pocketbooks autoPowerOff-Feature kicks in, as this does not create an event (e.g. no EVT_BACKGROUND) of any kind.

* Clean up device.lua

* Save state on suspend
6 years ago
Ben Kelly f9ac8b138b Basic fixes to calibre-sync (#3558)
* Properly create intermediate directories when receiving books from Calibre.

This fixes an issue where you can't receive books except into directories that
already exist on the Kobo, which, in particular, causes problems when your
configuration in Calibre is something like "put books in $Author/$Title.epub"
and you haven't previously synced any books by that author.

* Wake up periodically to process ZMQs if any are registered.

This fixes an issue where if there are any timed events (such as the suspend
timer) in the queue, ZMQ events may not get processed until the timed event
fires, which is a problem when (for example) the suspend timer goes off in
an hour and you have something trying to send a book to the kobo over wifi
*right now*.

With this change, the event loop will wake up every 50ms to check for ZMQ
events and process them if necessary. If there are no ZMQs registered (which
is typical), it uses the original behaviour -- so this won't affect battery
life under normal usage.
6 years ago
poire-z 71553a5190 Change a logger.warn() back to .dbg() as it used to be 7 years ago
Frans de Jonge cfaa119c35 [fix, UX] Allow modal widget on top of modal widget (#3170)
Fixes #2653.
7 years ago
poire-z d4fd0b9428 frontlight on kobo: a few fixes (#3163)
* frontlight on kobo: a few fixes

Rewritten to not update NickelConf on every change, and never
if KOBO_SYNC_BRIGHTNESS_WITH_NICKEL = false.
Reintroduce global settings frontlight_intensity and
is_frontlight_on to keep level and state across koreader
sessions.
Fix a few of the remaining issues on kobo light.
Ensure settings are saved when rebooting/powering off from
File browser.

* Ensure untoggle works when starting with light off
7 years ago
Hzj_jie 7d2ed4c3d0 Move kobo auto-suspension logic out of UIManager (#2933) 7 years ago
Hzj_jie 53eb4dee50 AutoFrontlight plugin (#2941)
* Add AutoFrontlight plugin

* Add configuration to control autofrontlight feature
7 years ago
Hzj_jie 30378eb2a8 Add restart koreader function and ensure FlushSettings event can be delivered to all widgets (#2772) 7 years ago
Martín Fernández 474c011f21 [kobo]: add reboot and poweroff menu actions (#2888) 7 years ago
Qingping Hou f2671a3e20 plugin(fix): catch crash in addToMainMenu 7 years ago
Frans de Jonge f1c0b4b3bb UIManager docs & lang: add some docs and correct "quiting" to "quitting" 7 years ago
Hzj_jie 3ad3452d1a System Stat plugin (#2699) 7 years ago
Hzj_jie 1a2e4f5b55 Force Kobo to suspend (#2691)
Without this change, the device resumed randomly. With this change, the device had not resumed randomly anymore. (Technically speaking, it still randomly resumed, but got suspended immediately.)
7 years ago
Hzj_jie 0b29e73e2e BatteryStat plugin and instruction of KoboLight plugin (#2643)
* Start battery stat plugin

* BatteryStat & kobolight

* Several minor improvements

* Remove a useless function

* flush settings

* Some review feedbacks

* Resolve review comments

* Remaining Minutes -> Remaining Hours

* Add dump_file

* typo

* realpath

* realpath on folder

* Remove useless os.time()

* Resolve review comments

* warning

* Add BatteryStat.debugging flag

* treat log as txt

* Minor improvement

* Charging hour should be positive

* Use warn instead of info

* onSuspend in Kobo

* Charging events for kobo and kindle

* More events

* dumpOrLog

* Warnings

* Typo

* More space

* Singleton

* slightly format change

* BatteryStat singleton

* Init

* Remove debugging flag

* sleeping percentage is still negative

* Read settings

* Do not need to change was_suspending and was_charging

* Typo

* Remove debugging flag

* Not charging should happen before suspend

* Resolve review comments

* was_suspend and was_charging should be updated each time in onCallback()
7 years ago
Qingping Hou f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 7 years ago
poire-z adbe76c156 Reset refresh rate counter on explicit full refreshs (#2394) 8 years ago
Bastien Dejean 64bc5cd63c Make the powered off state customizable
This changes the behavior of the powered off transition phase for the
Kobo devices: instead of displaying a confirmation dialog, a screensaver
is used after a 2 seconds press delay.

Users can specify separate directories/files/messages for the powered
off and sleeping states through the `path` and `message` attributes of
the `{poweroff,suspend}_screensaver` settings.

Fixes #2327 and closes #2306.
8 years ago
Qingping Hou 816d0a551a kobo: handle charging/uncharging event 8 years ago
Zijie He f36f8cb464 KOSync plugin should respect onNetworkConnected and onFlushSettings events 8 years ago
Qingping Hou 902403bf0a kobo(fix): prevent usb plug events from interrupting sleep 8 years ago
Qingping Hou 71afe3606c kobo(fix): set suspend wait timeout to 15 seconds
Otherwise, suspend might fail and the device will ended up in a false
sleep state and drain the battery.
8 years ago
Qingping Hou 4036e2c460 kobo(fix): do not wake up device when cover is closed 8 years ago
Qingping Hou 93b3262db7 kobo(fix): make sure sleep cover is not interrupting sleeping when ignore_power_sleepcover is set 8 years ago
Qingping Hou 22964a77a0 kobo(fix): always put device to suspend state when cover is closed 8 years ago
Qingping Hou ebc7055b43 chore: move kobo specific code into kobo/device.lua 8 years ago
chrox b0498ec9b9 revert 9ab005a changes to UIManager:sendEvent
which would make readerui handle swipe event twice.

And use broadcastEvent to emit `FlushSettings` event.

This should fix #2225 and fix #2226.
8 years ago
chrox 166aa52a24 move painting and drawing debug log to verbose 8 years ago
chrox 9ab005a1d3 fix unit test of readerlink and readerpaging
and have more confidence with the unit testing framework.

Now `make testfront` won't retry on failure and testing files are
ordered in each run so that it's possible to reproduce testing failure.

And this patch also fix flush settings not working before suspend issue:
at some point the `FlushSettings` event is sent to `UIManager` instead
of `ReaderUI`, but `UIManager` only delegated events to active widgets
and `ReaderUI` is actually not an active widgets thus will miss the event.

This patch also add a verbose debug mode with "-v" as a switch to turn
on this mode. With verbose mode on, event handling will be logged.
8 years ago
bingo619 43797ed813 Oasis orientation 8 years ago
chrox 41c79407b9 diable double tap by default in the widget stack
This should fix #2141 and fix #2130.
8 years ago
chrox 551857ce6e fix some luacheck warnings 8 years ago
chrox 03fda94562 fix #2110 by adding disable double tap option in screen options 8 years ago
chrox 3d7fe1002c we should disable double tap by default
Currently only column-zoom mode in PDF uses double tap gesture.
8 years ago
Qingping Hou 7d13d00eff uimanager(fix): honor second when calling Input:waitEvent 8 years ago
Qingping Hou fadad90447 uimanager(fix): handle stack change in close 8 years ago
Qingping Hou af2f3c30c7 uimanager(fix): handle last widget in broadcast event properly 8 years ago
chrox 5983050d79 PDF free zoom mode revisit
this should implement feature request of zoom mode for multi-columns
page in #501
This PR depends on koreader/koreader-base#435

How to use?
1. Tap the top left corner of a PDF/Djvu page to get into the flipping
mode
2. Double-tap on text block will zoom in to that column
3. Double-tap on any area will zoom out to an overview of the page
4. repeat step 2 to focus to another page block

How does it work?
1. We first find the mask of text blocks in the page. (Pic 1)
2. Then we intersect page boxes with user tap to form a page block. (Pic 2)
3. Finally we zoom the page to the page block and center current view to
that block. (Pic 3)
8 years ago
Qingping Hou ce7ae2dfac uimanager(fix): handle edge case where second widget in stack is ignored 8 years ago
Qingping Hou 8268d8d32c test(fix): clean up after screenshot test 8 years ago
Qingping Hou a92a88e063 uimanager(fix): check active widgets in the correct order 8 years ago
Qingping Hou 42dde82c43 uimanager(minor): simplify suspend event handler's signature 8 years ago
Cosmin Gorgovan 19338cb439 Kobo: Offer to power off if the power button is held for at least 3 seconds 8 years ago
Cosmin Gorgovan 18c0cee18f UIManager: add method for broadcasting an event to all widgets 8 years ago
Qingping Hou eb71d29716 kodev(minor): fix arg test 8 years ago
Qingping Hou 0166ff8add reader(fix): force draw info message before loading document
Since the doShowReader will run in nextTick, it will get picked up by
checkTask, which is in the beginning of next UI loop and blocks
UIManager from redrawing the screen for the info popup.
8 years ago