Skip to content

Commit

Permalink
Set V2 number edit control to automatically resize and fit content to…
Browse files Browse the repository at this point in the history
… prevent clipping of large values.
  • Loading branch information
Phil Mitchell committed Jan 18, 2023
1 parent c45576c commit f3ee00b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions radio/src/gui/colorlcd/model_logical_switches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ class LogicalSwitchEditPage: public Page
getMixSrcRange(cs->v1, v2_min, v2_max);
v2Edit = new NumberEdit(line, rect_t{},
v2_min, v2_max, GET_SET_DEFAULT(cs->v2));
lv_obj_set_width(v2Edit->getLvObj(), LV_SIZE_CONTENT);

v2Edit->setDisplayHandler([=](int value) -> std::string {
if (cs->v1 <= MIXSRC_LAST_CH) value = calc100toRESX(value);
Expand Down

0 comments on commit f3ee00b

Please sign in to comment.