2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
Commit Graph

4087 Commits

Author SHA1 Message Date
Hans-Werner Hilse
ff0fbbdb4b fix widget closing 2014-12-01 16:21:42 +00:00
Hans-Werner Hilse
844c1babf7 UIManager:_refresh(): no more default refresh
If no refresh type is specified, don't do a refresh.
There should be now refresh types specified in all relevant places.
2014-12-01 16:03:41 +00:00
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.
2014-12-01 16:03:40 +00:00
Hans-Werner Hilse
9c4088a3ac small change of UIManager:show(): No more automatic refresh
This eliminates the API difference between the extra parameters of
UIManager:show() and setDirty(). They work the same now.
Note that this also eliminates the automatic refresh that took place
before when using show() without refresh options. It always refreshed
the full screen, which led to too big refresh regions all over the
place. Thus, refresh has now explicitly to be asked for, hopefully
encouraging to implement it in the widget that gets shown (and is
aware about the screen region it covers).

Also add an event that is triggered when a widget is closed:
CloseWidget. So a widget can implement "onCloseWidget()" to trigger
actions upon closing - most commonly, this is a refresh for the area
previously taken by the widget. That way, the widget's user does not
have to take measures to ensure that the area is refreshed later.
2014-12-01 14:42:38 +00:00
Frans de Jonge
2c1eacdbf5 Merge pull request #1314 from chrox/master
make coverage in after_success stage
2014-12-01 14:50:31 +01:00
chrox
20fd6f902e fix #1175 2014-12-01 15:32:12 +08:00
chrox
d6c4465c47 fix coverage test fails on OPDS browser module
for some reason luxl.lua has problem when being set hook for luacov
2014-12-01 14:46:17 +08:00
chrox
6a0554f226 make coverage in after_success stage
So that if the coverage job is timeout it won't fail the
CI result.
2014-12-01 14:43:01 +08:00
Huang Xin
ddae003925 Merge pull request #1310 from hwhw/master
fixes for scrolling, fix for double-refresh, misc stuff
2014-12-01 09:56:04 +08:00
Hans-Werner Hilse
e8642fbad7 use API for refresh when closing widgets in message popups 2014-11-30 22:35:08 +00:00
Hans-Werner Hilse
1091a8a3b9 add refresh control to UIManager:close() 2014-11-30 22:35:07 +00:00
Hans-Werner Hilse
e7f7417cd3 refresh only dialog part of the screen for multi-word selection window 2014-11-30 22:33:38 +00:00
Hans-Werner Hilse
143c56c48c record ButtonDialog.dimen 2014-11-30 22:33:38 +00:00
Hans-Werner Hilse
8376e2f821 dictionary window triggers refresh itself, not via show() 2014-11-30 22:33:37 +00:00
Hans-Werner Hilse
afb59667c0 allow for more control on refreshes when show()ing widgets
for now, we have show() automatically call setDirty() for the new
widget, as before. However, now show() takes two arguments for
refresh configuration that will get passed on to setDirty().

For compatibility, the default is here in show() to do a partial
refresh. So if you want no refresh triggered (via this show() call),
add a function that doesn't return anything.
2014-11-30 22:33:36 +00:00
HW
33e93342f7 Merge pull request #1312 from Frenzie/master
OPDS: refactored unit test and fixed a minor bug with undefined image_rel
2014-11-30 22:14:07 +01:00
Frans de Jonge
47d7a48555 OPDS: refactored unit test and fixed a minor bug with undefined image_rel 2014-11-30 21:44:47 +01:00
Hans-Werner Hilse
3f9dc46315 fix dict window refresh
was still using old API
also, move this to another place.
2014-11-30 18:38:03 +00:00
Hans-Werner Hilse
c4a9903162 on finish of pan gesture when scrolling, do partial refresh
it was set to a full refresh. However, we want to behave as if in
non-scrolling mode and issue a partial refresh. That might get
updated to a full refresh if the full-refresh counter has reached
the limit - which is configurable.
2014-11-30 18:38:03 +00:00
Hans-Werner Hilse
745e3837e0 updating the screen in tap handler of readerfooter is not needed
Was a hack anyway, c.f.
https://github.com/koreader/koreader/pull/1306#discussion_r21057461

Seems to be not needed anymore. If some areas are now not refreshed
anymore, that ought to be fixed in another place.

