mirror of
https://github.com/koreader/koreader
synced 2024-11-16 06:12:56 +00:00
24424e505e
- 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
24 lines
606 B
Lua
24 lines
606 B
Lua
describe("ImageWidget module", function()
|
|
local ImageWidget
|
|
setup(function()
|
|
require("commonrequire")
|
|
ImageWidget = require("ui/widget/imagewidget")
|
|
end)
|
|
|
|
it("should render without error", function()
|
|
local imgw = ImageWidget:new{
|
|
file = "resources/koreader.png"
|
|
}
|
|
imgw:_render()
|
|
assert(imgw._bb)
|
|
end)
|
|
it("should error out on none exist image", function()
|
|
local imgw = ImageWidget:new{
|
|
file = "wtf.png"
|
|
}
|
|
assert.has_error(function()
|
|
imgw:_render()
|
|
end)
|
|
end)
|
|
end)
|