mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 10:02:18 +02:00
Update
This commit is contained in:
@@ -4,8 +4,7 @@ local helper = require("druid.helper")
|
||||
local component = require("druid.component")
|
||||
|
||||
---Button style params.
|
||||
---You can override this component styles params in Druid styles table
|
||||
---or create your own style
|
||||
---You can override this component styles params in Druid styles table or create your own style
|
||||
---@class druid.button.style
|
||||
---@field LONGTAP_TIME number|nil Minimum time to trigger on_hold_callback. Default: 0.4
|
||||
---@field AUTOHOLD_TRIGGER number|nil Maximum hold time to trigger button release while holding. Default: 0.8
|
||||
|
@@ -5,27 +5,6 @@ local druid_instance = require("druid.system.druid_instance")
|
||||
|
||||
local default_style = require("druid.styles.default.style")
|
||||
|
||||
--- Use empty function to save a bit of memory
|
||||
local EMPTY_FUNCTION = function(_, message, context) end
|
||||
|
||||
---@type druid.logger
|
||||
local empty_logger = {
|
||||
trace = EMPTY_FUNCTION,
|
||||
debug = EMPTY_FUNCTION,
|
||||
info = EMPTY_FUNCTION,
|
||||
warn = EMPTY_FUNCTION,
|
||||
error = EMPTY_FUNCTION,
|
||||
}
|
||||
|
||||
---@type druid.logger
|
||||
local logger = {
|
||||
trace = EMPTY_FUNCTION,
|
||||
debug = EMPTY_FUNCTION,
|
||||
info = EMPTY_FUNCTION,
|
||||
warn = EMPTY_FUNCTION,
|
||||
error = EMPTY_FUNCTION,
|
||||
}
|
||||
|
||||
|
||||
---Entry point for Druid UI Framework.
|
||||
---Create a new Druid instance and adjust the Druid settings here.
|
||||
@@ -45,13 +24,6 @@ function M.new(context, style)
|
||||
end
|
||||
|
||||
|
||||
---Set the logger for the Druid instance.
|
||||
---@param logger_instance druid.logger The logger
|
||||
function M:set_logger(logger_instance)
|
||||
self.logger = logger_instance or empty_logger
|
||||
end
|
||||
|
||||
|
||||
---Register a new external Druid component.
|
||||
---Register component just makes the druid:new_{name} function.
|
||||
---For example, if you register a component called "my_component", you can create it using druid:new_my_component(...).
|
||||
|
@@ -178,7 +178,7 @@ local function schedule_late_init(self)
|
||||
end
|
||||
|
||||
|
||||
---Druid class constructor
|
||||
---Druid class constructor which used to create a Druid's components
|
||||
---@param context table Druid context. Usually it is self of gui script
|
||||
---@param style table? Druid style table
|
||||
---@return druid.instance
|
||||
|
@@ -1,6 +1,11 @@
|
||||
local color = require("druid.color")
|
||||
local helper = require("druid.helper")
|
||||
|
||||
---Widget to display a several lines with different height in a row
|
||||
---Init, set amount of samples and max value of value means that the line will be at max height
|
||||
---Use `push_line_value` to add a new value to the line
|
||||
---Or `set_line_value` to set a value to the line by index
|
||||
---Setup colors inside template file (at minimum and maximum)
|
||||
---@class widget.mini_graph: druid.widget
|
||||
local M = {}
|
||||
|
||||
|
Reference in New Issue
Block a user