comparison Discovery/Src/tMenuEditCustom.c @ 750:6bd21ebe1a93

Avoid blinking in customer view selection page: In previous version a sort blink was seen when moving from one option page to the next. The root cause was the complete rebuild of the page. This is not necessary and has been replaced by just updation the label values.
author Ideenmodellierer
date Sun, 05 Mar 2023 22:17:32 +0100
parents 4a6bffaa38b3
children 70e9c83ecf22
comparison
equal deleted inserted replaced
749:9334bdc30d60 750:6bd21ebe1a93
700 customviewsSubpage++; 700 customviewsSubpage++;
701 if(customviewsSubpage == customviewsSubpageMax) 701 if(customviewsSubpage == customviewsSubpageMax)
702 { 702 {
703 customviewsSubpage = 0; 703 customviewsSubpage = 0;
704 } 704 }
705 resetMenuEdit(CLUT_MenuPageCustomView); /* rebuild page */ 705 CustomviewDivemode_refresh();
706 openEdit_CustomviewDivemode(pcv_curchangelist);
707
708 tMenuEdit_select(StMCustom3_CViewSelection6);
709 return UPDATE_DIVESETTINGS; 706 return UPDATE_DIVESETTINGS;
710 } 707 }
711 708
712 uint8_t OnAction_CViewPortCalib(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) 709 uint8_t OnAction_CViewPortCalib(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
713 { 710 {
852 default: 849 default:
853 break; 850 break;
854 } 851 }
855 } 852 }
856 } 853 }
857
858 if(customviewsSubpageMax != 1)
859 {
860 textPointer = 0;
861 text[textPointer++] = TXT_2BYTE;
862 text[textPointer++] = TXT2BYTE_ButtonNext;
863 text[textPointer] = 0;
864 write_field_button(StMCustom3_CViewSelection6, 30, 800, ME_Y_LINE6, &FontT48, text);
865 }
866
867 /* because of the ID handling inside of the functions, all buttons needs to be assigned before the events may be set => have the same loop twice */
868 for(i=0; i<5;i++) /* fill maximum 5 items and leave last one for sub page selection */
869 {
870 id = pcv_changelist[customviewsSubpage * 5 + i];
871 if((id == CVIEW_END) || (id == CVIEW_T3_END)) /* last list item? */
872 {
873 break;
874 }
875 else
876 {
877 switch(i)
878 {
879 case 0: setEvent(StMCustom3_CViewSelection1, (uint32_t)OnAction_Customview_Toggle);
880 break;
881 case 1: setEvent(StMCustom3_CViewSelection2, (uint32_t)OnAction_Customview_Toggle);
882 break;
883 case 2: setEvent(StMCustom3_CViewSelection3, (uint32_t)OnAction_Customview_Toggle);
884 break;
885 case 3: setEvent(StMCustom3_CViewSelection4, (uint32_t)OnAction_Customview_Toggle);
886 break;
887 case 4: setEvent(StMCustom3_CViewSelection5, (uint32_t)OnAction_Customview_Toggle);
888 break;
889
890 default:
891 break;
892 }
893
894 }
895 }
896 if(customviewsSubpageMax != 1)
897 {
898 setEvent(StMCustom3_CViewSelection6,(uint32_t)OnAction_Customview_NextPage);
899 }
900 for(;i<5;i++) /* clear empty lines in case menu shows less than 5 entries */ 854 for(;i<5;i++) /* clear empty lines in case menu shows less than 5 entries */
901 { 855 {
902 switch(i) 856 switch(i)
903 { 857 {
904 case 0: write_label_var( 30, 800, ME_Y_LINE1, &FontT48, ""); 858 case 0: write_label_var( 30, 800, ME_Y_LINE1, &FontT48, "");
913 break; 867 break;
914 default: 868 default:
915 break; 869 break;
916 }; 870 };
917 } 871 }
872 if(customviewsSubpageMax != 1)
873 {
874 textPointer = 0;
875 text[textPointer++] = TXT_2BYTE;
876 text[textPointer++] = TXT2BYTE_ButtonNext;
877 text[textPointer] = 0;
878 write_field_button(StMCustom3_CViewSelection6, 30, 800, ME_Y_LINE6, &FontT48, text);
879 }
880
881 /* because of the ID handling inside of the functions, all buttons needs to be assigned before the events may be set => have the same loop twice */
882 for(i=0; i<5;i++) /* fill maximum 5 items and leave last one for sub page selection */
883 {
884 id = pcv_changelist[customviewsSubpage * 5 + i];
885 if((id == CVIEW_END) || (id == CVIEW_T3_END)) /* last list item? */
886 {
887 break;
888 }
889 else
890 {
891 switch(i)
892 {
893 case 0: setEvent(StMCustom3_CViewSelection1, (uint32_t)OnAction_Customview_Toggle);
894 break;
895 case 1: setEvent(StMCustom3_CViewSelection2, (uint32_t)OnAction_Customview_Toggle);
896 break;
897 case 2: setEvent(StMCustom3_CViewSelection3, (uint32_t)OnAction_Customview_Toggle);
898 break;
899 case 3: setEvent(StMCustom3_CViewSelection4, (uint32_t)OnAction_Customview_Toggle);
900 break;
901 case 4: setEvent(StMCustom3_CViewSelection5, (uint32_t)OnAction_Customview_Toggle);
902 break;
903
904 default:
905 break;
906 }
907
908 }
909 }
910 if(customviewsSubpageMax != 1)
911 {
912 setEvent(StMCustom3_CViewSelection6,(uint32_t)OnAction_Customview_NextPage);
913 }
914
918 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); 915 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
919 } 916 }
920 917
921 void openEdit_CustomviewDivemodeMenu(uint8_t line) 918 void openEdit_CustomviewDivemodeMenu(uint8_t line)
922 { 919 {