mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 10:02:18 +02:00
Add first implementation of druid styles (only button)
This commit is contained in:
@@ -58,7 +58,7 @@ local function init_progress(self)
|
||||
local simple = self.druid:new_progress("simple_fill", "x", val)
|
||||
local vert = self.druid:new_progress("simple_vert_fill", "y", val)
|
||||
|
||||
simple:set_steps({0, 0.3, 0.6, 1}, function(self, step)
|
||||
simple:set_steps({0, 0.3, 0.6, 1}, function(_, step)
|
||||
print("STEP:", step)
|
||||
end)
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
local druid = require("druid.druid")
|
||||
local bounce_style = require("druid.styles.bounce.style")
|
||||
|
||||
local main_page = require("example.kenney.page.main")
|
||||
|
||||
@@ -15,6 +16,7 @@ end
|
||||
|
||||
|
||||
function init(self)
|
||||
druid.set_default_style(bounce_style)
|
||||
self.druid = druid.new(self)
|
||||
|
||||
init_top_panel(self)
|
||||
|
@@ -17,8 +17,11 @@ end
|
||||
|
||||
|
||||
local function setup_button(self)
|
||||
self.druid:new_button("button_simple", lang.toggle_locale, "button_param")
|
||||
self.druid:new_button("button_template/button", empty_callback, "button_param")
|
||||
local b = self.druid:new_button("button_simple", lang.toggle_locale, "button_param")
|
||||
self.druid:new_button("button_template/button", function()
|
||||
print(b:get_enabled())
|
||||
b:set_enabled(not b:get_enabled())
|
||||
end, "button_param")
|
||||
end
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user