From: b Date: Wed, 1 Jan 2025 22:30:28 +0000 (+0100) Subject: total reset and MIDI pedal options are not underlined X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=bfc5654efd0410469848f9984966aa0c0a89beb5;p=klavirko%2Fui total reset and MIDI pedal options are not underlined --- diff --git a/gui.c b/gui.c index 5106084..581a1bd 100644 --- a/gui.c +++ b/gui.c @@ -969,19 +969,16 @@ inline void gui_event_options (const uint16_t event) } else if (event & BUTTON_E) { - if (gui_choice != 4) - lcd_select_button(gui_choice, 0); - gui_choice = 4; - lcd_select_button(4, 1); - lcd_update_title(GUI_TITLE_OPTION_MIDI_PEDAL); + lcd_select_button(gui_choice, 0); + gui_choice = GUI_NOCHOICE; + lcd_update_title(GUI_TITLE_OPTIONS); } else if (event & BUTTON_F) { - if (gui_choice != 5) - lcd_select_button(gui_choice, 0); - gui_choice = 5; - lcd_update_button(5, GUI_BUTTONTEXT_CONFIRM_RESET, 1); - lcd_update_title(GUI_TITLE_OPTION_TRANSPOSE); + lcd_select_button(gui_choice, 0); + gui_choice = GUI_NOCHOICE; + lcd_update_button(5, GUI_BUTTONTEXT_CONFIRM_RESET, 0); + lcd_update_title(GUI_TITLE_OPTIONS); } break; case EVENT_HOLD: @@ -989,14 +986,14 @@ inline void gui_event_options (const uint16_t event) { set_tuning(DEFAULT_TUNING); make_text_tuning(); - lcd_update_button(0, text_tuning, 1); + lcd_update_button(0, text_tuning, gui_choice == 0); reject_gui_events(); } else if (event & BUTTON_B) { set_transp(0); make_text_transpose(); - lcd_update_button(1, text_transpose, 1); + lcd_update_button(1, text_transpose, gui_choice == 1); reject_gui_events(); } else if (event & BUTTON_C) @@ -1004,7 +1001,7 @@ inline void gui_event_options (const uint16_t event) midi_id = N_MIDI_ID; ctrl_update_midi(); make_text_midi_in(); - lcd_update_button(2, text_midi_in, 1); + lcd_update_button(2, text_midi_in, gui_choice == 2); reject_gui_events(); } else if (event & BUTTON_D) @@ -1012,7 +1009,7 @@ inline void gui_event_options (const uint16_t event) midi_id_out = 0; ctrl_update_midi(); make_text_midi_out(); - lcd_update_button(3, text_midi_out, 1); + lcd_update_button(3, text_midi_out, gui_choice == 3); reject_gui_events(); } // no long press on button E @@ -1032,17 +1029,17 @@ inline void gui_event_options (const uint16_t event) if (midi_pedal_en) { midi_pedal_en = 0; - lcd_update_button(4, GUI_BUTTONTEXT_MIDI_NOPEDAL, 1); + lcd_update_button(4, GUI_BUTTONTEXT_MIDI_NOPEDAL, 0); } else { midi_pedal_en = 1; - lcd_update_button(4, GUI_BUTTONTEXT_MIDI_PEDAL, 1); + lcd_update_button(4, GUI_BUTTONTEXT_MIDI_PEDAL, 0); } ctrl_update_midi(); } else if (event & BUTTON_F) - lcd_update_button(5, GUI_BUTTONTEXT_RESET, 1); + lcd_update_button(5, GUI_BUTTONTEXT_RESET, 0); break; case EVENT_JOG: switch (gui_choice) diff --git a/gui.h b/gui.h index 78bfd27..4982789 100644 --- a/gui.h +++ b/gui.h @@ -122,8 +122,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #define GUI_TITLE_OPTION_TRANSPOSE "Options: (transpose)" #define GUI_TITLE_OPTION_MIDI_ID "Options: (MIDI in ID)" #define GUI_TITLE_OPTION_MIDI_OUT_ID "Options: (MIDI out ID)" -#define GUI_TITLE_OPTION_MIDI_PEDAL "Options: (MIDI pedal)" -#define GUI_TITLE_OPTION_RESET "Options: (TOTAL RESET)" #define GUI_BUTTONTEXT_DEL "