mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Update UI layout code to use new SVG icons
- 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
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
local BD = require("ui/bidi")
|
||||
local Device = require("device")
|
||||
local Geom = require("ui/geometry")
|
||||
local ImageWidget = require("ui/widget/imagewidget")
|
||||
local IconWidget = require("ui/widget/iconwidget")
|
||||
local InputContainer = require("ui/widget/container/inputcontainer")
|
||||
local RightContainer = require("ui/widget/container/rightcontainer")
|
||||
local Screen = Device.screen
|
||||
@@ -32,8 +32,8 @@ function ReaderDogear:setupDogear(new_dogear_size)
|
||||
end
|
||||
self[1] = RightContainer:new{
|
||||
dimen = Geom:new{w = Screen:getWidth(), h = self.dogear_size},
|
||||
ImageWidget:new{
|
||||
file = "resources/icons/dogear.png",
|
||||
IconWidget:new{
|
||||
icon = "dogear.opaque",
|
||||
rotation_angle = BD.mirroredUILayout() and 90 or 0,
|
||||
width = self.dogear_size,
|
||||
height = self.dogear_size,
|
||||
|
||||
Reference in New Issue
Block a user