This commit is contained in:
Insality 2024-11-20 02:44:45 +02:00
parent 606f400719
commit f2fa5320d2
3 changed files with 13 additions and 4 deletions

View File

@ -129,16 +129,16 @@ end
function M:on_button_left()
self:add_value(true)
self:add_step(-1)
end
function M:on_button_right()
self:add_value(false)
self:add_step(1)
end
function M:add_value(is_left)
local koef = is_left and -1 or 1
---@param koef number -1 0 1, on 0 will not move
function M:add_step(koef)
local array_type = self.array_type
if array_type then
local value = self.value
@ -165,6 +165,7 @@ function M:set_number_type(min, max, is_loop, steps)
steps = steps or 1,
is_loop = is_loop,
}
return self
end

View File

@ -11,6 +11,7 @@ function M:init()
:set_text_adjust("scale_when_trim_left", 0.3)
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:add_container("text_name", nil, function(_, size)

View File

@ -281,4 +281,11 @@ function M:set_properties_per_page(properties_per_page)
end
function M:set_page(page)
self.current_page = page
self.paginator:set_value(self.current_page, true)
self:refresh_page()
end
return M