Fix CurveEdit crash on NV14 and enable horizontal scolling (#965)
* [nv14] Add crash causing missing curveDataEdit * Allow horizontal touch sliding Thanks for catching this @kevinkoenig * Prevent hori scroll where it shouldn't scroll Why `model_inputs` scrolls is still a mystery, but it behaves now * DRY is in effect
This commit is contained in:
@@ -154,17 +154,17 @@ class CurveEditWindow : public Page
|
|||||||
#else
|
#else
|
||||||
void buildBody(FormWindow * window)
|
void buildBody(FormWindow * window)
|
||||||
{
|
{
|
||||||
FormGridLayout grid;
|
|
||||||
grid.setMarginLeft(20);
|
|
||||||
grid.setMarginRight(20);
|
|
||||||
grid.setLabelWidth(100);
|
|
||||||
grid.spacer(20);
|
|
||||||
|
|
||||||
CurveHeader & curve = g_model.curves[index];
|
CurveHeader & curve = g_model.curves[index];
|
||||||
int8_t * points = curveAddress(index);
|
int8_t * points = curveAddress(index);
|
||||||
|
|
||||||
|
FormGridLayout grid;
|
||||||
|
grid.setMarginLeft(PAGE_PADDING);
|
||||||
|
grid.setMarginRight(PAGE_PADDING);
|
||||||
|
grid.setLabelWidth(100);
|
||||||
|
grid.spacer(PAGE_PADDING);
|
||||||
|
|
||||||
// Curve editor
|
// Curve editor
|
||||||
curveEdit = new CurveEdit(window, { 20, grid.getWindowHeight(), LCD_W - 40, LCD_W - 40}, index);
|
curveEdit = new CurveEdit(window, { 42, grid.getWindowHeight(), LCD_W - 80, LCD_W - 80}, index);
|
||||||
grid.spacer(curveEdit->height() + 15);
|
grid.spacer(curveEdit->height() + 15);
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
@@ -229,6 +229,8 @@ class CurveEditWindow : public Page
|
|||||||
curveEdit->updatePreview();
|
curveEdit->updatePreview();
|
||||||
});
|
});
|
||||||
grid.nextLine();
|
grid.nextLine();
|
||||||
|
|
||||||
|
curveDataEdit = new CurveDataEdit(window, {PAGE_PADDING, grid.getWindowHeight(), coord_t(LCD_W - PAGE_PADDING - 1), window->height() - grid.getWindowHeight() - PAGE_PADDING}, index, curveEdit);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -173,7 +173,9 @@ class InputEditWindow : public Page
|
|||||||
[=]() -> int { return getValue(expoAddress(index)->srcRaw); })
|
[=]() -> int { return getValue(expoAddress(index)->srcRaw); })
|
||||||
{
|
{
|
||||||
#if LCD_W > LCD_H
|
#if LCD_W > LCD_H
|
||||||
body.setWidth(LCD_W - preview.width() - PAGE_PADDING);
|
auto BODY_WIDTH = LCD_W - preview.width() - PAGE_PADDING;
|
||||||
|
body.setWidth(BODY_WIDTH);
|
||||||
|
body.setInnerWidth(BODY_WIDTH);
|
||||||
body.setLeft(preview.width() + PAGE_PADDING);
|
body.setLeft(preview.width() + PAGE_PADDING);
|
||||||
#else
|
#else
|
||||||
body.setRect({0, INPUT_EDIT_CURVE_TOP + INPUT_EDIT_CURVE_HEIGHT, LCD_W,
|
body.setRect({0, INPUT_EDIT_CURVE_TOP + INPUT_EDIT_CURVE_HEIGHT, LCD_W,
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class Page: public Window
|
|||||||
|
|
||||||
bool onTouchSlide(coord_t x, coord_t y, coord_t startX, coord_t startY, coord_t slideX, coord_t slideY) override
|
bool onTouchSlide(coord_t x, coord_t y, coord_t startX, coord_t startY, coord_t slideX, coord_t slideY) override
|
||||||
{
|
{
|
||||||
Window::onTouchSlide(x, y, startX, startY, 0/*slideX*/, slideY);
|
Window::onTouchSlide(x, y, startX, startY, slideX, slideY);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ AboutUs::AboutUs() :
|
|||||||
MessageDialog(MainWindow::instance(), STR_ABOUT_US, "")
|
MessageDialog(MainWindow::instance(), STR_ABOUT_US, "")
|
||||||
{
|
{
|
||||||
content->setRect({(LCD_W - ABOUT_WIDTH) / 2, 20, ABOUT_WIDTH, LCD_H - 40});
|
content->setRect({(LCD_W - ABOUT_WIDTH) / 2, 20, ABOUT_WIDTH, LCD_H - 40});
|
||||||
|
content->setInnerWidth(ABOUT_WIDTH);
|
||||||
|
|
||||||
messageWidget->setTextFlags(CENTERED | FONT(BOLD) | COLOR_THEME_SECONDARY1);
|
messageWidget->setTextFlags(CENTERED | FONT(BOLD) | COLOR_THEME_SECONDARY1);
|
||||||
messageWidget->setTop(content->top() + 40);
|
messageWidget->setTop(content->top() + 40);
|
||||||
|
|||||||
Reference in New Issue
Block a user