Commit Graph

105 Commits (bf6c0cdd6c5b22bbb38497b5df8abe428eb80307)

Author SHA1 Message Date
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
poire-z 24424e505e Update UI layout code to use new SVG icons
- Add IconWidget, use it for icons instead of ImageWidget.
  Specify icons by name only, look for them (with either
  .svg or .png suffixes) in multiple directories (including
  koreader/settings/icons/ to allow customizing them).
  Don't crash when icon name not found, shown a black
  background warning icon instead.
- Don't trust the icons' native sizes: replace
  scale_for_dpi=true with width/height=DGENERIC_ICON_SIZE,
  so all icons get the same (tunable) size - except in
  a few specific use cases.
- Top and bottom menu bars: normalize, and have icons
  properly centered in them, extend vertical line
  separators up to the edges.
- TOC: adjust expand/collapse icons size to items size
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
NiLuJe 931f01ef26
Kobo: Warn on restart if the startup script is outdated (#6916)
* Warn on restart if the startup script has been updated, because a restart will not reload it.

* Also warn right after the update if it contained a startup script update...
3 years ago
yparitcher 70f89c4df1
ReaderGesture: cleanup (#6292)
convert all gesture actions to use events for better modularity
add network event handlers and device event handlers
4 years ago
Frans de Jonge 4a65cc666b
[UX] Implement hasFewKeys prototype (#6195)
This is a quick exploration into how the new Device:hasFewKeys() method could work to make things more usable on very limited devices.

In the reader, the right is repurposed to open the menu. Left in turn closes it.

The same principle is applied to ButtonDialog. This means you can select anything in principle, but once you go right you can't go back.

References <https://github.com/koreader/koreader/issues/4029>.
4 years ago
poire-z 46221985a6
Delegate "lastfile" management to ReadHistory (#6128)
Simplify (and avoid edge cases) in other code by having
ReadHistory manage the "lastfile" setting on add, remove,
rename...
Fixed a few other cases of things not updated.
4 years ago
poire-z 0599c440cc [RTL UI] Bidi-wrap filenames, paths, urls, metadata
bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
  as using LTR isolates seems uneeded when already LTR" (part
  of a628714f) which was a wrong assumption: we need proper
  wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
  trailing \n.

- Wrap all paths, directories, filenames in the code with
  these wrappers.
- Wrap all book metadata (title, authors...) with BD.auto(),
  as it helps fixing some edge cases (like open/close quotation
  marks which are not considered as bracket types by FriBiDi).
  (Needed some minor logic changes in CoverBrowser.)

- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
  following the recent addition of the page_gap_height option.
4 years ago
poire-z 7952fa2c09 [RTL UI] update widgets and apps for UI mirroring
Small tweaks all around to handle UI mirroring:
- swap existing symbols like arrows, or use alternative ones
- rotate some images, like chevrons and dogear icons
- flip some left and right swipe handling
- flip some geometry arithmetic like tap on left or right
  side of page or dict window
- use new ProgressWidget:getPercentageFromPosition() instead
  of geometry arithmetic
- BD.wrap() some concatenated string bits, like in reader
  and menu footers
- flip inverse_reading_order when UI is mirrored

More specific tweaks:
- ReaderGesture: reset some specific gestures when UI direction
  has changed (tap on top/bottom left/right corners, for
  bookmarks and FileManager "Plus menu").
- ReaderRolling: show markers on the correct side of page,
  in single or dual page mode.
- KoptOptions: swap left and right icons in Alignment toggle
- CheckMark: proper rendering in all 4 mirroring/rtl combinations.
- VirtualKeyboard: forbid any mirroring
- Move util.getMenuText into Menu.lua
4 years ago
poire-z 240b75ac50
Fix screensaver menu stability (#5499)
With some particular document switching workflows, the
screensaver menu could lose its last item, and shrink
to having zero item, and eventually cause a crash.
5 years ago
Frans de Jonge 1db7f2e444
[fix] Try to make screensaver settings slightly less error-prone (#5460)
Regression inadvertently caused by #5369.

With the way this is constructed, this is almost guaranteed to happen.

Fixes #5459.
5 years ago
Robert 939538cc25 [UX] Add gesture - poweroff and restart device (#5202)
Also abstract canRestart, canReboot and CanPowerOff.
5 years ago
poire-z 7396abebf2 [chore] reformat all gestures "overrides" to be diff friendly 5 years ago
poire-z 44529dbbc9 Fix tap for top menu occasionally not working
It was missing some ordering hints to have it always
precede taps to change page.
(Somehow noticed only when we reached > 32 gestures
registered, which may have introduced some shuffling,
while previously the addition order was somehow
preserved...)
5 years ago
Frans de Jonge 5b30ea1920
[fix, UX] Common menu & info menu: switch to dofile (#4713)
Require is kept in memory, including the modifications made to it by MenuSorter. This can cause trouble when switching between the FileManager and Reader.

Fixes #4703.
5 years ago
Frans de Jonge 9a92792551
[feat, UX] Gesture manager: add option - open previous document (#4641)
Fixes #4333.
5 years ago
Martín Fernández 23f1597246 android: disable exit menu 5 years ago
poire-z 2b9694d7d2 [fix] Ensure "Open last/previous" point to existing files (#4367) 6 years ago
Robert 4428ecb422 Plugin manager (#4159)
Also adds descriptions to all plugins.
6 years ago
Robert 00cfc469f1 Allow selecting a single image as screensaver (#4095) 6 years ago
poire-z 8b3432ae76 Reader menu: adds "Open previous document" (#4056)
* Reader menu: adds "Open previous document"

Allows for quick switching between 2 documents, and keep
symmetry with FileManager menu "Open last document".

* Use "Last:" and "Previous:" when Show filename
6 years ago
poire-z 07713be429
Adds "Better rendering of list items" to Style tweaks (#3968)
Alternate rendering of list items as block elements (instead of
inline/final).
Check the built DOM is still coherent with styles on stylesheet
change, and propose to reload the document if not. Also
invalidate cache on close in that case so a new DOM is built
at next opening.
ReaderStyleTweak: fix tweak css duplication; when globally
enabled, when disabling and re-enabling locally, the css would
be added twice to the final CSS.
Also adds !important to "sub_sup_smaller" tweak, and increase
its priority so it can override "font_size_all_inherit".
Adds CreDocument:getCacheFilePath() for futur features.
6 years ago
onde2rock e8aab49ee9 Kindle4NT improvements (#3745)
* [device][kindle4] add fake event to kindle4

* modify focusmanager to allow for more complex layout

The focusmanager now naviguate the layout by avoiding nil value
instead of relying on table lenght. It should be completely backward
compatible

* add Dpad naviguation to the touchmenu

* fix crash because virtualkeyboard on non touch device

the kindle4NT has no keyboard nor touch, the fix open the virtual
keyboard so koreader dont crash but it's not useable

* Enable device with keys to use the touchmenu

* Don't get stuck in reader progress statistics plugin

* [underlinecontainer] Fix and remove unused function

References #1898.
6 years ago
poire-z 35df1749b2
Screensaver: a few tweaks and fixes (#3619)
When no manually added specific 'poweroff' or 'reboot' screensaver
settings, use the suspend/sleep settings set via menu with an added
overlay message in top right corner.
Generalized some settings: "White background behind message and images"
and "Stretch covers and images to fit screen", and move "Exclude this
book's cover from screensaver" up a level (and remove this menu item
added by ReaderMenu when closing document).
Don't use memory cache with rendered screensaver images.

ImageWidget: fix wrong behaviour (stretch) when 'file', 'width',
'height' and 'scale_factor' provided: now, keep aspect ratio.
ImageWidget: increase file image mem cache (mostly used for icons)
from 2 to 5MB to be ready for devices with very high DPI.
6 years ago
Mahmoud Nagy 6e303e7372 Swipe down or tap on top left/right to access left/right reader menu tab directly (#3595) 6 years ago
Robert efa0d06df9 Add new options to screensaver (#3535)
* Prevent open screensaver more than one in the same time

* Add option to enable/disable background in message screensaver

* fallback to random images if this book cover is excluded feature + fix Disabled (leave screen/page as it is)

* Autostretch disable by default, more fallback options, leave screen as it is
6 years ago
Frans de Jonge 1515753621
[UX] Always show screensaver menu in reader (#3471)
* Add enabled_func on relevant settings

Fixes https://github.com/koreader/koreader/issues/3470
7 years ago
Robert 9ea2b3dbad Option to disable show bottom menu on top menu activation (#3316) 7 years ago
Frans de Jonge a39db783c0 [SDL] Add quit through regular window manager actions (#3206)
* [SDL] Add quit through regular window manager actions

Depends on https://github.com/koreader/koreader-base/pull/506

* proper exit and fix bug in restart function as a bonus
7 years ago
Frans de Jonge 177485f84f [UX] Add exit menu (#3167)
* fixes #2898 (prevents accidentally triggering reboot or poweroff)
  Add ConfirmBox before reboot/power off
* increases clarity by preventing second page
* add "sleep" menu entry
* Add exit menu hold callback
7 years ago
robert00s 64529b5391 Option to choose gesture to open menu 7 years ago
Huang Xin 8938786472 [fix] stop propagation of tap events when triggering reader menu (#2934)
* [fix] stop propagation of tap events
when triggering reader menu
And also get rid of unnecessary screen refreshes on Kindle Voyage.
The "progress" window for dict lookup is also eliminated as most of the time dict lookup is an instant process, and the "progress" window is preserved for wikipedia lookup as it may take longer time to show the result window.

* [up] add an option to disable dictionary fuzzy search

* [fix] tidy up require

* [fix] fix read settings
7 years ago
Frans de Jonge 28524a5847 ReaderUI: return to filemanager instead of quitting if no document (#2956)
This affects #2335, at least for documents covered by `validDjvuFile()` (see 76cef07c07/frontend/document/djvudocument.lua (L15-L23)). However, that's only with regard to `touch invalid.djvu` and should not affect whatever happened in the OP.
7 years ago
chrox fef18ec73a [fix] revert removing tap gestures to show menus
as the tap gesture on the upper part (mostly) of the screen is
a conventional design to show menus in almost all ereaders as well as
some mobile phone apps. While users not farmilar with the Android world
have no experience with swipe down to show menus that's why we need a
quick start guide for this feature. And experienced Koreader users
probably will turn pages by mistake each time they want to popup the menus.

The solution here is adding back the tap gestures as they were and keep
the new swipe to show menu feature as a supplementary function when
link's tap area blocks menu's tap area.
7 years ago
Hzj_jie 30378eb2a8 Add restart koreader function and ensure FlushSettings event can be delivered to all widgets (#2772) 7 years ago
Qingping Hou 55ec64a859 readermenu(fix): override pan gesture from scrolling 7 years ago
Qingping Hou 72ae80870c quickstart fix (#2804)
* translation text fix

* quickstart(fix): go back to home dir after document close

* quickstart(fix): purge old quick start files

* spec: fix quickstart tests
7 years ago
Qingping Hou f2671a3e20 plugin(fix): catch crash in addToMainMenu 7 years ago
Frans de Jonge 89099e2c94 Swipe for menu and quickstart guide (#2761)
* Swipe for menu and quickstart guide

Because swiping for the menu is a big change from what we're used to, this commit includes a new quickstart guide.

Fixes #2608.

* add some dev docs
* add FileConverter spec
* add QuickStart spec
* add Version module
* add Version spec
7 years ago
Qingping Hou 1922b2526b fix: normalize require path to reuse import result 7 years ago
Robert 9a247e86ae Screensaver on Kindle without Special Offers (#2757) 7 years ago
Qingping Hou f51285e89b revert code that enables screensaver on kindle by default 7 years ago
Robert 59873ae293 Screensaver option on Kindle devices (#2734)
* Screensaver on Kindle devices
7 years ago
Hzj_jie ea2de9638b LuaSettings:wrap() / LuaSettings:child() function to create an LuaSettings to represent a sub table of an existing one (#2685) 7 years ago
Frans de Jonge bdbda9b405 ReaderMenu: fix MenuSorter-related typo (#2689)
Fixes #2688
7 years ago
Frans de Jonge 8b7e18a7d7 MenuSorter: resolve review comments
* simplify user config loop
* simplify unit test for Travis memory use
* remove unused util variable
7 years ago
Frans de Jonge ddf590eb6d MenuSorter: split out menu order configuration 7 years ago
Frans de Jonge 8f31a81601 MenuSorter: some documentation
MenuSorter: forgot to add plugin style change

MenuSorter: worked out the final quirks

* Menu always compressed into tables without missing indexes for ipairs compatibility
* Orphans attached
* Separators no longer count as items
7 years ago
Frans de Jonge b7b5950e98 MenuSorter: review comments and various bug fixes
* fixed wrongful retention of submenus variable and added return to MenuSorter:findById
* fixed readerfooter_spec.lua error
* fixed review comments
7 years ago
Frans de Jonge aa0bf60ccb MenuSorter: pass config prefix for proper user override 7 years ago