[lvgl] Automatically pad rows and columns (#11879)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Clyde Stubbs
2025-11-26 11:53:51 +10:00
committed by GitHub
parent e071380532
commit 1207b9e995
2 changed files with 7 additions and 1 deletions

View File

@@ -172,10 +172,14 @@ class DirectionalLayout(FlexLayout):
def validate(self, config):
assert config[CONF_LAYOUT].lower() == self.direction
config[CONF_LAYOUT] = {
layout = {
**FLEX_HV_STYLE,
CONF_FLEX_FLOW: "LV_FLEX_FLOW_" + self.flow.upper(),
}
if pad_all := config.get("pad_all"):
layout[CONF_PAD_ROW] = pad_all
layout[CONF_PAD_COLUMN] = pad_all
config[CONF_LAYOUT] = layout
return config

View File

@@ -552,6 +552,7 @@ lvgl:
scroll_snap_y: center
scroll_snap_x: start
layout: vertical
pad_all: 6px
row: 0
column: 0
dir: ALL
@@ -1049,6 +1050,7 @@ lvgl:
opa: 0%
- id: page3
layout: Horizontal
pad_all: 6px
widgets:
- keyboard:
id: lv_keyboard