mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 10:27:47 +02:00
Little code refactor
This commit is contained in:
parent
b5686af391
commit
32bbddb706
@ -5,6 +5,7 @@ local const = require("druid.const")
|
||||
|
||||
local M = {}
|
||||
|
||||
|
||||
--- Return number with zero number prefix
|
||||
-- @function formats.add_prefix_zeros
|
||||
-- @tparam number num Number for conversion
|
||||
|
@ -16,8 +16,8 @@ function instance.get_style(self)
|
||||
end
|
||||
|
||||
|
||||
function instance.set_style(self, component_style)
|
||||
self._meta.style = component_style
|
||||
function instance.set_style(self, druid_style)
|
||||
self._meta.style = druid_style
|
||||
end
|
||||
|
||||
|
||||
|
@ -1,10 +1,16 @@
|
||||
local const = require("druid.const")
|
||||
local druid_input = require("druid.helper.druid_input")
|
||||
local settings = require("druid.system.settings")
|
||||
|
||||
local M = {}
|
||||
|
||||
|
||||
local function input_init(self)
|
||||
-- TODO: To custom settings
|
||||
if not settings.auto_focus_gain then
|
||||
return
|
||||
end
|
||||
|
||||
if not self.input_inited then
|
||||
self.input_inited = true
|
||||
druid_input.focus()
|
||||
@ -16,6 +22,7 @@ end
|
||||
local function create(self, module)
|
||||
---@class component
|
||||
local instance = setmetatable({}, { __index = module })
|
||||
|
||||
-- Component context, self from component creation
|
||||
instance:setup_component(self._context, self._style)
|
||||
|
||||
|
@ -5,6 +5,7 @@ local M = {}
|
||||
|
||||
M.is_debug = false
|
||||
M.default_style = nil
|
||||
M.auto_focus_gain = true
|
||||
|
||||
|
||||
function M.get_text(name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user