Commit Graph

65 Commits (7210fb478d8d0c6aa5bb8e0ae3e0fc67dd730874)

Author SHA1 Message Date
poire-z b7b4cdd2a7 ConfigDialog: fix possible crash (#4838)
When one has set a default for toggles thad don't have 'values' in
their definitions (possibly only Orientation).
5 years ago
poire-z b16aa79636
ConfigDialog ButtonProgress: black border on default item (#4805)
Make the default (user set, or KOReader's default) item
among the button progress squares shown with a black border.
5 years ago
poire-z c060595580
ConfigDialog: fix ButtonProgressWidget and some refreshes (#4793)
This internal ButtonProgressWidget widget was behaving
differently from all others (OptionTextItem, OptionIconItem
and ToggleSwitch) by duplicating some code from
ConfigDialog:onConfigChoose() instead of calling it directly.

While making it similar to others, I noticed that onConfigChoose()
did a full repaint, which was necessary for some settings to
be applied (ie: Contrast).
On CreDocument, this full repaint may cause some double drawing
on config changes (ie: Margins, drawing once after margin changes,
and then re-positionning to previous xpointer).
So, make the need for full repaint a condition on KoptOptions.
5 years ago
poire-z 9560bc2061
ConfigDialog: fix some gray mismatch in prev commit (#4797)
Remove gray underline on text items (font size items).
Adjust gray color of ButtonProgressWidget to match the
one of ToggleSwitch (just need to invert it, as it's
used to select button, which cause this color to be
inverted).
5 years ago
NiLuJe 2011cf1ad1 Various blitting related cleanups (#4789)
* Fix the "Enable debug logging" checkbox so that it properly disables "Enable verbose debug logging" when it gets disabled
* Avoid asking ImageWidget for alpha-blending when it's not useful
* Make ImageWidget's alpha-blending code-path double-check that alpha-blending actually is needed, and avoid it if possible
* In the same vein, only do alpha-blending in textboxwidget when absolutely necessary
* Prefer color constants over the gray() method, ensuring that they're part of the eInk palette

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

Fix #4774
5 years ago
poire-z 779909343c [UX] ButtonProgressWidget: thin grey buttons instead of black (#4700)
May help with ghosting when closing bottom dialog,
and fit better with the other grey toggles.
5 years ago
Frans de Jonge 1d1dc74290 [UX] creoptions: add more margin values
Fixes #4684.
5 years ago
NiLuJe 8189945be9
A few graphics fixes after #4541 (#4554)
* Various FocusManager related tweaks to limit its usage to devices with a DPad, and prevent initial button highlights in Dialogs on devices where it makes no sense (i.e., those without a DPad. And even on DPad devices, I'm not even sure how we'd go about making one of those pop up anyway, because no Touch ;)!).
* One mysterious fix to text-only Buttons so that the flash_ui highlight always works, and always honors `FrameContainer`'s pill shape. (Before that, an unhighlight on a text button with a callback that didn't repaint anything [say, the find first/find last buttons in the Reader's search bar when you're already on the first/last match] would do a square black highlight, and a white pill-shaped unhighlight (leaving the black corners visible)).
The workaround makes *absolutely* no sense to me (as `self[1] -> self.frame`, AFAICT), but it works, and ensures all highlights/unhighlights are pill-shaped, so at least we're not doing maths for rounded corners for nothing ;).
5 years ago
NiLuJe 812e595608
Enable HW dithering in a few key places (#4541)
* Enable HW dithering on supported devices (Clara HD, Forma; Oasis 2, PW4)
  * FileManager and co. (where appropriate, i.e., when covers are shown)
  * Book Status
  * Reader, where appropriate:
    * CRe: on pages whith image content (for over 7.5% of the screen area, should hopefully leave stuff like bullet points or small scene breaks alone).
    * Other engines: on user-request (in the gear tab of the bottom menu), via the new "Dithering" knob (will only appear on supported devices).
  * ScreenSaver
  * ImageViewer
* Minimize repaints when flash_ui is enabled (by, almost everywhere, only repainting the flashing element, and not the toplevel window which hosts it).
  (The first pass of this involved fixing a few Button instances whose show_parent was wrong, in particular, chevrons in the FM & TopMenu).
* Hunted down a few redundant repaints (unneeded setDirty("all") calls),
  either by switching the widget to nil when only a refresh was needed, and not a repaint,
  or by passing the appropritate widget to setDirty.
  (Note to self: Enable *verbose* debugging to catch broken setDirty calls via its post guard).
  There were also a few instances of 'em right behind a widget close.
* Don't repaint the underlying widget when initially showing TopMenu & ConfigDialog.
  We unfortunately do need to do it when switching tabs, because of their variable heights.
* On Kobo, disabled the extra and completely useless full refresh before suspend/reboot/poweroff, as well as on resume. No more double refreshes!
* Fix another debug guard in Kobo sysfs_light
* Switch ImageWidget & ImageViewer mostly to "ui" updates, which will be better suited to image content pretty much everywhere, REAGL or not.

PS: (Almost 💯 commits! :D)
5 years ago
poire-z 77ec8e32e9 ConfigDialog: tweak widths computation
Small fixes to widths computation for a more balanced layout.
Decreased min width of names (on the left) from 33% to 25%, to
allow more room for toggles on the right.
(May make things a little bit too stretched out with english,
but should help with other languages that use longer words to
name things than english.)

Also ignore disabled option names in the names width calculation
(noticable on the PDF right most config menu, where toggles were
uneededly too small)
5 years ago
poire-z 872c908a02 [UX] ConfigDialog: larger tap area around font and icons (#4351)
The font size items (Aa Aa ... Aa) and the align & column
items (for PDF) had a non-tapable spacing between them,
which could make hitting an item difficult.
This replaces this spacing by padding on each side of the item,
so a tap in between will always catch one item, for easier
selection.
6 years ago
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
Robert 895372f781 Show current and default values in config dialog (pdf) (#3973) 6 years ago
Robert da65db191b Show current and default values in config dialog (epub) (#3952)
when long-press on the title strings on the left of the buttons
6 years ago
onde2rock dfd87447da [UX] Make the reader bottom menu compatible with key navigation (#3785)
* [toggleswitch] Add support for key navigation to this widget

Add the onFocus an onUnfocus event handler
add a new function that just circle the switch if not touch event is
detected

* Add key navigation to the readermenu

The shortcut is still Alt-gr on sdl, to be defined on Kindle

* Remove the old method of handling the Press key.

Now the event is handled by the main widget who implement focusmanager
and then dispatched to the currently focused item.
Modify the fine font tuning only for non touch-devices

See : https://github.com/koreader/koreader/pull/3785#issuecomment-375306466
6 years ago
poire-z c93bbec40d
cre: more constrast settings (#3737)
Use ButtonProgress like it was done for kopt.
6 years ago
poire-z 8192a2f947 Small decrease of ToggleSwitches width
Just to add some margin, needed on large screen DPI
7 years ago
poire-z 445926ab1c Fix live refresh when changing pdf contrast
nextTick somehow prevented a full refresh of the screen
scheduleIn, as used by other widgets, makes that ok
7 years ago
Robert 0def547162 More contrast settings (#3463)
Close: #2133 
More info: #2133
7 years ago
Robert 198c151125 ConfigDialog improvements 2 (#3455)
+ Fix height for ToggleWidget
+ Able ToggleWidget width more than half of width of screen
7 years ago
Robert 369cf4f102 [UX] Improve ConfigDialog (#3443) 7 years ago
Frans de Jonge 0fc5a378bc [UX] Add home button (#3263)
Tap to go HOME. Hold to set current folder as HOME. When no HOME is set yet tap also asks to set current folder as HOME.

See https://github.com/koreader/koreader/issues/2957#issuecomment-308513062

Closes #3200.
7 years ago
poire-z 9448a52515 [UX] Smaller bottom menu icons (#3257)
And unrelated small optimisation in imagewidget
7 years ago
Frans de Jonge a6be301695 Added Size module 7 years ago
Frans de Jonge 9eb073a524 [travis] Add protection against unscaled sizes
As pointed out by @poire-z

* [fix, UX] SkimToWidget scaling

* [fix] Button scaling

* [fix, UX] Scale ProgressWidget

* [fix, UX] Scale confirmbox

* [fix, UX] Scale just about everything
7 years ago
poire-z bccbf95080 Add horizontal_padding to IconButton (#3213)
TouchMenu (top menu) and ConfigDialog (bottom menu) updated
to make use of that. This provides a wider sensitivity to
menu buttons.
7 years ago
Robert 56345fd8c0 Fix moving icons in config panel (#3211) 7 years ago
Robert 85e2140ced Show position on config panel (#3194) 7 years ago
robert00s 5e402419ed Swipe down to close config menu 7 years ago
Robert bd92d68b7f Remove Set default Fine Tuning (#2971) 7 years ago
Frans de Jonge e8721887ba InputContainer: add cancel_text and ok_text
Makes it easier to comply with UX style.

* Change "OK" to "Search dictionary" in Dictionary lookup to comply with UX style
* Change "OK" to "Search all text" in Fulltext search to comply with UX style

Tacked on but highly related:

* change "OK" to "Search Wikipedia" in Wikipedia lookup to comply with UX style
* change "OK" to "Set default" in ConfigDialog to comply with UX style

Chore:

* fixed up order of requires
7 years ago
Frans de Jonge 1e351e6b87 Menu: remove "Show advanced options"
See #2610 for discussion.
7 years ago
Qingping Hou f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 7 years ago
Zijie He 1aa0c4192a Multi-line toggle switch & add instruction to resolve sdcv build error. 8 years ago
Qingping Hou 3c647ff244 minor: various luacheck fixes 8 years ago
NiLuJe 50dbf6b581 Switch a few widgets to ui refresh modes
More closely matches native behavior on REAGL devices.
Closing those widgets should still trigger a partial refresh though,
because we usually get back to the reader, and text, so we want REAGL
;).
9 years ago
chrox 72012e97e1 disable reflow options when reflow is not ON
This should also fix #1061.
9 years ago
Hans-Werner Hilse 94ce08937a clean up refreshes
This is a larger clean-up of the refresh situation.
The general shift is that refreshes are now mainly triggered by
the (top-level) widgets when they get shown or closed via UIManager.

All refreshes for the widgets when they are in use were handled by
themselves before. This adds the case of showing/closing.

It is the desired result of not having UIManager:show()/:close()
do (full screen) refreshes on its own.
10 years ago
Hans-Werner Hilse 6793a4fee1 reader config dialog: properly refresh config pane
This serves as a good example for the way refreshes are done:
setDirty("all", function() ... end)
* the "all" will have all widgets on screen repainted.
  In this case that is needed because the config pane has
  different sizes, covering different parts of underlying
  widgets. So they need to be repainted every time.
* the function will return the area to refresh and is evaluated
  after painting. In this example, we take the area that is covered
  by the config pane before switching it (if present at all), and
  hand it to the refresh area function as an upvalue.
  When the function is called later after painting, it will
  use that saved area and combine it with the area that is covered
  then by the widget. That way, parts that are covered no more are
  included in the refresh area, too.
10 years ago
Hans-Werner Hilse 82c26b1f18 adapt widgets to new refresh/repaint API 10 years ago
Frans de Jonge 693fa0837e Reworked several strings
This is the remaining gruntwork of #1276. I believe that only leaves networkmgr.lua and filemanagersearch.lua, which will require a little more thought.
10 years ago
Hans-Werner Hilse 22697adf20 switch from scaleByDPI() to scaleBySize() 10 years ago
chrox 3574865dcb fix #1166 by auto alignment of option name 10 years ago
chrox e66801039b refactoring: reuse IconButton for config menu bar 10 years ago
NiLuJe 88c26b4112 Make ConfigDialog updates regional 10 years ago
Hans-Werner Hilse 3066c86e38 Refactoring hardware abstraction
This is a major overhaul of the hardware abstraction layer.
A few notes:

General platform distinction happens in
  frontend/device.lua
which will delegate everything else to
  frontend/device/<platform_name>/device.lua
which should extend
  frontend/device/generic/device.lua

Screen handling is implemented in
  frontend/device/screen.lua
which includes the *functionality* to support device specifics.
Actually setting up the device specific functionality, however,
is done in the device specific setup code in the relevant
device.lua file.

The same goes for input handling.
10 years ago
Hans-Werner Hilse 5982e24d57 unify color specification
colors were a mixture of 4bpp integers (0=white, 15=black) and
fractional blackness levels (0=white, 1.0=black) before. This is
now unified to use the color specification of the Blitbuffer API.
10 years ago
chrox 30898a3cd8 config line space/font gamma values directly 10 years ago
chrox e91ddee836 add advanced option type that only shown when show advanced options is selected 10 years ago
chrox 0615e1463f easier strings to translate 10 years ago