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

lvgui: Rework Toolbar a bit

This commit is contained in:
Samuel Dionne-Riel 2021-06-09 16:11:32 -04:00
parent 1069f1aa0a
commit f1ceb95cd9

View File

@ -2,12 +2,23 @@
class LVGUI::Toolbar < LVGUI::Widget
def initialize(parent)
super(LVGL::LVContainer.new(parent))
set_height(0)
set_fit2(LVGL::FIT::FILL, LVGL::FIT::TIGHT)
# Defaults "hidden"
set_height(0)
# And mostly transparent
set_style(LVGL::CONT_STYLE::MAIN, LVGL::LVStyle::STYLE_TRANSP.dup)
style = get_style(LVGL::CONT_STYLE::MAIN)
style.body_padding_top = 0
style.body_border_width = 0
style.body_padding_top = LVGUI.row_padding() - LVGUI.pixel_scale(10)
style.body_padding_bottom = 0
style.body_padding_left = LVGUI.col_padding()
style.body_padding_right = LVGUI.col_padding()
# Fills the width, fits content
set_fit2(LVGL::FIT::FLOOD, LVGL::FIT::TIGHT)
# Layout...
set_layout(LVGL::LAYOUT::PRETTY)
end
end