Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(radio): Fix size of fields on sensor edit page for portrait layout #4096

Merged
merged 1 commit into from
Sep 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions radio/src/gui/colorlcd/model_telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,13 +604,21 @@ class SensorEditWindow : public Page {

paramLines[P_ID] = form->newLine(&grid2);
new StaticText(paramLines[P_ID], rect_t{}, STR_ID, 0, COLOR_THEME_PRIMARY1);
auto hex = new NumberEdit(paramLines[P_ID], rect_t{}, 0, 0xFFFF, GET_SET_DEFAULT(sensor->id));
hex->setDisplayHandler([](int32_t value) {
auto num = new NumberEdit(paramLines[P_ID], rect_t{}, 0, 0xFFFF, GET_SET_DEFAULT(sensor->id));
#if LCD_H > LCD_W
// Portrait layout - need to limit width of edit box
num->setWidth((lv_pct(28)));
#endif
num->setDisplayHandler([](int32_t value) {
std::stringstream stream;
stream << std::hex << value;
return stream.str();
});
new NumberEdit(paramLines[P_ID], rect_t{}, 0, 0xff, GET_SET_DEFAULT(sensor->instance));
num = new NumberEdit(paramLines[P_ID], rect_t{}, 0, 0xff, GET_SET_DEFAULT(sensor->instance));
#if LCD_H > LCD_W
// Portrait layout - need to limit width of edit box
num->setWidth(lv_pct(28));
#endif

paramLines[P_UNIT] = form->newLine(&grid);
new StaticText(paramLines[P_UNIT], rect_t{}, STR_UNIT, 0, COLOR_THEME_PRIMARY1);
Expand Down