TFT: No timeout on Move Screen (#19426)

This commit is contained in:
Victor Oliveira 2020-09-25 16:58:28 -03:00 committed by GitHub
parent 7ce91c5ffe
commit 178a1da165
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -956,24 +956,17 @@ static void drawBtn(int x, int y, const char* label, int32_t data, MarlinImage i
uint16_t width = Images[imgBtn52Rounded].width;
uint16_t height = Images[imgBtn52Rounded].height;
tft.queue.sync(); //need sync to change font
if (!enabled) bgColor = COLOR_CONTROL_DISABLED;
tft.canvas(x, y, width, height);
tft.set_background(COLOR_BACKGROUND);
tft.add_image(0, 0, imgBtn52Rounded, bgColor, COLOR_BACKGROUND, COLOR_DARKGREY);
// TODO: Make an add_text() taking a font arg
if (label != NULL) {
tft.set_font(Helvetica12Bold);
tft_string.set_font(Helvetica12Bold);
tft_string.set(label);
tft_string.trim();
tft.add_text(tft_string.center(width), height / 2 - tft_string.font_height() / 2, bgColor, tft_string);
tft.queue.sync();
tft_string.set_font(Helvetica18);
tft.set_font(Helvetica18);
}
else {
tft.add_image(0, 0, img, bgColor, COLOR_BACKGROUND, COLOR_DARKGREY);
@ -984,6 +977,7 @@ static void drawBtn(int x, int y, const char* label, int32_t data, MarlinImage i
void MarlinUI::move_axis_screen() {
// Reset
defer_status_screen(true);
motionAxisState.blocked = false;
touch.enable();