Fix about screen (#2907)

* Fix about screen
* About: use COUNT_OF

Co-authored-by: Andrey Zakharov <andzhr@yandex.ru>
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Andrey Zakharov 2023-08-02 08:19:00 +03:00 committed by GitHub
parent 9fd9dd85e3
commit 7a45db3881
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,6 +87,7 @@ static DialogMessageButton icon2_screen(DialogsApp* dialogs, DialogMessage* mess
message, furi_hal_version_get_mic_id(), 63, 27, AlignLeft, AlignCenter);
result = dialog_message_show(dialogs, message);
dialog_message_set_icon(message, NULL, 0, 0);
dialog_message_set_text(message, NULL, 0, 0, AlignLeft, AlignTop);
return result;
}
@ -172,8 +173,6 @@ const AboutDialogScreen about_screens[] = {
hw_version_screen,
fw_version_screen};
const size_t about_screens_count = sizeof(about_screens) / sizeof(AboutDialogScreen);
int32_t about_settings_app(void* p) {
UNUSED(p);
DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
@ -194,7 +193,7 @@ int32_t about_settings_app(void* p) {
view_dispatcher_switch_to_view(view_dispatcher, empty_screen_index);
while(1) {
if(screen_index >= about_screens_count - 1) {
if(screen_index >= COUNT_OF(about_screens) - 1) {
dialog_message_set_buttons(message, "Back", NULL, NULL);
} else {
dialog_message_set_buttons(message, "Back", NULL, "Next");
@ -209,7 +208,7 @@ int32_t about_settings_app(void* p) {
screen_index--;
}
} else if(screen_result == DialogMessageButtonRight) {
if(screen_index < about_screens_count) {
if(screen_index < COUNT_OF(about_screens) - 1) {
screen_index++;
}
} else if(screen_result == DialogMessageButtonBack) {