feat(color): Add LVGL scroll bar where needed (#3268)
* Add scroll bar to radio settings/config pages. * Add scroll bar to mode settings/config pages and screen settings pages. * For pages display via TabsGroup class. move the scroll bar setting to the 'body' window. * Fix position of new line on Inputs and Mixes pages. * chore: Bump `libopenui`
This commit is contained in:
@@ -33,6 +33,8 @@ CurveDataEdit::CurveDataEdit(Window * parent, const rect_t & rect, uint8_t index
|
|||||||
Window(parent, rect, FORM_FORWARD_FOCUS),
|
Window(parent, rect, FORM_FORWARD_FOCUS),
|
||||||
index(index)
|
index(index)
|
||||||
{
|
{
|
||||||
|
lv_obj_set_style_bg_color(lvobj, makeLvColor(COLOR_THEME_SECONDARY3), 0);
|
||||||
|
lv_obj_set_scrollbar_mode(lvobj, LV_SCROLLBAR_MODE_AUTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LCD_W > LCD_H
|
#if LCD_W > LCD_H
|
||||||
@@ -169,11 +171,6 @@ void CurveDataEdit::update()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CurveDataEdit::paint(BitmapBuffer* dc)
|
|
||||||
{
|
|
||||||
dc->clear(COLOR_THEME_SECONDARY3);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CurveEdit::SetCurrentSource(uint32_t source)
|
void CurveEdit::SetCurrentSource(uint32_t source)
|
||||||
{
|
{
|
||||||
CurveEdit::currentSource = source;
|
CurveEdit::currentSource = source;
|
||||||
|
|||||||
@@ -79,8 +79,6 @@ class CurveDataEdit : public Window
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void paint(BitmapBuffer * dc) override;
|
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ InputEditWindow::InputEditWindow(int8_t input, uint8_t index) :
|
|||||||
auto box = new Window(&body, rect_t{});
|
auto box = new Window(&body, rect_t{});
|
||||||
auto box_obj = box->getLvObj();
|
auto box_obj = box->getLvObj();
|
||||||
lv_obj_set_flex_grow(box_obj, 2);
|
lv_obj_set_flex_grow(box_obj, 2);
|
||||||
|
lv_obj_set_scrollbar_mode(box->getLvObj(), LV_SCROLLBAR_MODE_AUTO);
|
||||||
|
|
||||||
#if LCD_H > LCD_W // portrait
|
#if LCD_H > LCD_W // portrait
|
||||||
box->setWidth(body.width() - 2*lv_dpx(8));
|
box->setWidth(body.width() - 2*lv_dpx(8));
|
||||||
|
|||||||
@@ -202,8 +202,8 @@ void ModelCurvesPage::build(FormWindow * window)
|
|||||||
#endif
|
#endif
|
||||||
static const lv_coord_t row_dsc[] = {LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
|
static const lv_coord_t row_dsc[] = {LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
|
||||||
|
|
||||||
auto form = new FormWindow(window, rect_t{});
|
window->padAll(6);
|
||||||
form->setFlexLayout();
|
window->setFlexLayout();
|
||||||
|
|
||||||
FlexGridLayout grid(col_dsc, row_dsc);
|
FlexGridLayout grid(col_dsc, row_dsc);
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ void ModelCurvesPage::build(FormWindow * window)
|
|||||||
for (uint8_t index = 0; index < MAX_CURVES; index++) {
|
for (uint8_t index = 0; index < MAX_CURVES; index++) {
|
||||||
if (isCurveUsed(index)) {
|
if (isCurveUsed(index)) {
|
||||||
if ((curveIndex % PER_ROW) == 0) {
|
if ((curveIndex % PER_ROW) == 0) {
|
||||||
line = form->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
lv_obj_set_grid_align(line->getLvObj(), LV_GRID_ALIGN_SPACE_BETWEEN, LV_GRID_ALIGN_SPACE_BETWEEN);
|
lv_obj_set_grid_align(line->getLvObj(), LV_GRID_ALIGN_SPACE_BETWEEN, LV_GRID_ALIGN_SPACE_BETWEEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,7 +281,7 @@ void ModelCurvesPage::build(FormWindow * window)
|
|||||||
|
|
||||||
if (curveIndex < MAX_CURVES) {
|
if (curveIndex < MAX_CURVES) {
|
||||||
if ((curveIndex % PER_ROW) == 0) {
|
if ((curveIndex % PER_ROW) == 0) {
|
||||||
line = form->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
lv_obj_set_grid_align(line->getLvObj(), LV_GRID_ALIGN_SPACE_BETWEEN,
|
lv_obj_set_grid_align(line->getLvObj(), LV_GRID_ALIGN_SPACE_BETWEEN,
|
||||||
LV_GRID_ALIGN_SPACE_BETWEEN);
|
LV_GRID_ALIGN_SPACE_BETWEEN);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ void ModelInputsPage::removeLine(InputMixButton* l)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InputMixGroup* ModelInputsPage::createGroup(FormGroup* form, mixsrc_t src)
|
InputMixGroup* ModelInputsPage::createGroup(FormWindow* form, mixsrc_t src)
|
||||||
{
|
{
|
||||||
return new InputMixGroup(form, src);
|
return new InputMixGroup(form, src);
|
||||||
}
|
}
|
||||||
@@ -442,15 +442,10 @@ void ModelInputsPage::pasteInputAfter(uint8_t dst_idx)
|
|||||||
|
|
||||||
void ModelInputsPage::build(FormWindow *window)
|
void ModelInputsPage::build(FormWindow *window)
|
||||||
{
|
{
|
||||||
window->setFlexLayout();
|
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 3);
|
||||||
window->padRow(lv_dpx(8));
|
|
||||||
|
|
||||||
form = new FormGroup(window, rect_t{});
|
form = new FormWindow(window, rect_t{});
|
||||||
form->setFlexLayout();
|
form->setFlexLayout(LV_FLEX_FLOW_COLUMN, 3);
|
||||||
form->padRow(lv_dpx(4));
|
|
||||||
|
|
||||||
auto form_obj = form->getLvObj();
|
|
||||||
lv_obj_set_width(form_obj, lv_pct(100));
|
|
||||||
|
|
||||||
groups.clear();
|
groups.clear();
|
||||||
lines.clear();
|
lines.clear();
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class ModelInputsPage : public PageTab
|
|||||||
void build(FormWindow *window) override;
|
void build(FormWindow *window) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
FormGroup* form = nullptr;
|
FormWindow* form = nullptr;
|
||||||
std::list<InputMixGroup*> groups;
|
std::list<InputMixGroup*> groups;
|
||||||
std::list<InputMixButton*> lines;
|
std::list<InputMixButton*> lines;
|
||||||
InputMixButton* _copySrc = nullptr;
|
InputMixButton* _copySrc = nullptr;
|
||||||
@@ -49,7 +49,7 @@ class ModelInputsPage : public PageTab
|
|||||||
|
|
||||||
virtual void addLineButton(uint8_t index);
|
virtual void addLineButton(uint8_t index);
|
||||||
virtual void addLineButton(mixsrc_t src, uint8_t index);
|
virtual void addLineButton(mixsrc_t src, uint8_t index);
|
||||||
virtual InputMixGroup* createGroup(FormGroup* form, mixsrc_t src);
|
virtual InputMixGroup* createGroup(FormWindow* form, mixsrc_t src);
|
||||||
virtual InputMixButton* createLineButton(InputMixGroup *group, uint8_t index);
|
virtual InputMixButton* createLineButton(InputMixGroup *group, uint8_t index);
|
||||||
|
|
||||||
void newInput();
|
void newInput();
|
||||||
|
|||||||
@@ -564,10 +564,7 @@ void ModelLogicalSwitchesPage::build(FormWindow* window)
|
|||||||
static const lv_coord_t l_col_dsc[] = {LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
|
static const lv_coord_t l_col_dsc[] = {LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
|
||||||
|
|
||||||
window->padAll(4);
|
window->padAll(4);
|
||||||
|
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 0);
|
||||||
auto form = new FormWindow(window, rect_t{});
|
|
||||||
form->setFlexLayout();
|
|
||||||
form->padAll(0);
|
|
||||||
|
|
||||||
FlexGridLayout grid(l_col_dsc, row_dsc, 2);
|
FlexGridLayout grid(l_col_dsc, row_dsc, 2);
|
||||||
|
|
||||||
@@ -584,7 +581,7 @@ void ModelLogicalSwitchesPage::build(FormWindow* window)
|
|||||||
bool isActive = (ls->func != LS_FUNC_NONE);
|
bool isActive = (ls->func != LS_FUNC_NONE);
|
||||||
|
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
line = form->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
|
|
||||||
button = new LogicalSwitchButton(line, rect_t{0, 0, window->width() - 12, LS_BUTTON_H}, i);
|
button = new LogicalSwitchButton(line, rect_t{0, 0, window->width() - 12, LS_BUTTON_H}, i);
|
||||||
|
|
||||||
@@ -647,7 +644,7 @@ void ModelLogicalSwitchesPage::build(FormWindow* window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hasEmptySwitch) {
|
if (hasEmptySwitch) {
|
||||||
line = form->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
addButton =
|
addButton =
|
||||||
new TextButton(line, rect_t{0, 0, window->width() - 12, LS_BUTTON_H},
|
new TextButton(line, rect_t{0, 0, window->width() - 12, LS_BUTTON_H},
|
||||||
LV_SYMBOL_PLUS, [=]() {
|
LV_SYMBOL_PLUS, [=]() {
|
||||||
|
|||||||
@@ -289,11 +289,8 @@ void ModelMixerScriptsPage::rebuild(FormWindow * window, int8_t focusIdx)
|
|||||||
|
|
||||||
void ModelMixerScriptsPage::build(FormWindow * window, int8_t focusIdx)
|
void ModelMixerScriptsPage::build(FormWindow * window, int8_t focusIdx)
|
||||||
{
|
{
|
||||||
window->padAll(0);
|
window->padAll(4);
|
||||||
|
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 0);
|
||||||
auto form = new FormWindow(window, rect_t{});
|
|
||||||
form->setFlexLayout();
|
|
||||||
form->padAll(4);
|
|
||||||
|
|
||||||
FlexGridLayout grid(col_dsc, row_dsc, 2);
|
FlexGridLayout grid(col_dsc, row_dsc, 2);
|
||||||
|
|
||||||
@@ -301,7 +298,7 @@ void ModelMixerScriptsPage::build(FormWindow * window, int8_t focusIdx)
|
|||||||
|
|
||||||
int8_t scriptIdx = 0;
|
int8_t scriptIdx = 0;
|
||||||
for (int8_t idx = 0; idx < MAX_SCRIPTS; idx++) {
|
for (int8_t idx = 0; idx < MAX_SCRIPTS; idx++) {
|
||||||
auto line = form->newLine(&grid);
|
auto line = window->newLine(&grid);
|
||||||
|
|
||||||
ScriptInternalData* runtimeData = nullptr;
|
ScriptInternalData* runtimeData = nullptr;
|
||||||
ScriptData* const sd = &(g_model.scriptsData[idx]);
|
ScriptData* const sd = &(g_model.scriptsData[idx]);
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ InputMixGroup* ModelMixesPage::getGroupByIndex(uint8_t index)
|
|||||||
return getGroupBySrc(MIXSRC_CH1 + ch);
|
return getGroupBySrc(MIXSRC_CH1 + ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
InputMixGroup* ModelMixesPage::createGroup(FormGroup* form, mixsrc_t src)
|
InputMixGroup* ModelMixesPage::createGroup(FormWindow* form, mixsrc_t src)
|
||||||
{
|
{
|
||||||
auto group = new InputMixGroup(form, src);
|
auto group = new InputMixGroup(form, src);
|
||||||
if (showMonitors) group->enableMixerMonitor(src - MIXSRC_CH1);
|
if (showMonitors) group->enableMixerMonitor(src - MIXSRC_CH1);
|
||||||
@@ -512,15 +512,11 @@ void ModelMixesPage::pasteMixAfter(uint8_t dst_idx)
|
|||||||
void ModelMixesPage::build(FormWindow * window)
|
void ModelMixesPage::build(FormWindow * window)
|
||||||
{
|
{
|
||||||
scroll_win = window->getParent();
|
scroll_win = window->getParent();
|
||||||
window->setFlexLayout();
|
|
||||||
window->padRow(lv_dpx(8));
|
|
||||||
|
|
||||||
form = new FormGroup(window, rect_t{});
|
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 3);
|
||||||
form->setFlexLayout();
|
|
||||||
form->padRow(lv_dpx(4));
|
|
||||||
|
|
||||||
auto form_obj = form->getLvObj();
|
form = new FormWindow(window, rect_t{});
|
||||||
lv_obj_set_width(form_obj, lv_pct(100));
|
form->setFlexLayout(LV_FLEX_FLOW_COLUMN, 3);
|
||||||
|
|
||||||
groups.clear();
|
groups.clear();
|
||||||
lines.clear();
|
lines.clear();
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class ModelMixesPage : public ModelInputsPage
|
|||||||
|
|
||||||
void addLineButton(uint8_t index) override;
|
void addLineButton(uint8_t index) override;
|
||||||
void addLineButton(mixsrc_t src, uint8_t index) override;
|
void addLineButton(mixsrc_t src, uint8_t index) override;
|
||||||
InputMixGroup* createGroup(FormGroup* form, mixsrc_t src) override;
|
InputMixGroup* createGroup(FormWindow* form, mixsrc_t src) override;
|
||||||
InputMixButton* createLineButton(InputMixGroup* group,
|
InputMixButton* createLineButton(InputMixGroup* group,
|
||||||
uint8_t index) override;
|
uint8_t index) override;
|
||||||
|
|
||||||
|
|||||||
@@ -293,32 +293,28 @@ ModelOutputsPage::ModelOutputsPage() :
|
|||||||
|
|
||||||
void ModelOutputsPage::build(FormWindow *window)
|
void ModelOutputsPage::build(FormWindow *window)
|
||||||
{
|
{
|
||||||
window->setFlexLayout();
|
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 3);
|
||||||
window->padRow(lv_dpx(4));
|
|
||||||
|
|
||||||
auto form = new FormGroup(window, rect_t{});
|
lv_obj_set_style_flex_cross_place(window->getLvObj(), LV_FLEX_ALIGN_START, 0);
|
||||||
form->setFlexLayout(LV_FLEX_FLOW_ROW_WRAP, lv_dpx(16));
|
|
||||||
form->padRow(lv_dpx(8));
|
|
||||||
form->padBottom(lv_dpx(4));
|
|
||||||
|
|
||||||
auto form_obj = form->getLvObj();
|
auto box = new FormWindow(window, rect_t{});
|
||||||
lv_obj_set_style_flex_cross_place(form_obj, LV_FLEX_ALIGN_CENTER, 0);
|
box->setFlexLayout(LV_FLEX_FLOW_ROW_WRAP, lv_dpx(8));
|
||||||
|
box->padRow(4);
|
||||||
|
lv_obj_set_style_flex_cross_place(box->getLvObj(), LV_FLEX_ALIGN_CENTER, 0);
|
||||||
|
|
||||||
new TextButton(form, rect_t{}, STR_ADD_ALL_TRIMS_TO_SUBTRIMS, [=]() {
|
new TextButton(box, rect_t{}, STR_ADD_ALL_TRIMS_TO_SUBTRIMS, [=]() {
|
||||||
moveTrimsToOffsets();
|
moveTrimsToOffsets();
|
||||||
window->invalidate();
|
window->invalidate();
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
auto box = new FormGroup(form, rect_t{});
|
auto box2 = new FormWindow(box, rect_t{});
|
||||||
box->setFlexLayout(LV_FLEX_FLOW_ROW, lv_dpx(8));
|
box2->setFlexLayout(LV_FLEX_FLOW_ROW, lv_dpx(8));
|
||||||
|
box2->setWidth(LV_SIZE_CONTENT);
|
||||||
|
lv_obj_set_style_flex_cross_place(box2->getLvObj(), LV_FLEX_ALIGN_CENTER, 0);
|
||||||
|
|
||||||
auto box_obj = box->getLvObj();
|
new StaticText(box2, rect_t{}, STR_ELIMITS, 0, COLOR_THEME_PRIMARY1);
|
||||||
lv_obj_set_width(box_obj, LV_SIZE_CONTENT);
|
auto cb = new CheckBox(box2, rect_t{}, GET_SET_DEFAULT(g_model.extendedLimits));
|
||||||
lv_obj_set_style_flex_cross_place(box_obj, LV_FLEX_ALIGN_CENTER, 0);
|
|
||||||
|
|
||||||
new StaticText(box, rect_t{}, STR_ELIMITS, 0, COLOR_THEME_PRIMARY1);
|
|
||||||
new CheckBox(box, rect_t{}, GET_SET_DEFAULT(g_model.extendedLimits));
|
|
||||||
|
|
||||||
for (uint8_t ch = 0; ch < MAX_OUTPUT_CHANNELS; ch++) {
|
for (uint8_t ch = 0; ch < MAX_OUTPUT_CHANNELS; ch++) {
|
||||||
|
|
||||||
|
|||||||
@@ -92,12 +92,6 @@ struct ModelBitmapEdit : public FileChoice {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TimerBtnMatrix : public ButtonMatrix {
|
|
||||||
TimerBtnMatrix(Window* parent, const rect_t& rect);
|
|
||||||
void onPress(uint8_t btn_id) override;
|
|
||||||
bool isActive(uint8_t btn_id) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
class SubScreenButton : public Button
|
class SubScreenButton : public Button
|
||||||
{
|
{
|
||||||
std::string text;
|
std::string text;
|
||||||
@@ -233,7 +227,7 @@ static const lv_coord_t line_row_dsc[] = {LV_GRID_CONTENT,
|
|||||||
|
|
||||||
void ModelSetupPage::build(FormWindow * window)
|
void ModelSetupPage::build(FormWindow * window)
|
||||||
{
|
{
|
||||||
window->setFlexLayout();
|
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 0);
|
||||||
|
|
||||||
FlexGridLayout grid(line_col_dsc, line_row_dsc, 2);
|
FlexGridLayout grid(line_col_dsc, line_row_dsc, 2);
|
||||||
|
|
||||||
@@ -343,36 +337,3 @@ void ModelSetupPage::build(FormWindow * window)
|
|||||||
lv_obj_set_grid_cell(btn->getLvObj(), LV_GRID_ALIGN_STRETCH, 0, 1, LV_GRID_ALIGN_CENTER, 0, 1);
|
lv_obj_set_grid_cell(btn->getLvObj(), LV_GRID_ALIGN_STRETCH, 0, 1, LV_GRID_ALIGN_CENTER, 0, 1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_SUBSCREEN_BTNS 9
|
|
||||||
|
|
||||||
TimerBtnMatrix::TimerBtnMatrix(Window* parent, const rect_t& r) :
|
|
||||||
ButtonMatrix(parent, r)
|
|
||||||
{
|
|
||||||
initBtnMap(3, MAX_TIMERS);
|
|
||||||
setText(0, TR_TIMER "1");
|
|
||||||
setText(1, TR_TIMER "2");
|
|
||||||
setText(2, TR_TIMER "3");
|
|
||||||
update();
|
|
||||||
|
|
||||||
lv_btnmatrix_set_btn_width(lvobj, 3, 2);
|
|
||||||
lv_obj_set_width(lvobj, lv_pct(100));
|
|
||||||
lv_obj_set_height(lvobj, LV_DPI_DEF / 2);
|
|
||||||
|
|
||||||
lv_obj_set_style_bg_opa(lvobj, LV_OPA_0, 0);
|
|
||||||
lv_obj_set_style_pad_all(lvobj, lv_dpx(8), 0);
|
|
||||||
|
|
||||||
lv_obj_set_style_pad_row(lvobj, lv_dpx(8), 0);
|
|
||||||
lv_obj_set_style_pad_column(lvobj, lv_dpx(8), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TimerBtnMatrix::onPress(uint8_t btn_id)
|
|
||||||
{
|
|
||||||
if (btn_id >= MAX_TIMERS) return;
|
|
||||||
new TimerWindow((uint8_t)(btn_id));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TimerBtnMatrix::isActive(uint8_t btn_id)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -488,6 +488,9 @@ class SensorEditWindow : public Page {
|
|||||||
|
|
||||||
void buildBody(FormWindow * window)
|
void buildBody(FormWindow * window)
|
||||||
{
|
{
|
||||||
|
window->padAll(0);
|
||||||
|
lv_obj_set_scrollbar_mode(window->getLvObj(), LV_SCROLLBAR_MODE_AUTO);
|
||||||
|
|
||||||
// Sensor one
|
// Sensor one
|
||||||
auto form = new FormWindow(window, rect_t{});
|
auto form = new FormWindow(window, rect_t{});
|
||||||
form->setFlexLayout();
|
form->setFlexLayout();
|
||||||
@@ -568,25 +571,22 @@ void ModelTelemetryPage::editSensor(FormWindow * window, uint8_t index)
|
|||||||
void ModelTelemetryPage::build(FormWindow * window, int8_t focusSensorIndex)
|
void ModelTelemetryPage::build(FormWindow * window, int8_t focusSensorIndex)
|
||||||
{
|
{
|
||||||
window->padAll(4);
|
window->padAll(4);
|
||||||
|
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 0);
|
||||||
|
|
||||||
this->window = window;
|
this->window = window;
|
||||||
|
|
||||||
auto form = new FormWindow(window, rect_t{});
|
|
||||||
form->setFlexLayout();
|
|
||||||
form->padAll(0);
|
|
||||||
|
|
||||||
FlexGridLayout grid(col_dsc, row_dsc, 2);
|
FlexGridLayout grid(col_dsc, row_dsc, 2);
|
||||||
FlexGridLayout grid2(col_dsc2, row_dsc, 2);
|
FlexGridLayout grid2(col_dsc2, row_dsc, 2);
|
||||||
|
|
||||||
// Sensors
|
// Sensors
|
||||||
auto line = form->newLine(&grid2);
|
auto line = window->newLine(&grid2);
|
||||||
lv_obj_set_style_pad_row(line->getLvObj(), 0, 0);
|
lv_obj_set_style_pad_row(line->getLvObj(), 0, 0);
|
||||||
lv_obj_set_style_pad_column(line->getLvObj(), 4, 0);
|
lv_obj_set_style_pad_column(line->getLvObj(), 4, 0);
|
||||||
auto subttl = new Subtitle(line, rect_t{}, STR_TELEMETRY_SENSORS, 0, COLOR_THEME_PRIMARY1);
|
auto subttl = new Subtitle(line, rect_t{}, STR_TELEMETRY_SENSORS, 0, COLOR_THEME_PRIMARY1);
|
||||||
|
|
||||||
#if LCD_H > LCD_W
|
#if LCD_H > LCD_W
|
||||||
lv_obj_set_grid_cell(subttl->getLvObj(), LV_GRID_ALIGN_START, 0, 3, LV_GRID_ALIGN_CENTER, 0, 1);
|
lv_obj_set_grid_cell(subttl->getLvObj(), LV_GRID_ALIGN_START, 0, 3, LV_GRID_ALIGN_CENTER, 0, 1);
|
||||||
line = form->newLine(&grid2);
|
line = window->newLine(&grid2);
|
||||||
lv_obj_set_style_pad_row(line->getLvObj(), 0, 0);
|
lv_obj_set_style_pad_row(line->getLvObj(), 0, 0);
|
||||||
lv_obj_set_style_pad_column(line->getLvObj(), 4, 0);
|
lv_obj_set_style_pad_column(line->getLvObj(), 4, 0);
|
||||||
grid2.nextCell();
|
grid2.nextCell();
|
||||||
@@ -607,7 +607,7 @@ void ModelTelemetryPage::build(FormWindow * window, int8_t focusSensorIndex)
|
|||||||
|
|
||||||
for (uint8_t idx = 0; idx < MAX_TELEMETRY_SENSORS; idx++) {
|
for (uint8_t idx = 0; idx < MAX_TELEMETRY_SENSORS; idx++) {
|
||||||
if (g_model.telemetrySensors[idx].isAvailable()) {
|
if (g_model.telemetrySensors[idx].isAvailable()) {
|
||||||
line = form->newLine(&grid3);
|
line = window->newLine(&grid3);
|
||||||
auto button = new SensorButton(line, rect_t{0, 0, LCD_W-12, 25}, idx);
|
auto button = new SensorButton(line, rect_t{0, 0, LCD_W-12, 25}, idx);
|
||||||
|
|
||||||
button->setPressHandler([=]() -> uint8_t {
|
button->setPressHandler([=]() -> uint8_t {
|
||||||
@@ -646,7 +646,7 @@ void ModelTelemetryPage::build(FormWindow * window, int8_t focusSensorIndex)
|
|||||||
FlexGridLayout grid4(col_dsc4, row_dsc, 4);
|
FlexGridLayout grid4(col_dsc4, row_dsc, 4);
|
||||||
|
|
||||||
// Autodiscover button
|
// Autodiscover button
|
||||||
line = form->newLine(&grid4);
|
line = window->newLine(&grid4);
|
||||||
auto discover = new TextButton(line, rect_t{}, (allowNewSensors) ? STR_STOP_DISCOVER_SENSORS : STR_DISCOVER_SENSORS);
|
auto discover = new TextButton(line, rect_t{}, (allowNewSensors) ? STR_STOP_DISCOVER_SENSORS : STR_DISCOVER_SENSORS);
|
||||||
discover->setPressHandler([=]() {
|
discover->setPressHandler([=]() {
|
||||||
allowNewSensors = !allowNewSensors;
|
allowNewSensors = !allowNewSensors;
|
||||||
@@ -675,7 +675,7 @@ void ModelTelemetryPage::build(FormWindow * window, int8_t focusSensorIndex)
|
|||||||
|
|
||||||
if (sensorsCount > 0) {
|
if (sensorsCount > 0) {
|
||||||
#if TWOCOLBUTTONS
|
#if TWOCOLBUTTONS
|
||||||
line = form->newLine(&grid4);
|
line = window->newLine(&grid4);
|
||||||
#endif
|
#endif
|
||||||
// Delete all sensors button
|
// Delete all sensors button
|
||||||
b = new TextButton(line, rect_t{}, STR_DELETE_ALL_SENSORS,
|
b = new TextButton(line, rect_t{}, STR_DELETE_ALL_SENSORS,
|
||||||
@@ -696,37 +696,37 @@ void ModelTelemetryPage::build(FormWindow * window, int8_t focusSensorIndex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ignore instance button
|
// Ignore instance button
|
||||||
line = form->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
line->padLeft(10);
|
line->padLeft(10);
|
||||||
new StaticText(line, rect_t{}, STR_IGNORE_INSTANCE, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(line, rect_t{}, STR_IGNORE_INSTANCE, 0, COLOR_THEME_PRIMARY1);
|
||||||
new CheckBox(line, rect_t{}, GET_SET_DEFAULT(g_model.ignoreSensorIds));
|
new CheckBox(line, rect_t{}, GET_SET_DEFAULT(g_model.ignoreSensorIds));
|
||||||
|
|
||||||
// RSSI
|
// RSSI
|
||||||
line = form->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
new Subtitle(line, rect_t{}, getRssiLabel(), 0, COLOR_THEME_PRIMARY1);
|
new Subtitle(line, rect_t{}, getRssiLabel(), 0, COLOR_THEME_PRIMARY1);
|
||||||
|
|
||||||
line = form->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
line->padLeft(10);
|
line->padLeft(10);
|
||||||
new StaticText(line, rect_t{}, STR_LOWALARM, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(line, rect_t{}, STR_LOWALARM, 0, COLOR_THEME_PRIMARY1);
|
||||||
new NumberEdit(line, rect_t{}, 0, 100, GET_SET_DEFAULT(g_model.rfAlarms.warning));
|
new NumberEdit(line, rect_t{}, 0, 100, GET_SET_DEFAULT(g_model.rfAlarms.warning));
|
||||||
|
|
||||||
line = form->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
line->padLeft(10);
|
line->padLeft(10);
|
||||||
new StaticText(line, rect_t{}, STR_CRITICALALARM, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(line, rect_t{}, STR_CRITICALALARM, 0, COLOR_THEME_PRIMARY1);
|
||||||
new NumberEdit(line, rect_t{}, 0, 100, GET_SET_DEFAULT(g_model.rfAlarms.critical));
|
new NumberEdit(line, rect_t{}, 0, 100, GET_SET_DEFAULT(g_model.rfAlarms.critical));
|
||||||
|
|
||||||
line = form->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
line->padLeft(10);
|
line->padLeft(10);
|
||||||
new StaticText(line, rect_t{}, STR_DISABLE_ALARM, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(line, rect_t{}, STR_DISABLE_ALARM, 0, COLOR_THEME_PRIMARY1);
|
||||||
new CheckBox(line, rect_t{}, GET_SET_DEFAULT(g_model.disableTelemetryWarning));
|
new CheckBox(line, rect_t{}, GET_SET_DEFAULT(g_model.disableTelemetryWarning));
|
||||||
|
|
||||||
// Vario
|
// Vario
|
||||||
line = form->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
new Subtitle(line, rect_t{}, STR_VARIO, 0, COLOR_THEME_PRIMARY1);
|
new Subtitle(line, rect_t{}, STR_VARIO, 0, COLOR_THEME_PRIMARY1);
|
||||||
|
|
||||||
FlexGridLayout grid5(col_dsc5, row_dsc, 4);
|
FlexGridLayout grid5(col_dsc5, row_dsc, 4);
|
||||||
|
|
||||||
line = form->newLine(&grid5);
|
line = window->newLine(&grid5);
|
||||||
line->padLeft(10);
|
line->padLeft(10);
|
||||||
new StaticText(line, rect_t{}, STR_SOURCE, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(line, rect_t{}, STR_SOURCE, 0, COLOR_THEME_PRIMARY1);
|
||||||
auto choice = new SourceChoice(line, rect_t{}, MIXSRC_NONE, MIXSRC_LAST_TELEM,
|
auto choice = new SourceChoice(line, rect_t{}, MIXSRC_NONE, MIXSRC_LAST_TELEM,
|
||||||
@@ -741,7 +741,7 @@ void ModelTelemetryPage::build(FormWindow * window, int8_t focusSensorIndex)
|
|||||||
return qr.rem == 0 && isSensorAvailable(qr.quot + 1);
|
return qr.rem == 0 && isSensorAvailable(qr.quot + 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
line = form->newLine(&grid5);
|
line = window->newLine(&grid5);
|
||||||
line->padLeft(10);
|
line->padLeft(10);
|
||||||
new StaticText(line, rect_t{}, STR_RANGE, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(line, rect_t{}, STR_RANGE, 0, COLOR_THEME_PRIMARY1);
|
||||||
|
|
||||||
@@ -751,7 +751,7 @@ void ModelTelemetryPage::build(FormWindow * window, int8_t focusSensorIndex)
|
|||||||
auto vMax = new NumberEdit(line, rect_t{}, -17, 17, GET_SET_WITH_OFFSET(g_model.varioData.max, 10));
|
auto vMax = new NumberEdit(line, rect_t{}, -17, 17, GET_SET_WITH_OFFSET(g_model.varioData.max, 10));
|
||||||
vMax->setAvailableHandler([](int val) { return g_model.varioData.min - 10 < val; });
|
vMax->setAvailableHandler([](int val) { return g_model.varioData.min - 10 < val; });
|
||||||
|
|
||||||
line = form->newLine(&grid5);
|
line = window->newLine(&grid5);
|
||||||
line->padLeft(10);
|
line->padLeft(10);
|
||||||
new StaticText(line, rect_t{}, STR_CENTER, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(line, rect_t{}, STR_CENTER, 0, COLOR_THEME_PRIMARY1);
|
||||||
|
|
||||||
|
|||||||
@@ -737,6 +737,9 @@ ModulePage::ModulePage(uint8_t moduleIdx) : Page(ICON_MODEL_SETUP)
|
|||||||
header.setTitle(STR_MENU_MODEL_SETUP);
|
header.setTitle(STR_MENU_MODEL_SETUP);
|
||||||
header.setTitle2(title2);
|
header.setTitle2(title2);
|
||||||
|
|
||||||
|
body.padAll(0);
|
||||||
|
lv_obj_set_scrollbar_mode(body.getLvObj(), LV_SCROLLBAR_MODE_AUTO);
|
||||||
|
|
||||||
auto form = new FormGroup(&body, rect_t{});
|
auto form = new FormGroup(&body, rect_t{});
|
||||||
form->setFlexLayout();
|
form->setFlexLayout();
|
||||||
form->padAll(lv_dpx(8));
|
form->padAll(lv_dpx(8));
|
||||||
|
|||||||
@@ -109,7 +109,8 @@ PreflightChecks::PreflightChecks() : Page(ICON_MODEL_SETUP)
|
|||||||
|
|
||||||
auto form = new FormWindow(&body, rect_t{});
|
auto form = new FormWindow(&body, rect_t{});
|
||||||
form->setFlexLayout();
|
form->setFlexLayout();
|
||||||
FlexGridLayout grid(line_col_dsc, line_row_dsc, 4);
|
form->padAll(4);
|
||||||
|
FlexGridLayout grid(line_col_dsc, line_row_dsc, 2);
|
||||||
|
|
||||||
// Display checklist
|
// Display checklist
|
||||||
auto line = form->newLine(&grid);
|
auto line = form->newLine(&grid);
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ RadioHardwarePage::RadioHardwarePage():
|
|||||||
|
|
||||||
void RadioHardwarePage::build(FormWindow * window)
|
void RadioHardwarePage::build(FormWindow * window)
|
||||||
{
|
{
|
||||||
window->setFlexLayout();
|
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 0);
|
||||||
|
|
||||||
FlexGridLayout grid(col_dsc, row_dsc, 2);
|
FlexGridLayout grid(col_dsc, row_dsc, 2);
|
||||||
lv_obj_set_style_pad_all(window->getLvObj(), lv_dpx(8), 0);
|
|
||||||
|
|
||||||
// TODO: sub-title?
|
// TODO: sub-title?
|
||||||
|
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ void RadioSdManagerPage::build(FormWindow * window)
|
|||||||
browser = new FileBrowser(form, rect_t{}, ROOT_PATH);
|
browser = new FileBrowser(form, rect_t{}, ROOT_PATH);
|
||||||
grid.add(browser);
|
grid.add(browser);
|
||||||
grid.nextCell();
|
grid.nextCell();
|
||||||
|
lv_obj_set_scrollbar_mode(browser->getLvObj(), LV_SCROLLBAR_MODE_AUTO);
|
||||||
|
|
||||||
auto obj = browser->getLvObj();
|
auto obj = browser->getLvObj();
|
||||||
lv_obj_set_style_grid_cell_x_align(obj, LV_GRID_ALIGN_STRETCH, 0);
|
lv_obj_set_style_grid_cell_x_align(obj, LV_GRID_ALIGN_STRETCH, 0);
|
||||||
|
|||||||
@@ -700,7 +700,7 @@ void RadioSetupPage::build(FormWindow * window)
|
|||||||
GET_SET_DEFAULT(g_eeGeneral.rotEncMode));
|
GET_SET_DEFAULT(g_eeGeneral.rotEncMode));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Default channel order
|
// RX channel order
|
||||||
line = window->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
new StaticText(line, rect_t{}, STR_DEF_CHAN_ORD, 0,
|
new StaticText(line, rect_t{}, STR_DEF_CHAN_ORD, 0,
|
||||||
COLOR_THEME_PRIMARY1); // RAET->AETR
|
COLOR_THEME_PRIMARY1); // RAET->AETR
|
||||||
|
|||||||
@@ -619,6 +619,7 @@ void ThemeSetupPage::setSelected(ThemePersistance *tp)
|
|||||||
void ThemeSetupPage::setupListbox(Window *window, rect_t r, ThemePersistance *tp)
|
void ThemeSetupPage::setupListbox(Window *window, rect_t r, ThemePersistance *tp)
|
||||||
{
|
{
|
||||||
listBox = new ListBox(window, r, tp->getNames());
|
listBox = new ListBox(window, r, tp->getNames());
|
||||||
|
lv_obj_set_scrollbar_mode(listBox->getLvObj(), LV_SCROLLBAR_MODE_AUTO);
|
||||||
listBox->setAutoEdit(true);
|
listBox->setAutoEdit(true);
|
||||||
listBox->setSelected(currentTheme);
|
listBox->setSelected(currentTheme);
|
||||||
listBox->setActiveItem(tp->getThemeIndex());
|
listBox->setActiveItem(tp->getThemeIndex());
|
||||||
|
|||||||
@@ -243,9 +243,10 @@ void RadioToolsPage::rebuild(FormWindow * window)
|
|||||||
|
|
||||||
tools.sort(tool_compare_nocase);
|
tools.sort(tool_compare_nocase);
|
||||||
|
|
||||||
|
window->padAll(lv_dpx(8));
|
||||||
window->setFlexLayout(LV_FLEX_FLOW_ROW_WRAP, lv_dpx(8));
|
window->setFlexLayout(LV_FLEX_FLOW_ROW_WRAP, lv_dpx(8));
|
||||||
window->padRow(lv_dpx(8));
|
window->padRow(lv_dpx(8));
|
||||||
|
|
||||||
for (const auto& tool : tools) {
|
for (const auto& tool : tools) {
|
||||||
new ToolButton(window, tool);
|
new ToolButton(window, tool);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,13 +216,15 @@ ScreenSetupPage::ScreenSetupPage(ScreenMenu* menu, unsigned pageIndex,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenSetupPage::build(FormWindow * form)
|
void ScreenSetupPage::build(FormWindow * window)
|
||||||
{
|
{
|
||||||
|
window->padAll(4);
|
||||||
|
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 0);
|
||||||
|
|
||||||
FlexGridLayout grid(line_col_dsc, line_row_dsc);
|
FlexGridLayout grid(line_col_dsc, line_row_dsc);
|
||||||
form->setFlexLayout();
|
|
||||||
|
|
||||||
// Layout choice...
|
// Layout choice...
|
||||||
auto line = form->newLine(&grid);
|
auto line = window->newLine(&grid);
|
||||||
auto label = new StaticText(line, rect_t{}, STR_LAYOUT, 0, COLOR_THEME_PRIMARY1);
|
auto label = new StaticText(line, rect_t{}, STR_LAYOUT, 0, COLOR_THEME_PRIMARY1);
|
||||||
|
|
||||||
auto obj = label->getLvObj();
|
auto obj = label->getLvObj();
|
||||||
@@ -252,13 +254,13 @@ void ScreenSetupPage::build(FormWindow * form)
|
|||||||
obj = layoutForm->getLvObj();
|
obj = layoutForm->getLvObj();
|
||||||
lv_obj_set_style_grid_cell_x_align(obj, LV_GRID_ALIGN_STRETCH, 0);
|
lv_obj_set_style_grid_cell_x_align(obj, LV_GRID_ALIGN_STRETCH, 0);
|
||||||
|
|
||||||
line = form->newLine();
|
line = window->newLine();
|
||||||
layoutOptions = new FormGroup(line, rect_t{}, FORWARD_SCROLL | FORM_FORWARD_FOCUS);
|
layoutOptions = new FormGroup(line, rect_t{}, FORWARD_SCROLL | FORM_FORWARD_FOCUS);
|
||||||
buildLayoutOptions();
|
buildLayoutOptions();
|
||||||
|
|
||||||
// Prevent removing the last page
|
// Prevent removing the last page
|
||||||
if (customScreens[1] != nullptr) {
|
if (customScreens[1] != nullptr) {
|
||||||
line = form->newLine();
|
line = window->newLine();
|
||||||
Window* btn = new TextButton(line, rect_t{}, STR_REMOVE_SCREEN, removeScreen(menu, idx));
|
Window* btn = new TextButton(line, rect_t{}, STR_REMOVE_SCREEN, removeScreen(menu, idx));
|
||||||
obj = btn->getLvObj();
|
obj = btn->getLvObj();
|
||||||
lv_obj_set_style_min_width(obj, LV_DPI_DEF / 2, LV_PART_MAIN);
|
lv_obj_set_style_min_width(obj, LV_DPI_DEF / 2, LV_PART_MAIN);
|
||||||
@@ -287,7 +289,7 @@ void ScreenSetupPage::build(FormWindow * form)
|
|||||||
lv_obj_set_style_radius(obj, 8, LV_PART_MAIN);
|
lv_obj_set_style_radius(obj, 8, LV_PART_MAIN);
|
||||||
lv_group_focus_obj(obj);
|
lv_group_focus_obj(obj);
|
||||||
|
|
||||||
form->updateSize();
|
window->updateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenSetupPage::clearLayoutOptions()
|
void ScreenSetupPage::clearLayoutOptions()
|
||||||
|
|||||||
@@ -91,13 +91,15 @@ ScreenUserInterfacePage::ScreenUserInterfacePage(ScreenMenu* menu):
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenUserInterfacePage::build(FormWindow* form)
|
void ScreenUserInterfacePage::build(FormWindow* window)
|
||||||
{
|
{
|
||||||
|
window->padAll(4);
|
||||||
|
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 0);
|
||||||
|
|
||||||
FlexGridLayout grid(line_col_dsc, line_row_dsc);
|
FlexGridLayout grid(line_col_dsc, line_row_dsc);
|
||||||
form->setFlexLayout();
|
|
||||||
|
|
||||||
// Top Bar
|
// Top Bar
|
||||||
auto line = form->newLine(&grid);
|
auto line = window->newLine(&grid);
|
||||||
new StaticText(line, rect_t{}, STR_TOP_BAR, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(line, rect_t{}, STR_TOP_BAR, 0, COLOR_THEME_PRIMARY1);
|
||||||
|
|
||||||
auto menu = this->menu;
|
auto menu = this->menu;
|
||||||
@@ -109,7 +111,7 @@ void ScreenUserInterfacePage::build(FormWindow* form)
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Theme choice
|
// Theme choice
|
||||||
line = form->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
new StaticText(line, rect_t{}, STR_THEME, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(line, rect_t{}, STR_THEME, 0, COLOR_THEME_PRIMARY1);
|
||||||
|
|
||||||
auto tp = ThemePersistance::instance();
|
auto tp = ThemePersistance::instance();
|
||||||
@@ -126,8 +128,8 @@ void ScreenUserInterfacePage::build(FormWindow* form)
|
|||||||
tp->setDefaultTheme(value);
|
tp->setDefaultTheme(value);
|
||||||
|
|
||||||
// TODO: shouldn't be necessary, would be better to send LV_EVENT_CHANGED
|
// TODO: shouldn't be necessary, would be better to send LV_EVENT_CHANGED
|
||||||
form->clear();
|
window->clear();
|
||||||
build(form);
|
build(window);
|
||||||
});
|
});
|
||||||
|
|
||||||
auto theme = tp->getCurrentTheme();
|
auto theme = tp->getCurrentTheme();
|
||||||
@@ -135,7 +137,7 @@ void ScreenUserInterfacePage::build(FormWindow* form)
|
|||||||
|
|
||||||
if (theme) {
|
if (theme) {
|
||||||
FlexGridLayout theme_grid(theme_col_dsc, theme_row_dsc);
|
FlexGridLayout theme_grid(theme_col_dsc, theme_row_dsc);
|
||||||
line = form->newLine(&theme_grid);
|
line = window->newLine(&theme_grid);
|
||||||
|
|
||||||
new ThemeDetails(line, theme);
|
new ThemeDetails(line, theme);
|
||||||
|
|
||||||
@@ -154,6 +156,6 @@ void ScreenUserInterfacePage::build(FormWindow* form)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
form->updateSize();
|
window->updateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -350,14 +350,19 @@ class SpecialFunctionEditPage : public Page
|
|||||||
|
|
||||||
void buildBody(FormWindow *window)
|
void buildBody(FormWindow *window)
|
||||||
{
|
{
|
||||||
window->setFlexLayout();
|
window->padAll(0);
|
||||||
|
lv_obj_set_scrollbar_mode(window->getLvObj(), LV_SCROLLBAR_MODE_AUTO);
|
||||||
|
|
||||||
|
auto form = new FormWindow(window, rect_t{});
|
||||||
|
form->setFlexLayout();
|
||||||
|
form->padAll(8);
|
||||||
|
|
||||||
FlexGridLayout grid(col_dsc, row_dsc, 2);
|
FlexGridLayout grid(col_dsc, row_dsc, 2);
|
||||||
lv_obj_set_style_pad_all(window->getLvObj(), lv_dpx(8), 0);
|
|
||||||
|
|
||||||
CustomFunctionData *cfn = &functions[index];
|
CustomFunctionData *cfn = &functions[index];
|
||||||
|
|
||||||
// Switch
|
// Switch
|
||||||
auto line = window->newLine(&grid);
|
auto line = form->newLine(&grid);
|
||||||
new StaticText(line, rect_t{}, STR_SF_SWITCH, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(line, rect_t{}, STR_SF_SWITCH, 0, COLOR_THEME_PRIMARY1);
|
||||||
auto switchChoice =
|
auto switchChoice =
|
||||||
new SwitchChoice(line, rect_t{}, SWSRC_FIRST, SWSRC_LAST,
|
new SwitchChoice(line, rect_t{}, SWSRC_FIRST, SWSRC_LAST,
|
||||||
@@ -381,7 +386,7 @@ class SpecialFunctionEditPage : public Page
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Function
|
// Function
|
||||||
line = window->newLine(&grid);
|
line = form->newLine(&grid);
|
||||||
new StaticText(line, rect_t{}, STR_FUNC, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(line, rect_t{}, STR_FUNC, 0, COLOR_THEME_PRIMARY1);
|
||||||
auto functionChoice =
|
auto functionChoice =
|
||||||
new Choice(line, rect_t{}, STR_VFSWFUNC,
|
new Choice(line, rect_t{}, STR_VFSWFUNC,
|
||||||
@@ -397,7 +402,7 @@ class SpecialFunctionEditPage : public Page
|
|||||||
return isAssignableFunctionAvailable(value, functions);
|
return isAssignableFunctionAvailable(value, functions);
|
||||||
});
|
});
|
||||||
|
|
||||||
specialFunctionOneWindow = new FormWindow(window, rect_t{});
|
specialFunctionOneWindow = new FormWindow(form, rect_t{});
|
||||||
updateSpecialFunctionOneWindow();
|
updateSpecialFunctionOneWindow();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -779,10 +784,7 @@ void SpecialFunctionsPage::build(FormWindow *window)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
window->padAll(4);
|
window->padAll(4);
|
||||||
|
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 0);
|
||||||
auto form = new FormWindow(window, rect_t{});
|
|
||||||
form->setFlexLayout();
|
|
||||||
form->padAll(0);
|
|
||||||
|
|
||||||
FlexGridLayout grid(l_col_dsc, row_dsc, 2);
|
FlexGridLayout grid(l_col_dsc, row_dsc, 2);
|
||||||
|
|
||||||
@@ -804,7 +806,7 @@ void SpecialFunctionsPage::build(FormWindow *window)
|
|||||||
bool isActive = (cfn->swtch != 0);
|
bool isActive = (cfn->swtch != 0);
|
||||||
|
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
line = form->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
|
|
||||||
button = new SpecialFunctionButton(line, rect_t{0, 0, window->width() - 12, SF_BUTTON_H}, functions, i);
|
button = new SpecialFunctionButton(line, rect_t{0, 0, window->width() - 12, SF_BUTTON_H}, functions, i);
|
||||||
|
|
||||||
@@ -893,7 +895,7 @@ void SpecialFunctionsPage::build(FormWindow *window)
|
|||||||
|
|
||||||
if (hasEmptyFunction)
|
if (hasEmptyFunction)
|
||||||
{
|
{
|
||||||
line = form->newLine(&grid);
|
line = window->newLine(&grid);
|
||||||
addButton = new TextButton(line, rect_t{0, 0, window->width() - 12, SF_BUTTON_H}, LV_SYMBOL_PLUS, [=]() {
|
addButton = new TextButton(line, rect_t{0, 0, window->width() - 12, SF_BUTTON_H}, LV_SYMBOL_PLUS, [=]() {
|
||||||
plusPopup(window);
|
plusPopup(window);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ TabsGroup::TabsGroup(uint8_t icon):
|
|||||||
Layer::push(this);
|
Layer::push(this);
|
||||||
|
|
||||||
lv_obj_set_style_bg_color(lvobj, makeLvColor(COLOR_THEME_SECONDARY3), 0);
|
lv_obj_set_style_bg_color(lvobj, makeLvColor(COLOR_THEME_SECONDARY3), 0);
|
||||||
|
lv_obj_set_scrollbar_mode(body.getLvObj(), LV_SCROLLBAR_MODE_AUTO);
|
||||||
|
|
||||||
activeTabsGroup = this;
|
activeTabsGroup = this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ TimerWindow::TimerWindow(uint8_t timer) : Page(ICON_STATS_TIMERS)
|
|||||||
header.setTitle(STR_MENU_MODEL_SETUP);
|
header.setTitle(STR_MENU_MODEL_SETUP);
|
||||||
header.setTitle2(title2);
|
header.setTitle2(title2);
|
||||||
|
|
||||||
|
body.padAll(0);
|
||||||
|
lv_obj_set_scrollbar_mode(body.getLvObj(), LV_SCROLLBAR_MODE_AUTO);
|
||||||
|
|
||||||
auto form = new FormGroup(&body, rect_t{});
|
auto form = new FormGroup(&body, rect_t{});
|
||||||
form->setFlexLayout();
|
form->setFlexLayout();
|
||||||
form->padAll(lv_dpx(8));
|
form->padAll(lv_dpx(8));
|
||||||
|
|||||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: 6b76d00119...2a0990c932
Reference in New Issue
Block a user