mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add: status bar in reading menu & font.lua
* Since fontchooser is replaced by selectmenu, it is no longer needed. So I rewrite it into font.lua module which can cache faces that shared among all UIs. * add progressBar method in graphics.lua to draw reading progress. * add reading progress information in reading menu. It is just a demo. Should be clean up in next release when the real reading menu is out. :)
This commit is contained in:
22
graphics.lua
22
graphics.lua
@@ -5,3 +5,25 @@ blitbuffer.paintBorder = function (bb, x, y, w, h, bw, c)
|
||||
bb:paintRect(x, y+bw, bw, h - 2*bw, c)
|
||||
bb:paintRect(x+w-bw, y+bw, bw, h - 2*bw, c)
|
||||
end
|
||||
|
||||
--[[
|
||||
Draw a progress bar according to following args:
|
||||
|
||||
@x: start position in x axis
|
||||
@y: start position in y axis
|
||||
@w: width for progress bar
|
||||
@h: height for progress bar
|
||||
@load_m_w: width margin for loading bar
|
||||
@load_m_h: height margin for loading bar
|
||||
@load_percent: progress in percent
|
||||
@c: color for loading bar
|
||||
--]]
|
||||
blitbuffer.progressBar = function (bb, x, y, w, h,
|
||||
load_m_w, load_m_h, load_percent, c)
|
||||
if load_m_h*2 > h then
|
||||
load_m_h = h/2
|
||||
end
|
||||
blitbuffer.paintBorder(fb.bb, x, y, w, h, 2, 15)
|
||||
fb.bb:paintRect(x+load_m_w, y+load_m_h,
|
||||
(w-2*load_m_w)*load_percent, (h-2*load_m_h), c)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user