1
1
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:
Samuel Dionne-Riel 2021-06-10 17:03:14 -04:00
parent 42694ea008
commit f546b3dcb4

View File

@ -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