From 7264391c5fee7049e20f00d7e58c7699323df77c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 1 Oct 2022 09:35:42 +0000 Subject: [PATCH] PFW-1358 Fix and optimise button choice positions --- Firmware/mmu2_reporting.cpp | 9 +++------ Firmware/ultralcd.cpp | 10 +++------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Firmware/mmu2_reporting.cpp b/Firmware/mmu2_reporting.cpp index 1620c4804..41e21c988 100644 --- a/Firmware/mmu2_reporting.cpp +++ b/Firmware/mmu2_reporting.cpp @@ -76,7 +76,7 @@ static void ReportErrorHookStaticRender(uint8_t ei) { ReportErrorHookSensorLineRender(); // Render the choices - lcd_show_choices_prompt_P(two_choices ? LCD_LEFT_BUTTON_CHOICE : LCD_MIDDLE_BUTTON_CHOICE, _T(PrusaErrorButtonTitle(button_op_middle)), _T(two_choices ? PrusaErrorButtonMore() : PrusaErrorButtonTitle(button_op_right)), 10, two_choices ? nullptr : _T(PrusaErrorButtonMore())); + lcd_show_choices_prompt_P(two_choices ? LCD_LEFT_BUTTON_CHOICE : LCD_MIDDLE_BUTTON_CHOICE, _T(PrusaErrorButtonTitle(button_op_middle)), _T(two_choices ? PrusaErrorButtonMore() : PrusaErrorButtonTitle(button_op_right)), 9, two_choices ? nullptr : _T(PrusaErrorButtonMore())); } extern void ReportErrorHookSensorLineRender() @@ -164,15 +164,12 @@ static uint8_t ReportErrorHookMonitor(uint8_t ei) { // lcd_set_cursor(0, 3); lcd_print(current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); + lcd_set_cursor(9, 3); + lcd_print(current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); if (two_choices == false) { - lcd_set_cursor(9, 3); - lcd_print(current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); lcd_set_cursor(18, 3); lcd_print(current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); - } else { - lcd_set_cursor(10, 3); - lcd_print(current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); } // Consume rotation event and make feedback sound enc_dif = lcd_encoder_diff; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 7b6fa4c77..c21b99989 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -3172,18 +3172,14 @@ void lcd_show_choices_prompt_P(uint8_t selected, const char *first_choice, const lcd_set_cursor(0, 3); lcd_print(selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); lcd_puts_P(first_choice); + lcd_set_cursor(second_col, 3); + lcd_print(selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); + lcd_puts_P(second_choice); if (third_choice) { - lcd_set_cursor(9, 3); - lcd_print(selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); - lcd_puts_P(second_choice); lcd_set_cursor(18, 3); lcd_print(selected == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); lcd_puts_P(third_choice); - } else { - lcd_set_cursor(second_col, 3); - lcd_print(selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); - lcd_puts_P(second_choice); } }