This also gets rid of redundant screen flashes.
2014-11-30 18:38:02 +00:00
HW
b451b10dde Merge pull request #1311 from Frenzie/master
OPDS: embryonic unit test for OPDS browser
2014-11-30 19:36:32 +01:00
Frans de Jonge
c25254a7ec OPDS: embryonic unit test for OPDS browser
This initial seed specifically tests against what recently broke in Gutenberg and FeedBooks.
2014-11-30 19:06:27 +01:00
Huang Xin
24daab0420 Merge pull request #1309 from hwhw/master
update base: fixes for tests, libk2pdfopt without mupdf linkage
2014-12-01 01:17:09 +08:00
Hans-Werner Hilse
328169065d update base: fixes for tests, libk2pdfopt without mupdf linkage 2014-11-30 16:43:37 +00:00
Huang Xin
a485141324 Merge pull request #1306 from hwhw/master
Refresh refactoring, frontend/UIManager side
2014-11-30 23:57:12 +08:00
Hans-Werner Hilse
f02be20a65 refresh fixes for the menus
this will only refresh the areas that actually need to be refreshed.
2014-11-30 12:04:33 +00:00
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.
2014-11-30 11:50:51 +00:00
Hans-Werner Hilse
bc3ef46fbf update base: use new refresh wait queue
also pull refresh emulation improvement for emulator.
2014-11-30 11:15:54 +00:00
Hans-Werner Hilse
82c26b1f18 adapt widgets to new refresh/repaint API 2014-11-30 00:17:50 +00:00
Hans-Werner Hilse
229c5ad61c change setDirty/refresh API
See documentation in the code.
In short: There is now one single method, setDirty(), that triggers
repaints and/or refreshes.
All variables in UIManager are gone - at least from an external
perspective. Everything is done through setDirty().
This also allows for easier debugging, since all requests come
in via function calls.
2014-11-30 00:15:17 +00:00
Hans-Werner Hilse
2f9386cd69 move refresh menu table out of UIManager
no need to clutter a core file of the whole UI concept with definitions
of UI elements
2014-11-30 00:15:17 +00:00
HW
d793d73182 Merge pull request #1304 from Frenzie/master
Added some instruction about the translation of variables
2014-11-30 01:14:41 +01:00
Frans de Jonge
daccda42d8 Added some instruction about the translation of variables
Simplified building prerequisites
2014-11-29 21:46:33 +01:00
HW
abcb94d946 Merge pull request #1303 from Frenzie/language
Add missing util.template definition to readerfrontlight.lua
2014-11-29 16:34:53 +01:00
Frans de Jonge
7fd8f4d2f1 Add missing util.template definition to readerfrontlight.lua
Fixes #1302.
2014-11-29 15:45:18 +01:00
Frans de Jonge
d182810292 Merge pull request #1300 from erosennin/opds-ignore-unknown-rels
OPDS: ignore links with unknown rel values, treat empty rel as rel="subsection"
2014-11-29 12:22:55 +01:00
Andrey Golovizin
296f63b22a OPDS: ignore links with unknown rel values, treat empty rel as rel="subsection". 2014-11-29 11:15:41 +01:00
HW
cceac98180 Merge pull request #1298 from Frenzie/master
Language: prevent spaces from disappearing in localizations with util.template
2014-11-28 23:14:58 +01:00
Frans de Jonge
73a6f71a0b Prevent spaces from being eaten by Transifex
Fixes #1276
2014-11-28 22:38:54 +01:00
HW
d44c014a7f Merge pull request #1297 from Frenzie/language
OPDS catalog: auto-fill http:// if no protocol given and revert #1106
2014-11-28 22:05:10 +01:00
Frans de Jonge
7a87b66fa1 OPDS catalog: auto-fill http:// if no protocol given and revert #1106
This fixes #1259.
2014-11-28 21:58:19 +01:00
Huang Xin
1b07698952 Merge pull request #1296 from hwhw/imagewidget_alpha
Imagewidget alpha
2014-11-29 00:00:29 +08:00
Huang Xin
eeded8df7a Merge pull request #1295 from hwhw/master
fix handling of invalid UTF8 sequences
2014-11-28 23:59:27 +08:00
Hans-Werner Hilse
b2e38ca80d honor alpha when painting the dog-ear bookmark icon
allows for different icons making use of that. For our current icon,
it actually doesn't.

Fixes #402
2014-11-28 15:37:12 +00:00
Hans-Werner Hilse
0c80537003 allow image widgets to do alpha-blitting
when the image (e.g. a PNG) does contain an alpha channel, that can
be honored by ImageWidget. It doesn't do so by default for compatibility
(arguably, we should change that in the future), it has to be enabled
by setting the "alpha" property to "true" (boolean, not string).
2014-11-28 15:37:11 +00:00
Hans-Werner Hilse
a82bafc63c fix handling of invalid UTF8 sequences
external data (and in bad cases our own) can contain invalid byte
sequences in UTF8 strings. A prominent example are file names.
There was a 1-off bug in calculating the allowed length for multibyte
chars, and the iterator was a bit too greedy when stumbling upon
invalid sequences, returning a single "invalid" char for a sequence
up to the point where it became invalid in calculation. Now, we present
one invalid char for the first byte of that sequence and then check
for a valid char starting with the next byte.
2014-11-28 14:52:04 +00:00
Huang Xin
0c7e01fd87 Merge pull request #1294 from hwhw/fix_default_dict_set
show a popup upon making a dictionary the default dictionary
2014-11-28 22:03:25 +08:00
Hans-Werner Hilse
f828f6e7e4 show dictionary title in info popup when setting default dictionary 2014-11-28 13:53:42 +00:00
Hans-Werner Hilse
1156bcd057 show a popup upon making a dictionary the default dictionary 2014-11-28 13:33:04 +00:00
Huang Xin
52947cf6d1 Merge pull request #1291 from hwhw/fix_epub_code
pull base changes: fix for <code> elements in epubs
2014-11-28 21:32:08 +08:00