Padding adjustments
This commit is contained in:
committed by
Raphael Coeffic
parent
6a14695c27
commit
e91e4e9c80
@@ -323,6 +323,7 @@ void ModelCurvesPage::build(FormWindow * window, int8_t focusIndex)
|
||||
FormGridLayout grid;
|
||||
grid.spacer(PAGE_PADDING);
|
||||
grid.setLabelWidth(66);
|
||||
window->padAll(0);
|
||||
|
||||
for (uint8_t index = 0; index < MAX_CURVES; index++) {
|
||||
|
||||
|
||||
@@ -311,16 +311,15 @@ static const lv_coord_t fmt_row_dsc[] = {LV_GRID_CONTENT,
|
||||
void ModelFlightModesPage::build(FormWindow * window)
|
||||
{
|
||||
window->setFlexLayout();
|
||||
window->padRow(lv_dpx(8));
|
||||
|
||||
lv_obj_t* obj = window->getLvObj();
|
||||
lv_obj_set_style_flex_cross_place(obj, LV_FLEX_ALIGN_CENTER, 0);
|
||||
|
||||
FlexGridLayout grid(fmt_col_dsc, fmt_row_dsc, 0);
|
||||
auto fm_box = window->newLine(&grid);
|
||||
|
||||
obj = fm_box->getLvObj();
|
||||
lv_obj_set_style_pad_all(obj, 8, 0);
|
||||
lv_obj_set_style_pad_row(obj, 2, 0);
|
||||
lv_obj_set_style_pad_column(obj, 2, 0);
|
||||
fm_box->padRow(lv_dpx(2));
|
||||
fm_box->padColumn(lv_dpx(2));
|
||||
|
||||
for (int i = 0; i < MAX_FLIGHT_MODES; i++) {
|
||||
new FlightModeBtn(fm_box, i);
|
||||
|
||||
@@ -357,6 +357,7 @@ void ModelGVarsPage::build(FormWindow * window)
|
||||
FormGridLayout grid;
|
||||
grid.spacer(PAGE_PADDING);
|
||||
grid.setLabelWidth(70);
|
||||
window->padAll(0);
|
||||
|
||||
for (uint8_t index = 0; index < MAX_GVARS; index++) {
|
||||
Button * button = new GVarButton(window, grid.getLineSlot(), index);
|
||||
|
||||
@@ -460,11 +460,12 @@ void ModelInputsPage::pasteInputAfter(uint8_t dst_idx)
|
||||
|
||||
void ModelInputsPage::build(FormWindow *window)
|
||||
{
|
||||
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 8);
|
||||
lv_obj_set_style_pad_all(window->getLvObj(), 8, 0);
|
||||
window->setFlexLayout();
|
||||
window->padRow(lv_dpx(8));
|
||||
|
||||
form = new FormGroup(window, rect_t{});
|
||||
form->setFlexLayout(LV_FLEX_FLOW_COLUMN, 8);
|
||||
form->setFlexLayout();
|
||||
form->padRow(lv_dpx(8));
|
||||
|
||||
auto form_obj = form->getLvObj();
|
||||
lv_obj_set_width(form_obj, lv_pct(100));
|
||||
|
||||
@@ -370,6 +370,7 @@ void ModelLogicalSwitchesPage::build(FormWindow* window, int8_t focusIndex)
|
||||
FormGridLayout grid;
|
||||
grid.spacer(PAGE_PADDING);
|
||||
grid.setLabelWidth(66);
|
||||
window->padAll(0);
|
||||
|
||||
for (uint8_t i = 0; i < MAX_LOGICAL_SWITCHES; i++) {
|
||||
LogicalSwitchData* ls = lswAddress(i);
|
||||
|
||||
@@ -236,6 +236,7 @@ void ModelMixerScriptsPage::build(FormWindow * window, int8_t focusIdx)
|
||||
FormGridLayout grid;
|
||||
grid.spacer(PAGE_PADDING);
|
||||
grid.setLabelWidth(66);
|
||||
window->padAll(0);
|
||||
|
||||
int8_t scriptIdx = 0;
|
||||
for (int8_t idx = 0; idx < MAX_SCRIPTS; idx++) {
|
||||
|
||||
@@ -533,11 +533,12 @@ void ModelMixesPage::pasteMixAfter(uint8_t dst_idx)
|
||||
|
||||
void ModelMixesPage::build(FormWindow * window)
|
||||
{
|
||||
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 8);
|
||||
lv_obj_set_style_pad_all(window->getLvObj(), 8, 0);
|
||||
window->setFlexLayout();
|
||||
window->padRow(lv_dpx(8));
|
||||
|
||||
form = new FormGroup(window, rect_t{});
|
||||
form->setFlexLayout(LV_FLEX_FLOW_COLUMN, 8);
|
||||
form->setFlexLayout();
|
||||
form->padRow(lv_dpx(8));
|
||||
|
||||
auto form_obj = form->getLvObj();
|
||||
lv_obj_set_width(form_obj, lv_pct(100));
|
||||
|
||||
@@ -147,15 +147,14 @@ ModelOutputsPage::ModelOutputsPage() :
|
||||
|
||||
void ModelOutputsPage::build(FormWindow *window)
|
||||
{
|
||||
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 8);
|
||||
lv_obj_set_style_pad_all(window->getLvObj(), 8, 0);
|
||||
window->setFlexLayout();
|
||||
window->padRow(lv_dpx(8));
|
||||
|
||||
auto form = new FormGroup(window, rect_t{});
|
||||
form->setFlexLayout(LV_FLEX_FLOW_ROW_WRAP, lv_dpx(8));
|
||||
form->setFlexLayout(LV_FLEX_FLOW_ROW_WRAP, lv_dpx(16));
|
||||
form->padRow(lv_dpx(8));
|
||||
|
||||
auto form_obj = form->getLvObj();
|
||||
lv_obj_set_style_pad_all(form_obj, lv_dpx(8), 0);
|
||||
lv_obj_set_style_pad_row(form_obj, lv_dpx(8), 0);
|
||||
lv_obj_set_style_flex_cross_place(form_obj, LV_FLEX_ALIGN_CENTER, 0);
|
||||
|
||||
// auto btn =
|
||||
@@ -167,6 +166,7 @@ void ModelOutputsPage::build(FormWindow *window)
|
||||
|
||||
auto box = new FormGroup(form, rect_t{});
|
||||
box->setFlexLayout(LV_FLEX_FLOW_ROW, lv_dpx(8));
|
||||
|
||||
auto box_obj = box->getLvObj();
|
||||
lv_obj_set_width(box_obj, LV_SIZE_CONTENT);
|
||||
lv_obj_set_style_flex_cross_place(box_obj, LV_FLEX_ALIGN_CENTER, 0);
|
||||
@@ -183,7 +183,7 @@ void ModelOutputsPage::build(FormWindow *window)
|
||||
btn->setPressHandler([=]() -> uint8_t {
|
||||
Menu *menu = new Menu(window);
|
||||
menu->addLine(STR_EDIT, [=]() {
|
||||
editOutput(btn, ch);
|
||||
editOutput(ch);
|
||||
});
|
||||
menu->addLine(STR_RESET, [=]() {
|
||||
output->min = 0;
|
||||
@@ -211,11 +211,7 @@ void ModelOutputsPage::build(FormWindow *window)
|
||||
}
|
||||
}
|
||||
|
||||
void ModelOutputsPage::editOutput(OutputLineButton *btn, uint8_t channel)
|
||||
void ModelOutputsPage::editOutput(uint8_t channel)
|
||||
{
|
||||
// auto btn_obj = btn->getLvObj();
|
||||
// Window *edit =
|
||||
new OutputEditWindow(channel);
|
||||
// edit->setCloseHandler(
|
||||
// [=]() { lv_event_send(btn_obj, LV_EVENT_VALUE_CHANGED, nullptr); });
|
||||
}
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
#include "tabsgroup.h"
|
||||
|
||||
class OutputLineButton;
|
||||
|
||||
class ModelOutputsPage : public PageTab
|
||||
{
|
||||
public:
|
||||
@@ -33,7 +31,7 @@ class ModelOutputsPage : public PageTab
|
||||
void build(FormWindow* window) override;
|
||||
|
||||
protected:
|
||||
void editOutput(OutputLineButton* btn, uint8_t channel);
|
||||
void editOutput(uint8_t channel);
|
||||
};
|
||||
|
||||
#endif // _MODEL_OUTPUTS_H_
|
||||
|
||||
@@ -457,6 +457,7 @@ void ModelTelemetryPage::build(FormWindow * window, int8_t focusSensorIndex)
|
||||
{
|
||||
FormGridLayout grid;
|
||||
grid.spacer(PAGE_PADDING);
|
||||
window->padAll(0);
|
||||
|
||||
this->window = window;
|
||||
|
||||
|
||||
@@ -154,6 +154,8 @@ static const lv_coord_t row_dsc[] = {LV_GRID_FR(2), LV_GRID_FR(1), LV_GRID_TEMPL
|
||||
void RadioSdManagerPage::build(FormWindow * window)
|
||||
{
|
||||
FlexGridLayout grid(col_dsc, row_dsc, 0);
|
||||
window->padAll(0);
|
||||
|
||||
FormGroup* form = new FormGroup(window, rect_t{});
|
||||
form->setWidth(window->width());
|
||||
form->setHeight(window->height());
|
||||
|
||||
@@ -528,6 +528,7 @@ void ThemeSetupPage::setupListbox(FormWindow *window, rect_t r, ThemePersistance
|
||||
|
||||
void ThemeSetupPage::build(FormWindow *window)
|
||||
{
|
||||
window->padAll(0);
|
||||
pageWindow = window;
|
||||
|
||||
auto tp = ThemePersistance::instance();
|
||||
|
||||
@@ -238,10 +238,8 @@ void RadioToolsPage::rebuild(FormWindow * window)
|
||||
|
||||
tools.sort(tool_compare_nocase);
|
||||
|
||||
window->setFlexLayout(LV_FLEX_FLOW_ROW_WRAP, 8);
|
||||
lv_obj_t* w_obj = window->getLvObj();
|
||||
lv_obj_set_style_pad_row(w_obj, 8, 0);
|
||||
lv_obj_set_style_pad_all(w_obj, 8, 0);
|
||||
window->setFlexLayout(LV_FLEX_FLOW_ROW_WRAP, lv_dpx(8));
|
||||
window->padRow(lv_dpx(8));
|
||||
|
||||
for (const auto& tool : tools) {
|
||||
new ToolButton(window, tool);
|
||||
|
||||
@@ -634,6 +634,7 @@ void SpecialFunctionsPage::build(FormWindow *window, int8_t focusIndex)
|
||||
FormGridLayout grid;
|
||||
grid.spacer(PAGE_PADDING);
|
||||
grid.setLabelWidth(66);
|
||||
window->padAll(0);
|
||||
|
||||
// Window::clearFocus();
|
||||
|
||||
|
||||
@@ -223,6 +223,8 @@ void TabsGroup::setVisibleTab(PageTab* tab)
|
||||
|
||||
rect_t r = rect_t{0, 0, body.width(), body.height()};
|
||||
auto form = new FormWindow(&body, r, NO_FOCUS);
|
||||
|
||||
form->padAll(lv_dpx(8));
|
||||
tab->build(form);
|
||||
|
||||
header.setTitle(tab->title.c_str());
|
||||
|
||||
@@ -66,6 +66,7 @@ class ChannelsViewFooter: public Window {
|
||||
void ChannelsViewPage::build(FormWindow * window)
|
||||
{
|
||||
constexpr coord_t hmargin = 5;
|
||||
window->padAll(0);
|
||||
|
||||
// Channels bars
|
||||
for (uint8_t chan = pageIndex * 8; chan < 8 + pageIndex * 8; chan++) {
|
||||
|
||||
@@ -64,6 +64,7 @@ void LogicalSwitchesViewPage::build(FormWindow * window)
|
||||
FormGridLayout grid;
|
||||
grid.spacer(PAGE_PADDING);
|
||||
grid.setLabelWidth(8);
|
||||
window->padAll(0);
|
||||
|
||||
// Footer
|
||||
footer = new LogicalSwitchDisplayFooter(
|
||||
|
||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: 56f3cb7df1...dfc04ec39a
Reference in New Issue
Block a user