Another set of fixes (#4083)

* Make findcalibre actually useful

By setting SEARCH_LIBRARY_PATH when a Calibre tree is found, so that
book paths can properly be constructed.

Users should still very much set it themselves, but at least everything
works as intended when not, instead of mysteriously half-breaking later.

Drop the SetDefaults bits, it appeared to have been added to fix no-ops
detected by Luacheck, and it's actually non-functional, because
SetDefaults doesn't handle saving variables it did not itself assign.
So this was just causing the "Do you want to save new defaults" popup to
show up on exit, but it couldn't actually do anything useful (like, say,
save the new SEARCH_LIBRARY_PATH value).

fix #4082

* Better comments about the state of NaturalLight on the Clara, and how this might translate to the H2O²r2.

re #4015

* Make ScrolltextWidget refresh as "partial" only on actual Scroll events

Moving the cursor should stay "ui", or things gets annoying really fast
;).

re #4084

* Bump base to pickup ZMQ fixes (fix #4086)
This commit is contained in:
NiLuJe
2018-07-21 21:51:25 +02:00
committed by GitHub
parent d4ebcd26c9
commit fea0d8dbaf
4 changed files with 85 additions and 73 deletions

View File

@@ -108,14 +108,18 @@ function ScrollTextWidget:getCharPos()
return self.text_widget:getCharPos()
end
function ScrollTextWidget:updateScrollBar()
function ScrollTextWidget:updateScrollBar(is_partial)
local low, high = self.text_widget:getVisibleHeightRatios()
if low ~= self.prev_low or high ~= self.prev_high then
self.prev_low = low
self.prev_high = high
self.v_scroll_bar:set(low, high)
local refreshfunc = "ui"
if is_partial then
refreshfunc = "partial"
end
UIManager:setDirty(self.dialog, function()
return "partial", self.dimen
return refreshfunc, self.dimen
end)
end
end
@@ -152,22 +156,22 @@ end
function ScrollTextWidget:scrollDown()
self.text_widget:scrollDown();
self:updateScrollBar()
self:updateScrollBar(true)
end
function ScrollTextWidget:scrollUp()
self.text_widget:scrollUp();
self:updateScrollBar()
self:updateScrollBar(true)
end
function ScrollTextWidget:scrollToTop()
self.text_widget:scrollToTop();
self:updateScrollBar()
self:updateScrollBar(true)
end
function ScrollTextWidget:scrollToBottom()
self.text_widget:scrollToBottom();
self:updateScrollBar()
self:updateScrollBar(true)
end
function ScrollTextWidget:scrollText(direction)
@@ -177,12 +181,12 @@ function ScrollTextWidget:scrollText(direction)
else
self.text_widget:scrollUp()
end
self:updateScrollBar()
self:updateScrollBar(true)
end
function ScrollTextWidget:scrollToRatio(ratio)
self.text_widget:scrollToRatio(ratio)
self:updateScrollBar()
self:updateScrollBar(true)
end
function ScrollTextWidget:onScrollText(arg, ges)