|
|
@ -30,7 +30,7 @@
|
|
|
|
using namespace FTDI;
|
|
|
|
using namespace FTDI;
|
|
|
|
using namespace Theme;
|
|
|
|
using namespace Theme;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TOUCH_UI_PORTRAIT
|
|
|
|
#if ENABLED(TOUCH_UI_PORTRAIT)
|
|
|
|
#define GRID_COLS 13
|
|
|
|
#define GRID_COLS 13
|
|
|
|
#define GRID_ROWS 10
|
|
|
|
#define GRID_ROWS 10
|
|
|
|
#define LAYOUT_FONT font_small
|
|
|
|
#define LAYOUT_FONT font_small
|
|
|
@ -53,7 +53,7 @@ BaseNumericAdjustmentScreen::widgets_t::widgets_t(draw_mode_t what) : _what(what
|
|
|
|
|
|
|
|
|
|
|
|
cmd.font(font_medium);
|
|
|
|
cmd.font(font_medium);
|
|
|
|
_button(cmd, 1,
|
|
|
|
_button(cmd, 1,
|
|
|
|
#ifdef TOUCH_UI_PORTRAIT
|
|
|
|
#if ENABLED(TOUCH_UI_PORTRAIT)
|
|
|
|
BTN_POS(1,10), BTN_SIZE(13,1),
|
|
|
|
BTN_POS(1,10), BTN_SIZE(13,1),
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
BTN_POS(15,7), BTN_SIZE(4,1),
|
|
|
|
BTN_POS(15,7), BTN_SIZE(4,1),
|
|
|
@ -129,7 +129,7 @@ void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) {
|
|
|
|
cmd.font(font_medium)
|
|
|
|
cmd.font(font_medium)
|
|
|
|
.tag(0)
|
|
|
|
.tag(0)
|
|
|
|
.text(
|
|
|
|
.text(
|
|
|
|
#ifdef TOUCH_UI_PORTRAIT
|
|
|
|
#if ENABLED(TOUCH_UI_PORTRAIT)
|
|
|
|
BTN_POS(1, _line), BTN_SIZE(12,1),
|
|
|
|
BTN_POS(1, _line), BTN_SIZE(12,1),
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
BTN_POS(5, _line), BTN_SIZE(8,1),
|
|
|
|
BTN_POS(5, _line), BTN_SIZE(8,1),
|
|
|
@ -141,7 +141,7 @@ void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) {
|
|
|
|
_line++;
|
|
|
|
_line++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TOUCH_UI_PORTRAIT
|
|
|
|
#if ENABLED(TOUCH_UI_PORTRAIT)
|
|
|
|
#ifdef TOUCH_UI_800x480
|
|
|
|
#ifdef TOUCH_UI_800x480
|
|
|
|
#undef EDGE_R
|
|
|
|
#undef EDGE_R
|
|
|
|
#define EDGE_R 20
|
|
|
|
#define EDGE_R 20
|
|
|
@ -172,7 +172,7 @@ void BaseNumericAdjustmentScreen::widgets_t::_draw_increment_btn(CommandProcesso
|
|
|
|
const bool highlight = (_what & FOREGROUND) && (increment == tag);
|
|
|
|
const bool highlight = (_what & FOREGROUND) && (increment == tag);
|
|
|
|
|
|
|
|
|
|
|
|
switch (pos) {
|
|
|
|
switch (pos) {
|
|
|
|
#ifdef TOUCH_UI_PORTRAIT
|
|
|
|
#if ENABLED(TOUCH_UI_PORTRAIT)
|
|
|
|
case 0: _button(cmd, tag, BTN_POS(5,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break;
|
|
|
|
case 0: _button(cmd, tag, BTN_POS(5,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break;
|
|
|
|
case 1: _button(cmd, tag, BTN_POS(7,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break;
|
|
|
|
case 1: _button(cmd, tag, BTN_POS(7,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break;
|
|
|
|
case 2: _button(cmd, tag, BTN_POS(9,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break;
|
|
|
|
case 2: _button(cmd, tag, BTN_POS(9,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break;
|
|
|
@ -192,7 +192,7 @@ void BaseNumericAdjustmentScreen::widgets_t::increments() {
|
|
|
|
if (_what & BACKGROUND) {
|
|
|
|
if (_what & BACKGROUND) {
|
|
|
|
_button_style(cmd, TEXT_LABEL);
|
|
|
|
_button_style(cmd, TEXT_LABEL);
|
|
|
|
cmd.tag(0).text(
|
|
|
|
cmd.tag(0).text(
|
|
|
|
#ifdef TOUCH_UI_PORTRAIT
|
|
|
|
#if ENABLED(TOUCH_UI_PORTRAIT)
|
|
|
|
BTN_POS(1, _line), BTN_SIZE(4,1),
|
|
|
|
BTN_POS(1, _line), BTN_SIZE(4,1),
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
BTN_POS(15, 1), BTN_SIZE(4,1),
|
|
|
|
BTN_POS(15, 1), BTN_SIZE(4,1),
|
|
|
@ -205,7 +205,7 @@ void BaseNumericAdjustmentScreen::widgets_t::increments() {
|
|
|
|
_draw_increment_btn(cmd, _line+1, 244 - _decimals);
|
|
|
|
_draw_increment_btn(cmd, _line+1, 244 - _decimals);
|
|
|
|
_draw_increment_btn(cmd, _line+1, 243 - _decimals);
|
|
|
|
_draw_increment_btn(cmd, _line+1, 243 - _decimals);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TOUCH_UI_PORTRAIT
|
|
|
|
#if ENABLED(TOUCH_UI_PORTRAIT)
|
|
|
|
_line++;
|
|
|
|
_line++;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -308,7 +308,7 @@ void BaseNumericAdjustmentScreen::widgets_t::toggle(uint8_t tag, progmem_str lab
|
|
|
|
_button_style(cmd, TEXT_LABEL);
|
|
|
|
_button_style(cmd, TEXT_LABEL);
|
|
|
|
cmd.font(font_small)
|
|
|
|
cmd.font(font_small)
|
|
|
|
.text(
|
|
|
|
.text(
|
|
|
|
#ifdef TOUCH_UI_PORTRAIT
|
|
|
|
#if ENABLED(TOUCH_UI_PORTRAIT)
|
|
|
|
BTN_POS(1, _line), BTN_SIZE( 8,1),
|
|
|
|
BTN_POS(1, _line), BTN_SIZE( 8,1),
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
BTN_POS(1, _line), BTN_SIZE(10,1),
|
|
|
|
BTN_POS(1, _line), BTN_SIZE(10,1),
|
|
|
@ -323,7 +323,7 @@ void BaseNumericAdjustmentScreen::widgets_t::toggle(uint8_t tag, progmem_str lab
|
|
|
|
.enabled(is_enabled)
|
|
|
|
.enabled(is_enabled)
|
|
|
|
.font(font_small)
|
|
|
|
.font(font_small)
|
|
|
|
.toggle2(
|
|
|
|
.toggle2(
|
|
|
|
#ifdef TOUCH_UI_PORTRAIT
|
|
|
|
#if ENABLED(TOUCH_UI_PORTRAIT)
|
|
|
|
BTN_POS( 9,_line), BTN_SIZE(5,1),
|
|
|
|
BTN_POS( 9,_line), BTN_SIZE(5,1),
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
BTN_POS(10,_line), BTN_SIZE(4,1),
|
|
|
|
BTN_POS(10,_line), BTN_SIZE(4,1),
|
|
|
|