mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #898 from houqp/houqp-master
fix(ui): hide button framecontainer background in hide() method
This commit is contained in:
@@ -50,7 +50,7 @@ function Button:init()
|
||||
self.width = widget_size.w
|
||||
end
|
||||
-- set FrameContainer content
|
||||
self[1] = FrameContainer:new{
|
||||
self.frame = FrameContainer:new{
|
||||
margin = self.margin,
|
||||
bordersize = self.bordersize,
|
||||
background = self.background,
|
||||
@@ -65,11 +65,12 @@ function Button:init()
|
||||
}
|
||||
}
|
||||
if self.preselect then
|
||||
self[1].color = 15
|
||||
self.frame.color = 15
|
||||
else
|
||||
self[1].color = 5
|
||||
self.frame.color = 5
|
||||
end
|
||||
self.dimen = self[1]:getSize()
|
||||
self.dimen = self.frame:getSize()
|
||||
self[1] = self.frame
|
||||
if Device:isTouchDevice() then
|
||||
self.ges_events = {
|
||||
TapSelect = {
|
||||
@@ -128,6 +129,8 @@ end
|
||||
|
||||
function Button:hide()
|
||||
if self.icon then
|
||||
self.frame.orig_background = self[1].background
|
||||
self.frame.background = nil
|
||||
self.label_widget.hide = true
|
||||
end
|
||||
end
|
||||
@@ -135,6 +138,7 @@ end
|
||||
function Button:show()
|
||||
if self.icon then
|
||||
self.label_widget.hide = false
|
||||
self.frame.background = self[1].old_background
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ function FrameContainer:paintTo(bb, x, y)
|
||||
self.dimen = Geom:new{
|
||||
x = x, y = y,
|
||||
w = my_size.w,
|
||||
h = my_size.h
|
||||
h = my_size.h
|
||||
}
|
||||
local container_width = self.width or my_size.w
|
||||
local container_height = self.height or my_size.h
|
||||
|
||||
Reference in New Issue
Block a user