mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
Update
This commit is contained in:
parent
606f400719
commit
f2fa5320d2
@ -129,16 +129,16 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function M:on_button_left()
|
function M:on_button_left()
|
||||||
self:add_value(true)
|
self:add_step(-1)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:on_button_right()
|
function M:on_button_right()
|
||||||
self:add_value(false)
|
self:add_step(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:add_value(is_left)
|
---@param koef number -1 0 1, on 0 will not move
|
||||||
local koef = is_left and -1 or 1
|
function M:add_step(koef)
|
||||||
local array_type = self.array_type
|
local array_type = self.array_type
|
||||||
if array_type then
|
if array_type then
|
||||||
local value = self.value
|
local value = self.value
|
||||||
@ -165,6 +165,7 @@ function M:set_number_type(min, max, is_loop, steps)
|
|||||||
steps = steps or 1,
|
steps = steps or 1,
|
||||||
is_loop = is_loop,
|
is_loop = is_loop,
|
||||||
}
|
}
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ function M:init()
|
|||||||
:set_text_adjust("scale_when_trim_left", 0.3)
|
:set_text_adjust("scale_when_trim_left", 0.3)
|
||||||
|
|
||||||
self.text_right = self.druid:new_text("text_right", "")
|
self.text_right = self.druid:new_text("text_right", "")
|
||||||
|
--:set_text_adjust("scale_when_trim_left", 0.3) -- TODO: not works? why?
|
||||||
|
|
||||||
self.container = self.druid:new_container(self.root)
|
self.container = self.druid:new_container(self.root)
|
||||||
self.container:add_container("text_name", nil, function(_, size)
|
self.container:add_container("text_name", nil, function(_, size)
|
||||||
|
@ -281,4 +281,11 @@ function M:set_properties_per_page(properties_per_page)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function M:set_page(page)
|
||||||
|
self.current_page = page
|
||||||
|
self.paginator:set_value(self.current_page, true)
|
||||||
|
self:refresh_page()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
Loading…
x
Reference in New Issue
Block a user