[lvgl] Automatically pad rows and columns (#11879)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user