@@ -262,43 +262,38 @@ void MarlinUI::draw_status_screen() {
262
262
tft.set_background (COLOR_BACKGROUND);
263
263
tft.add_rectangle (0 , 0 , TFT_WIDTH - 8 , 34 , COLOR_AXIS_HOMED);
264
264
265
- uint16_t color;
266
- uint16_t offset;
267
- bool is_homed;
268
-
269
265
tft.add_text ( 16 , 3 , COLOR_AXIS_HOMED , " X" );
270
266
tft.add_text (192 , 3 , COLOR_AXIS_HOMED , " Y" );
271
267
tft.add_text (330 , 3 , COLOR_AXIS_HOMED , " Z" );
272
268
273
- is_homed = TEST (axis_homed, X_AXIS);
274
- tft_string.set (blink & !is_homed ? " ?" : ftostr4sign (LOGICAL_X_POSITION (current_position.x )));
275
- tft.add_text (102 - tft_string.width (), 3 , is_homed ? COLOR_AXIS_HOMED : COLOR_AXIS_NOT_HOMED , tft_string);
269
+ bool not_homed = axis_should_home ( X_AXIS);
270
+ tft_string.set (blink && not_homed ? " ?" : ftostr4sign (LOGICAL_X_POSITION (current_position.x )));
271
+ tft.add_text (102 - tft_string.width (), 3 , not_homed ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED , tft_string);
276
272
277
- is_homed = TEST (axis_homed, Y_AXIS);
278
- tft_string.set (blink & !is_homed ? " ?" : ftostr4sign (LOGICAL_Y_POSITION (current_position.y )));
279
- tft.add_text (280 - tft_string.width (), 3 , is_homed ? COLOR_AXIS_HOMED : COLOR_AXIS_NOT_HOMED , tft_string);
273
+ not_homed = axis_should_home ( Y_AXIS);
274
+ tft_string.set (blink && not_homed ? " ?" : ftostr4sign (LOGICAL_Y_POSITION (current_position.y )));
275
+ tft.add_text (280 - tft_string.width (), 3 , not_homed ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED , tft_string);
280
276
281
- is_homed = TEST (axis_homed, Z_AXIS);
282
- if (blink & !is_homed) {
277
+ uint16_t offset = 32 ;
278
+ not_homed = axis_should_home (Z_AXIS);
279
+ if (blink && not_homed)
283
280
tft_string.set (" ?" );
284
- offset = 32 ; // ".00"
285
- }
286
281
else {
287
282
const float z = LOGICAL_Z_POSITION (current_position.z );
288
283
tft_string.set (ftostr52sp ((int16_t )z));
289
284
tft_string.rtrim ();
290
- offset = tft_string.width ();
285
+ offset + = tft_string.width ();
291
286
292
287
tft_string.set (ftostr52sp (z));
293
- offset += 32 - tft_string.width ();
288
+ offset -= tft_string.width ();
294
289
}
295
- tft.add_text (455 - tft_string.width () - offset, 3 , is_homed ? COLOR_AXIS_HOMED : COLOR_AXIS_NOT_HOMED , tft_string);
290
+ tft.add_text (455 - tft_string.width () - offset, 3 , not_homed ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED , tft_string);
296
291
TERN_ (TOUCH_SCREEN, touch.add_control (MOVE_AXIS, 4 , 132 , TFT_WIDTH - 8 , 34 ));
297
292
298
293
// feed rate
299
294
tft.canvas (96 , 180 , 100 , 32 );
300
295
tft.set_background (COLOR_BACKGROUND);
301
- color = feedrate_percentage == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED;
296
+ uint16_t color = feedrate_percentage == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED;
302
297
tft.add_image (0 , 0 , imgFeedRate, color);
303
298
tft_string.set (i16tostr3rj (feedrate_percentage));
304
299
tft_string.add (' %' );
0 commit comments