1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-12 15:24:14 +03:00

lvgui: Add header/text label helpers

This commit is contained in:
Samuel Dionne-Riel 2021-07-21 22:09:04 -04:00
parent ea26e77b7b
commit 79a900c9c1

View File

@ -30,6 +30,17 @@ module LVGUI
module BaseUIElements
def add_main_text(text, alignment: LVGL::LABEL_ALIGN::CENTER)
add_text(text, alignment: alignment)
end
def add_header(text)
LVGUI::HeaderLabel.new(@container).tap do |label|
label.text = text
label.set_width(@container.get_width_fit)
end
end
def add_text(text, alignment: LVGL::LABEL_ALIGN::LEFT)
LVGL::LVLabel.new(@container).tap do |label|
label.set_long_mode(LVGL::LABEL_LONG::BREAK)
label.set_text(text)