Skip to content

Commit b763956

Browse files
committed
improve layout
1 parent 9998b9d commit b763956

3 files changed

Lines changed: 31 additions & 7 deletions

File tree

src/SCRIPTS/TOOLS/ExpressLRS/ui/lvgl.lua

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -949,9 +949,15 @@ function UI.createFolderWidget(pg, field, width)
949949
end
950950

951951
function UI.createCommandWidget(pg, field)
952-
pg:button({
953-
text = field.name or "",
952+
local wrapper = pg:box({
954953
w = lvgl.PERCENT_SIZE + 100,
954+
flexFlow = lvgl.FLOW_COLUMN,
955+
align = CENTER,
956+
borderPad = { top = lvgl.PAD_TINY, bottom = lvgl.PAD_TINY },
957+
})
958+
wrapper:button({
959+
text = field.name or "",
960+
w = lvgl.PERCENT_SIZE + 99,
955961
press = function()
956962
Protocol.handleCommandSave(field)
957963
end,
@@ -1026,9 +1032,15 @@ function UI.build()
10261032
local currentFolder = Navigation.getCurrent()
10271033

10281034
if currentFolder == Navigation.FOLDER_OTHER_DEVICES then
1035+
local devicesBox = fieldContainer:box({
1036+
w = lvgl.PERCENT_SIZE + 100,
1037+
flexFlow = lvgl.FLOW_COLUMN,
1038+
flexPad = lvgl.PAD_SMALL,
1039+
borderPad = lvgl.PAD_TINY,
1040+
})
10291041
for _, device in ipairs(Protocol.devices) do
10301042
if device.id ~= Protocol.deviceId then
1031-
fieldContainer:button({
1043+
devicesBox:button({
10321044
text = device.name or "Unknown",
10331045
w = lvgl.PERCENT_SIZE + 100,
10341046
press = function()
@@ -1095,7 +1107,13 @@ function UI.build()
10951107
end
10961108

10971109
if currentFolder == nil and #Protocol.devices > 1 and not Navigation.hasDeviceEntry() then
1098-
fieldContainer:button({
1110+
local wrapper = fieldContainer:box({
1111+
w = lvgl.PERCENT_SIZE + 100,
1112+
flexFlow = lvgl.FLOW_COLUMN,
1113+
align = CENTER,
1114+
borderPad = lvgl.PAD_TINY,
1115+
})
1116+
wrapper:button({
10991117
text = "Other Devices",
11001118
w = lvgl.PERCENT_SIZE + 100,
11011119
h = lvgl.UI_ELEMENT_HEIGHT * 2,

src/WIDGETS/ELRSVTXAdmin/loadable.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,14 +1079,20 @@ local function buildFullScreen()
10791079
Protocol.writeConfig()
10801080
end)
10811081

1082-
fields:button({
1082+
local sendWrapper = fields:box({
1083+
w = lvgl.PERCENT_SIZE + 100,
1084+
flexFlow = lvgl.FLOW_COLUMN,
1085+
align = CENTER,
1086+
borderPad = { top = lvgl.PAD_SMALL, bottom = lvgl.PAD_SMALL },
1087+
})
1088+
sendWrapper:button({
10831089
text = function()
10841090
if Protocol.isSending() then
10851091
return "Sending..."
10861092
end
10871093
return "Send VTx"
10881094
end,
1089-
w = lvgl.PERCENT_SIZE + 100,
1095+
w = lvgl.PERCENT_SIZE + 99,
10901096
press = function()
10911097
Protocol.writeConfig()
10921098
Protocol.pushToVtx()

test/SCRIPTS/CRSFSimulator/csrfsimulator.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
-- "no_module" No CRSF module found at all. Triggers the "No Module
3333
-- Found" error dialog immediately.
3434
local config = {
35-
scenario = "no_telemetry",
35+
scenario = "normal",
3636
}
3737

3838
-- ============================================================================

0 commit comments

Comments
 (0)