|
@@ -33,34 +33,84 @@ using namespace Theme;
|
33
|
33
|
#ifdef TOUCH_UI_PORTRAIT
|
34
|
34
|
#define GRID_COLS 13
|
35
|
35
|
#define GRID_ROWS 10
|
|
36
|
+ #define LAYOUT_FONT font_small
|
36
|
37
|
#else
|
37
|
38
|
#define GRID_COLS 18
|
38
|
39
|
#define GRID_ROWS 7
|
|
40
|
+ #define LAYOUT_FONT font_medium
|
39
|
41
|
#endif
|
40
|
42
|
|
41
|
43
|
BaseNumericAdjustmentScreen::widgets_t::widgets_t(draw_mode_t what) : _what(what) {
|
|
44
|
+ CommandProcessor cmd;
|
|
45
|
+
|
42
|
46
|
if (what & BACKGROUND) {
|
43
|
|
- CommandProcessor cmd;
|
44
|
47
|
cmd.cmd(CLEAR_COLOR_RGB(bg_color))
|
45
|
|
- .cmd(CLEAR(true,true,true));
|
|
48
|
+ .cmd(CLEAR(true,true,true))
|
|
49
|
+ .colors(normal_btn)
|
|
50
|
+ .cmd(COLOR_RGB(bg_text_enabled));
|
46
|
51
|
}
|
47
|
52
|
|
48
|
|
- if (what & FOREGROUND) {
|
49
|
|
- CommandProcessor cmd;
|
50
|
|
- cmd.font(font_medium)
|
51
|
|
- .colors(action_btn)
|
|
53
|
+ cmd.font(font_medium);
|
|
54
|
+ _button(cmd, 1,
|
52
|
55
|
#ifdef TOUCH_UI_PORTRAIT
|
53
|
|
- .tag(1).button( BTN_POS(1,10), BTN_SIZE(13,1), GET_TEXTF(BACK))
|
|
56
|
+ BTN_POS(1,10), BTN_SIZE(13,1),
|
54
|
57
|
#else
|
55
|
|
- .tag(1).button( BTN_POS(15,7), BTN_SIZE(4,1), GET_TEXTF(BACK))
|
|
58
|
+ BTN_POS(15,7), BTN_SIZE(4,1),
|
56
|
59
|
#endif
|
57
|
|
- .colors(normal_btn);
|
58
|
|
- }
|
|
60
|
+ GET_TEXTF(BACK), true, true
|
|
61
|
+ );
|
59
|
62
|
|
60
|
63
|
_line = 1;
|
61
|
64
|
_units = F("");
|
62
|
65
|
}
|
63
|
66
|
|
|
67
|
+/**
|
|
68
|
+ * Speed optimization for changing button style.
|
|
69
|
+ */
|
|
70
|
+void BaseNumericAdjustmentScreen::widgets_t::_button_style(CommandProcessor &cmd, BaseNumericAdjustmentScreen::widgets_t::style_t style) {
|
|
71
|
+ if (_style != style) {
|
|
72
|
+ const btn_colors *old_colors = &normal_btn;
|
|
73
|
+ const btn_colors *new_colors = &normal_btn;
|
|
74
|
+
|
|
75
|
+ switch(_style) {
|
|
76
|
+ case BTN_ACTION: old_colors = &action_btn; break;
|
|
77
|
+ case BTN_TOGGLE: old_colors = &ui_toggle; break;
|
|
78
|
+ case BTN_DISABLED: old_colors = &disabled_btn; break;
|
|
79
|
+ default: break;
|
|
80
|
+ }
|
|
81
|
+ switch(style) {
|
|
82
|
+ case BTN_ACTION: new_colors = &action_btn; break;
|
|
83
|
+ case BTN_TOGGLE: new_colors = &ui_toggle; break;
|
|
84
|
+ case BTN_DISABLED: new_colors = &disabled_btn; break;
|
|
85
|
+ default: break;
|
|
86
|
+ }
|
|
87
|
+
|
|
88
|
+ const bool rgb_changed = old_colors->rgb != new_colors->rgb;
|
|
89
|
+ const bool grad_changed = old_colors->grad != new_colors->grad;
|
|
90
|
+ const bool fg_changed = (old_colors->fg != new_colors->fg) || (_style == TEXT_AREA);
|
|
91
|
+ const bool bg_changed = old_colors->bg != new_colors->bg;
|
|
92
|
+
|
|
93
|
+ if (rgb_changed) cmd.cmd(COLOR_RGB(new_colors->rgb));
|
|
94
|
+ if (grad_changed) cmd.gradcolor(new_colors->grad);
|
|
95
|
+ if (fg_changed) cmd.fgcolor(new_colors->fg);
|
|
96
|
+ if (bg_changed) cmd.bgcolor(new_colors->bg);
|
|
97
|
+
|
|
98
|
+ _style = style;
|
|
99
|
+ }
|
|
100
|
+}
|
|
101
|
+
|
|
102
|
+/**
|
|
103
|
+ * Speed optimization for drawing buttons. Draw all unpressed buttons in the
|
|
104
|
+ * background layer and draw only the pressed button in the foreground layer.
|
|
105
|
+ */
|
|
106
|
+void BaseNumericAdjustmentScreen::widgets_t::_button(CommandProcessor &cmd, uint8_t tag, int16_t x, int16_t y, int16_t w, int16_t h, progmem_str text, bool enabled, bool highlight) {
|
|
107
|
+ if (_what & BACKGROUND) enabled = true;
|
|
108
|
+ if ((_what & BACKGROUND) || buttonIsPressed(tag) || highlight || !enabled) {
|
|
109
|
+ _button_style(cmd, (!enabled) ? BTN_DISABLED : (highlight ? BTN_ACTION : BTN_NORMAL));
|
|
110
|
+ cmd.tag(enabled ? tag : 0).button(x, y, w, h, text);
|
|
111
|
+ }
|
|
112
|
+}
|
|
113
|
+
|
64
|
114
|
BaseNumericAdjustmentScreen::widgets_t &BaseNumericAdjustmentScreen::widgets_t::precision(uint8_t decimals, precision_default_t initial) {
|
65
|
115
|
_decimals = decimals;
|
66
|
116
|
if (screen_data.BaseNumericAdjustmentScreen.increment == 0) {
|
|
@@ -70,14 +120,17 @@ BaseNumericAdjustmentScreen::widgets_t &BaseNumericAdjustmentScreen::widgets_t::
|
70
|
120
|
}
|
71
|
121
|
|
72
|
122
|
void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) {
|
73
|
|
- CommandProcessor cmd;
|
74
|
|
- cmd.font(font_medium).cmd(COLOR_RGB(bg_text_enabled));
|
75
|
123
|
if (_what & BACKGROUND) {
|
76
|
|
- #ifdef TOUCH_UI_PORTRAIT
|
77
|
|
- cmd.tag(0).fgcolor(bg_color).button( BTN_POS(1, _line), BTN_SIZE(12,1), label, OPT_FLAT);
|
78
|
|
- #else
|
79
|
|
- cmd.tag(0).fgcolor(bg_color).button( BTN_POS(5, _line), BTN_SIZE(8,1), label, OPT_FLAT);
|
80
|
|
- #endif
|
|
124
|
+ CommandProcessor cmd;
|
|
125
|
+ cmd.font(font_medium)
|
|
126
|
+ .text(
|
|
127
|
+ #ifdef TOUCH_UI_PORTRAIT
|
|
128
|
+ BTN_POS(1, _line), BTN_SIZE(12,1),
|
|
129
|
+ #else
|
|
130
|
+ BTN_POS(5, _line), BTN_SIZE(8,1),
|
|
131
|
+ #endif
|
|
132
|
+ label
|
|
133
|
+ );
|
81
|
134
|
}
|
82
|
135
|
|
83
|
136
|
_line++;
|
|
@@ -93,8 +146,7 @@ void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) {
|
93
|
146
|
#endif
|
94
|
147
|
#endif
|
95
|
148
|
|
96
|
|
-void BaseNumericAdjustmentScreen::widgets_t::_draw_increment_btn(uint8_t, const uint8_t tag) {
|
97
|
|
- CommandProcessor cmd;
|
|
149
|
+void BaseNumericAdjustmentScreen::widgets_t::_draw_increment_btn(CommandProcessor &cmd, uint8_t, const uint8_t tag) {
|
98
|
150
|
const char *label = PSTR("?");
|
99
|
151
|
uint8_t pos;
|
100
|
152
|
uint8_t & increment = screen_data.BaseNumericAdjustmentScreen.increment;
|
|
@@ -112,48 +164,43 @@ void BaseNumericAdjustmentScreen::widgets_t::_draw_increment_btn(uint8_t, const
|
112
|
164
|
default: label = PSTR("100" ); pos = _decimals + 2; break;
|
113
|
165
|
}
|
114
|
166
|
|
115
|
|
- cmd.tag(tag)
|
116
|
|
- .colors(increment == tag ? action_btn : normal_btn)
|
117
|
|
- #ifdef TOUCH_UI_PORTRAIT
|
118
|
|
- .font(font_small);
|
119
|
|
- #else
|
120
|
|
- .font(font_medium);
|
121
|
|
- #endif
|
|
167
|
+ const bool highlight = (_what & FOREGROUND) && (increment == tag);
|
|
168
|
+
|
122
|
169
|
switch (pos) {
|
123
|
170
|
#ifdef TOUCH_UI_PORTRAIT
|
124
|
|
- case 0: cmd.button( BTN_POS(5,_line), BTN_SIZE(2,1), progmem_str(label)); break;
|
125
|
|
- case 1: cmd.button( BTN_POS(7,_line), BTN_SIZE(2,1), progmem_str(label)); break;
|
126
|
|
- case 2: cmd.button( BTN_POS(9,_line), BTN_SIZE(2,1), progmem_str(label)); break;
|
|
171
|
+ case 0: _button(cmd, tag, BTN_POS(5,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break;
|
|
172
|
+ case 1: _button(cmd, tag, BTN_POS(7,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break;
|
|
173
|
+ case 2: _button(cmd, tag, BTN_POS(9,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break;
|
127
|
174
|
#else
|
128
|
|
- case 0: cmd.button( BTN_POS(15,2), BTN_SIZE(4,1), progmem_str(label)); break;
|
129
|
|
- case 1: cmd.button( BTN_POS(15,3), BTN_SIZE(4,1), progmem_str(label)); break;
|
130
|
|
- case 2: cmd.button( BTN_POS(15,4), BTN_SIZE(4,1), progmem_str(label)); break;
|
|
175
|
+ case 0: _button(cmd, tag, BTN_POS(15,2), BTN_SIZE(4,1), progmem_str(label), true, highlight); break;
|
|
176
|
+ case 1: _button(cmd, tag, BTN_POS(15,3), BTN_SIZE(4,1), progmem_str(label), true, highlight); break;
|
|
177
|
+ case 2: _button(cmd, tag, BTN_POS(15,4), BTN_SIZE(4,1), progmem_str(label), true, highlight); break;
|
131
|
178
|
#endif
|
132
|
179
|
}
|
133
|
|
- cmd.colors(normal_btn);
|
134
|
180
|
}
|
135
|
181
|
|
136
|
|
-
|
137
|
182
|
void BaseNumericAdjustmentScreen::widgets_t::increments() {
|
|
183
|
+ CommandProcessor cmd;
|
|
184
|
+
|
|
185
|
+ cmd.font(LAYOUT_FONT);
|
|
186
|
+
|
138
|
187
|
if (_what & BACKGROUND) {
|
139
|
|
- CommandProcessor cmd;
|
140
|
|
- cmd.fgcolor(bg_color)
|
141
|
|
- .tag(0)
|
142
|
|
- #ifdef TOUCH_UI_PORTRAIT
|
143
|
|
- .font(font_small).button( BTN_POS(1, _line), BTN_SIZE(4,1), GET_TEXTF(INCREMENT), OPT_FLAT);
|
144
|
|
- #else
|
145
|
|
- .font(font_medium).button( BTN_POS(15,1), BTN_SIZE(4,1), GET_TEXTF(INCREMENT), OPT_FLAT);
|
146
|
|
- #endif
|
|
188
|
+ cmd.text(
|
|
189
|
+ #ifdef TOUCH_UI_PORTRAIT
|
|
190
|
+ BTN_POS(1, _line), BTN_SIZE(4,1),
|
|
191
|
+ #else
|
|
192
|
+ BTN_POS(15, 1), BTN_SIZE(4,1),
|
|
193
|
+ #endif
|
|
194
|
+ GET_TEXTF(INCREMENT)
|
|
195
|
+ );
|
147
|
196
|
}
|
148
|
197
|
|
149
|
|
- if (_what & FOREGROUND) {
|
150
|
|
- _draw_increment_btn(_line+1, 245 - _decimals);
|
151
|
|
- _draw_increment_btn(_line+1, 244 - _decimals);
|
152
|
|
- _draw_increment_btn(_line+1, 243 - _decimals);
|
153
|
|
- }
|
|
198
|
+ _draw_increment_btn(cmd, _line+1, 245 - _decimals);
|
|
199
|
+ _draw_increment_btn(cmd, _line+1, 244 - _decimals);
|
|
200
|
+ _draw_increment_btn(cmd, _line+1, 243 - _decimals);
|
154
|
201
|
|
155
|
202
|
#ifdef TOUCH_UI_PORTRAIT
|
156
|
|
- _line++;
|
|
203
|
+ _line++;
|
157
|
204
|
#endif
|
158
|
205
|
}
|
159
|
206
|
|
|
@@ -161,19 +208,22 @@ void BaseNumericAdjustmentScreen::widgets_t::adjuster_sram_val(uint8_t tag, prog
|
161
|
208
|
CommandProcessor cmd;
|
162
|
209
|
|
163
|
210
|
if (_what & BACKGROUND) {
|
164
|
|
- cmd.enabled(1)
|
|
211
|
+ _button_style(cmd, TEXT_AREA);
|
|
212
|
+ cmd.tag(0)
|
165
|
213
|
.font(font_small)
|
166
|
|
- .fgcolor(_color) .tag(0).button( BTN_POS(5,_line), BTN_SIZE(5,1), F(""), OPT_FLAT)
|
167
|
|
- .cmd(COLOR_RGB(bg_text_enabled))
|
168
|
|
- .fgcolor(bg_color) .tag(0).button( BTN_POS(1,_line), BTN_SIZE(4,1), (progmem_str) label, OPT_FLAT);
|
|
214
|
+ .text( BTN_POS(1,_line), BTN_SIZE(4,1), label)
|
|
215
|
+ .fgcolor(_color).button( BTN_POS(5,_line), BTN_SIZE(5,1), F(""), OPT_FLAT);
|
169
|
216
|
}
|
170
|
217
|
|
171
|
|
- if (_what & FOREGROUND) {
|
172
|
|
- cmd.colors(normal_btn)
|
173
|
|
- .font(font_medium)
|
174
|
|
- .tag(is_enabled ? tag : 0).enabled(is_enabled).button( BTN_POS(10,_line), BTN_SIZE(2,1), F("-"))
|
175
|
|
- .tag(is_enabled ? tag+1 : 0).enabled(is_enabled).button( BTN_POS(12,_line), BTN_SIZE(2,1), F("+"))
|
176
|
|
- .tag(0).font(font_small) .text ( BTN_POS(5,_line), BTN_SIZE(5,1), is_enabled ? value : "-");
|
|
218
|
+ cmd.font(font_medium);
|
|
219
|
+ _button(cmd, tag, BTN_POS(10,_line), BTN_SIZE(2,1), F("-"), is_enabled);
|
|
220
|
+ _button(cmd, tag + 1, BTN_POS(12,_line), BTN_SIZE(2,1), F("+"), is_enabled);
|
|
221
|
+
|
|
222
|
+ if ((_what & FOREGROUND) && is_enabled) {
|
|
223
|
+ _button_style(cmd, BTN_NORMAL);
|
|
224
|
+ cmd.tag(0)
|
|
225
|
+ .font(font_small)
|
|
226
|
+ .text(BTN_POS(5,_line), BTN_SIZE(5,1), value);
|
177
|
227
|
}
|
178
|
228
|
|
179
|
229
|
_line++;
|
|
@@ -206,18 +256,9 @@ void BaseNumericAdjustmentScreen::widgets_t::adjuster(uint8_t tag, progmem_str l
|
206
|
256
|
}
|
207
|
257
|
|
208
|
258
|
void BaseNumericAdjustmentScreen::widgets_t::button(uint8_t tag, progmem_str label, bool is_enabled) {
|
209
|
|
- if (_what & FOREGROUND) {
|
210
|
|
- CommandProcessor cmd;
|
211
|
|
- cmd.colors(normal_btn)
|
212
|
|
- .tag(is_enabled ? tag : 0)
|
213
|
|
- .enabled(is_enabled)
|
214
|
|
- #ifdef TOUCH_UI_PORTRAIT
|
215
|
|
- .font(font_small)
|
216
|
|
- #else
|
217
|
|
- .font(font_medium)
|
218
|
|
- #endif
|
219
|
|
- .button(BTN_POS(5,_line), BTN_SIZE(9,1), label);
|
220
|
|
- }
|
|
259
|
+ CommandProcessor cmd;
|
|
260
|
+ cmd.font(LAYOUT_FONT);
|
|
261
|
+ _button(cmd, tag, BTN_POS(5,_line), BTN_SIZE(9,1), label, is_enabled);
|
221
|
262
|
|
222
|
263
|
_line++;
|
223
|
264
|
}
|
|
@@ -226,89 +267,78 @@ void BaseNumericAdjustmentScreen::widgets_t::text_field(uint8_t tag, progmem_str
|
226
|
267
|
CommandProcessor cmd;
|
227
|
268
|
|
228
|
269
|
if (_what & BACKGROUND) {
|
|
270
|
+ _button_style(cmd, TEXT_AREA);
|
229
|
271
|
cmd.enabled(1)
|
|
272
|
+ .tag(0)
|
230
|
273
|
.font(font_small)
|
231
|
|
- .cmd(COLOR_RGB(bg_text_enabled))
|
232
|
|
- .fgcolor(_color).tag(0).button( BTN_POS(5,_line), BTN_SIZE(9,1), F(""), OPT_FLAT)
|
233
|
|
- .fgcolor(bg_color) .tag(0).button( BTN_POS(1,_line), BTN_SIZE(4,1), label, OPT_FLAT);
|
|
274
|
+ .text( BTN_POS(1,_line), BTN_SIZE(4,1), label)
|
|
275
|
+ .fgcolor(_color)
|
|
276
|
+ .tag(tag)
|
|
277
|
+ .button( BTN_POS(5,_line), BTN_SIZE(9,1), F(""), OPT_FLAT);
|
234
|
278
|
}
|
235
|
279
|
|
236
|
280
|
if (_what & FOREGROUND) {
|
237
|
|
- cmd.colors(normal_btn)
|
238
|
|
- .font(font_medium)
|
239
|
|
- .tag(tag).font(font_small).text ( BTN_POS(5,_line), BTN_SIZE(9,1), is_enabled ? value : "-");
|
|
281
|
+ cmd.font(font_small).text( BTN_POS(5,_line), BTN_SIZE(9,1), is_enabled ? value : "-");
|
240
|
282
|
}
|
241
|
283
|
|
242
|
284
|
_line++;
|
243
|
285
|
}
|
244
|
286
|
|
245
|
287
|
void BaseNumericAdjustmentScreen::widgets_t::two_buttons(uint8_t tag1, progmem_str label1, uint8_t tag2, progmem_str label2, bool is_enabled) {
|
246
|
|
- if (_what & FOREGROUND) {
|
247
|
|
- CommandProcessor cmd;
|
248
|
|
- cmd.enabled(is_enabled)
|
249
|
|
- #ifdef TOUCH_UI_PORTRAIT
|
250
|
|
- .font(font_small)
|
251
|
|
- #else
|
252
|
|
- .font(font_medium)
|
253
|
|
- #endif
|
254
|
|
- .tag(is_enabled ? tag1: 0).button(BTN_POS(5,_line), BTN_SIZE(4.5,1), label1)
|
255
|
|
- .tag(is_enabled ? tag2: 0).button(BTN_POS(9.5,_line), BTN_SIZE(4.5,1), label2);
|
256
|
|
- }
|
|
288
|
+ CommandProcessor cmd;
|
|
289
|
+ cmd.font(LAYOUT_FONT);
|
|
290
|
+ _button(cmd, tag1, BTN_POS(5,_line), BTN_SIZE(4.5,1), label1, is_enabled);
|
|
291
|
+ _button(cmd, tag2, BTN_POS(9.5,_line), BTN_SIZE(4.5,1), label2, is_enabled);
|
257
|
292
|
|
258
|
293
|
_line++;
|
259
|
294
|
}
|
260
|
295
|
|
261
|
296
|
void BaseNumericAdjustmentScreen::widgets_t::toggle(uint8_t tag, progmem_str label, bool value, bool is_enabled) {
|
|
297
|
+ CommandProcessor cmd;
|
|
298
|
+
|
262
|
299
|
if (_what & BACKGROUND) {
|
263
|
|
- CommandProcessor cmd;
|
264
|
|
- cmd.fgcolor(bg_color)
|
265
|
|
- .tag(0)
|
266
|
|
- .font(font_small)
|
267
|
|
- #ifdef TOUCH_UI_PORTRAIT
|
268
|
|
- .button( BTN_POS(1, _line), BTN_SIZE( 8,1), label, OPT_FLAT);
|
269
|
|
- #else
|
270
|
|
- .button( BTN_POS(1, _line), BTN_SIZE(10,1), label, OPT_FLAT);
|
271
|
|
- #endif
|
|
300
|
+ cmd.font(font_small)
|
|
301
|
+ .text(
|
|
302
|
+ #ifdef TOUCH_UI_PORTRAIT
|
|
303
|
+ BTN_POS(1, _line), BTN_SIZE( 8,1),
|
|
304
|
+ #else
|
|
305
|
+ BTN_POS(1, _line), BTN_SIZE(10,1),
|
|
306
|
+ #endif
|
|
307
|
+ label
|
|
308
|
+ );
|
272
|
309
|
}
|
273
|
310
|
|
274
|
311
|
if (_what & FOREGROUND) {
|
275
|
|
- CommandProcessor cmd;
|
|
312
|
+ _button_style(cmd, BTN_TOGGLE);
|
276
|
313
|
cmd.tag(is_enabled ? tag : 0)
|
277
|
314
|
.enabled(is_enabled)
|
278
|
315
|
.font(font_small)
|
279
|
|
- .colors(ui_toggle)
|
280
|
|
- #ifdef TOUCH_UI_PORTRAIT
|
281
|
|
- .toggle2(BTN_POS( 9,_line), BTN_SIZE(5,1), GET_TEXTF(NO), GET_TEXTF(YES), value);
|
282
|
|
- #else
|
283
|
|
- .toggle2(BTN_POS(10,_line), BTN_SIZE(4,1), GET_TEXTF(NO), GET_TEXTF(YES), value);
|
284
|
|
- #endif
|
|
316
|
+ .toggle2(
|
|
317
|
+ #ifdef TOUCH_UI_PORTRAIT
|
|
318
|
+ BTN_POS( 9,_line), BTN_SIZE(5,1),
|
|
319
|
+ #else
|
|
320
|
+ BTN_POS(10,_line), BTN_SIZE(4,1),
|
|
321
|
+ #endif
|
|
322
|
+ GET_TEXTF(NO), GET_TEXTF(YES), value
|
|
323
|
+ );
|
285
|
324
|
}
|
286
|
325
|
|
287
|
326
|
_line++;
|
288
|
327
|
}
|
289
|
328
|
|
290
|
329
|
void BaseNumericAdjustmentScreen::widgets_t::home_buttons(uint8_t tag) {
|
|
330
|
+ CommandProcessor cmd;
|
|
331
|
+
|
291
|
332
|
if (_what & BACKGROUND) {
|
292
|
|
- CommandProcessor cmd;
|
293
|
|
- cmd.fgcolor(bg_color)
|
294
|
|
- .tag(0)
|
295
|
|
- .font(font_small)
|
296
|
|
- .button( BTN_POS(1, _line), BTN_SIZE(4,1), GET_TEXTF(HOME), OPT_FLAT);
|
|
333
|
+ cmd.font(font_small)
|
|
334
|
+ .text(BTN_POS(1, _line), BTN_SIZE(4,1), GET_TEXTF(HOME));
|
297
|
335
|
}
|
298
|
336
|
|
299
|
|
- if (_what & FOREGROUND) {
|
300
|
|
- CommandProcessor cmd;
|
301
|
|
- cmd
|
302
|
|
- #ifdef TOUCH_UI_PORTRAIT
|
303
|
|
- .font(font_small)
|
304
|
|
- #else
|
305
|
|
- .font(font_medium)
|
306
|
|
- #endif
|
307
|
|
- .tag(tag+0).button(BTN_POS(5,_line), BTN_SIZE(2,1), GET_TEXTF(AXIS_X))
|
308
|
|
- .tag(tag+1).button(BTN_POS(7,_line), BTN_SIZE(2,1), GET_TEXTF(AXIS_Y))
|
309
|
|
- .tag(tag+2).button(BTN_POS(9,_line), BTN_SIZE(2,1), GET_TEXTF(AXIS_Z))
|
310
|
|
- .tag(tag+3).button(BTN_POS(11,_line), BTN_SIZE(3,1), GET_TEXTF(AXIS_ALL));
|
311
|
|
- }
|
|
337
|
+ cmd.font(LAYOUT_FONT);
|
|
338
|
+ _button(cmd, tag+0, BTN_POS(5,_line), BTN_SIZE(2,1), GET_TEXTF(AXIS_X));
|
|
339
|
+ _button(cmd, tag+1, BTN_POS(7,_line), BTN_SIZE(2,1), GET_TEXTF(AXIS_Y));
|
|
340
|
+ _button(cmd, tag+2, BTN_POS(9,_line), BTN_SIZE(2,1), GET_TEXTF(AXIS_Z));
|
|
341
|
+ _button(cmd, tag+3, BTN_POS(11,_line), BTN_SIZE(3,1), GET_TEXTF(AXIS_ALL));
|
312
|
342
|
|
313
|
343
|
_line++;
|
314
|
344
|
}
|
|
@@ -316,11 +346,13 @@ void BaseNumericAdjustmentScreen::widgets_t::home_buttons(uint8_t tag) {
|
316
|
346
|
void BaseNumericAdjustmentScreen::onEntry() {
|
317
|
347
|
screen_data.BaseNumericAdjustmentScreen.increment = 0; // This will force the increment to be picked while drawing.
|
318
|
348
|
BaseScreen::onEntry();
|
|
349
|
+ CommandProcessor cmd;
|
|
350
|
+ cmd.set_button_style_callback(nullptr);
|
319
|
351
|
}
|
320
|
352
|
|
321
|
353
|
bool BaseNumericAdjustmentScreen::onTouchEnd(uint8_t tag) {
|
322
|
354
|
switch (tag) {
|
323
|
|
- case 1: GOTO_PREVIOUS(); return true;
|
|
355
|
+ case 1: GOTO_PREVIOUS(); return true;
|
324
|
356
|
case 240 ... 245: screen_data.BaseNumericAdjustmentScreen.increment = tag; break;
|
325
|
357
|
default: return current_screen.onTouchHeld(tag);
|
326
|
358
|
}
|