From a5d92d7a087c72282afe62f4946ec29c92bf2f3b Mon Sep 17 00:00:00 2001 From: Emanuele Conti Date: Thu, 26 Jan 2023 15:00:34 +0000 Subject: [PATCH] Used array lenght to hide right arrow --- applications/plugins/hid_app/views/hid_mouse_jiggler.c | 3 ++- applications/plugins/usbkeyboard/views/usb_hid_mouse_jiggler.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/applications/plugins/hid_app/views/hid_mouse_jiggler.c b/applications/plugins/hid_app/views/hid_mouse_jiggler.c index 92b9c619b..9ea8607bc 100644 --- a/applications/plugins/hid_app/views/hid_mouse_jiggler.c +++ b/applications/plugins/hid_app/views/hid_mouse_jiggler.c @@ -48,7 +48,8 @@ static void hid_mouse_jiggler_draw_callback(Canvas* canvas, void* context) { elements_multiline_text(canvas, AlignLeft, 26, "Interval (ms):"); canvas_set_font(canvas, FontSecondary); if(model->interval_idx != 0) canvas_draw_icon(canvas, 74, 19, &I_ButtonLeft_4x7); - if(model->interval_idx != 5) canvas_draw_icon(canvas, 80, 19, &I_ButtonRight_4x7); + if(model->interval_idx != LENGTH(intervals) - 1) + canvas_draw_icon(canvas, 80, 19, &I_ButtonRight_4x7); elements_multiline_text(canvas, 91, 26, string_get_cstr(interval_str)); canvas_set_font(canvas, FontPrimary); diff --git a/applications/plugins/usbkeyboard/views/usb_hid_mouse_jiggler.c b/applications/plugins/usbkeyboard/views/usb_hid_mouse_jiggler.c index dafb70e21..0b938ea59 100644 --- a/applications/plugins/usbkeyboard/views/usb_hid_mouse_jiggler.c +++ b/applications/plugins/usbkeyboard/views/usb_hid_mouse_jiggler.c @@ -38,7 +38,8 @@ static void hid_mouse_jiggler_draw_callback(Canvas* canvas, void* context) { elements_multiline_text(canvas, AlignLeft, 26, "Interval (ms):"); canvas_set_font(canvas, FontSecondary); if(model->interval_idx != 0) canvas_draw_icon(canvas, 74, 19, &I_ButtonLeft_4x7); - if(model->interval_idx != 5) canvas_draw_icon(canvas, 80, 19, &I_ButtonRight_4x7); + if(model->interval_idx != LENGTH(intervals) - 1) + canvas_draw_icon(canvas, 80, 19, &I_ButtonRight_4x7); elements_multiline_text(canvas, 91, 26, string_get_cstr(interval_str)); canvas_set_font(canvas, FontPrimary);