Skip to content

Commit 201d282

Browse files
committed
feat (touch ui): added Save button
1 parent 3f7374f commit 201d282

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/SCRIPTS/RF2/LVGL/page.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,19 @@ local function show(page)
135135
end
136136
end
137137

138+
if page.isReady and not page.readOnly then
139+
children[#children + 1] = {
140+
type = "button",
141+
x = 5,
142+
y = children[#children].y + 35,
143+
w = LCD_W - 20,
144+
text = "Save",
145+
press = function()
146+
page:write()
147+
end,
148+
}
149+
end
150+
138151
for _, child in ipairs(children) do
139152
child.x = child.x * 1.75
140153
child.y = (child.y - rf2.radio.yMinLimit + 5) * 1.75

src/SCRIPTS/RF2/PAGES/esc_xdfly.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ local function receivedEscParameters(page, data)
5151
addField("LED color", escParameters.led_color)
5252
addField("Smart fan", escParameters.smart_fan)
5353

54+
page.readOnly = false
5455
rf2.onPageReady(page)
5556
end
5657

@@ -66,4 +67,5 @@ return {
6667
title = "XDFly Setup",
6768
labels = labels,
6869
fields = fields,
70+
readOnly = true
6971
}

0 commit comments

Comments
 (0)