mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
use RoundedCornerRect to draw buttons frame
Also did some tunings for ConfirmBox widget.
This commit is contained in:
15
dialog.lua
15
dialog.lua
@@ -89,22 +89,24 @@ function Button:init()
|
||||
-- set FrameContainer content
|
||||
self[1] = FrameContainer:new{
|
||||
margin = 0,
|
||||
bordersize = 4,
|
||||
bordersize = 3,
|
||||
background = 0,
|
||||
radius = 15,
|
||||
padding = 2,
|
||||
|
||||
HorizontalGroup:new{
|
||||
Widget:new{ dimen = { w = 10, h = 0 } },
|
||||
HorizontalSpan:new{ width = 8 },
|
||||
TextWidget:new{
|
||||
text = self.text,
|
||||
face = Font:getFace("cfont", 20)
|
||||
},
|
||||
Widget:new{ dimen = { w = 10, h = 0 } }
|
||||
HorizontalSpan:new{ width = 8 },
|
||||
}
|
||||
}
|
||||
if self.preselect then
|
||||
self[1].color = 15
|
||||
else
|
||||
self[1].color = 0
|
||||
self[1].color = 5
|
||||
end
|
||||
end
|
||||
|
||||
@@ -114,7 +116,7 @@ function Button:onFocus()
|
||||
end
|
||||
|
||||
function Button:onUnfocus()
|
||||
self[1].color = 0
|
||||
self[1].color = 5
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -156,6 +158,7 @@ function ConfirmBox:init()
|
||||
FrameContainer:new{
|
||||
margin = 2,
|
||||
background = 0,
|
||||
padding = 10,
|
||||
HorizontalGroup:new{
|
||||
ImageWidget:new{
|
||||
file = "resources/info-i.png"
|
||||
@@ -168,7 +171,7 @@ function ConfirmBox:init()
|
||||
face = Font:getFace("cfont", 30),
|
||||
width = self.width,
|
||||
},
|
||||
VerticalSpan:new{ width = 10 },
|
||||
VerticalSpan:new{ width = 20 },
|
||||
HorizontalGroup:new{
|
||||
ok_button,
|
||||
HorizontalSpan:new{ width = 10 },
|
||||
|
||||
Reference in New Issue
Block a user