mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-12 15:24:14 +03:00
lvgui: Allow setting style from add_button
helper
This commit is contained in:
parent
42694ea008
commit
f546b3dcb4
@ -3,7 +3,7 @@
|
||||
module LVGUI
|
||||
# Helper methods to help creating a "button palette" kind of window.
|
||||
module ButtonPalette
|
||||
def add_button(label)
|
||||
def add_button(label, style: nil)
|
||||
Button.new(@container).tap do |btn|
|
||||
add_to_focus_group(btn)
|
||||
btn.glue_obj(true)
|
||||
@ -14,6 +14,9 @@ module LVGUI
|
||||
yield
|
||||
end
|
||||
end
|
||||
if style
|
||||
Button::StyleMods.send(style, btn)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user