From 6b281622bc40825e4d8e313e32a059f23e4bd3af Mon Sep 17 00:00:00 2001 From: gebeto Date: Sun, 15 Jan 2023 13:24:52 +0200 Subject: [PATCH 1/3] fix width of submenu items on vertical view --- applications/services/gui/modules/submenu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/applications/services/gui/modules/submenu.c b/applications/services/gui/modules/submenu.c index 72626c587de..88c1c55d43c 100644 --- a/applications/services/gui/modules/submenu.c +++ b/applications/services/gui/modules/submenu.c @@ -1,4 +1,5 @@ #include "submenu.h" +#include #include #include @@ -63,7 +64,12 @@ static void submenu_view_draw_callback(Canvas* canvas, void* _model) { SubmenuModel* model = _model; const uint8_t item_height = 16; - const uint8_t item_width = 123; + uint8_t item_width = 123; + + if(canvas->orientation == CanvasOrientationVertical || + canvas->orientation == CanvasOrientationVerticalFlip) { + item_width = 60; + } canvas_clear(canvas); From c5789b143eb8140fca7dc389a5de7b3cdf05a968 Mon Sep 17 00:00:00 2001 From: Aleksandr Kutuzov Date: Sat, 1 Jul 2023 00:36:58 +0900 Subject: [PATCH 2/3] Gui: slightly better canvas width handling in submenu --- applications/services/gui/modules/submenu.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/applications/services/gui/modules/submenu.c b/applications/services/gui/modules/submenu.c index ac1df719210..87baa793867 100644 --- a/applications/services/gui/modules/submenu.c +++ b/applications/services/gui/modules/submenu.c @@ -64,12 +64,7 @@ static void submenu_view_draw_callback(Canvas* canvas, void* _model) { SubmenuModel* model = _model; const uint8_t item_height = 16; - uint8_t item_width = 123; - - if(canvas->orientation == CanvasOrientationVertical || - canvas->orientation == CanvasOrientationVerticalFlip) { - item_width = 60; - } + uint8_t item_width = canvas_width(canvas) - 5; canvas_clear(canvas); From cec79d4682a9f5182f946462128b0afdbbba1170 Mon Sep 17 00:00:00 2001 From: Aleksandr Kutuzov Date: Sat, 1 Jul 2023 00:38:34 +0900 Subject: [PATCH 3/3] Gui: remove unused include --- applications/services/gui/modules/submenu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/applications/services/gui/modules/submenu.c b/applications/services/gui/modules/submenu.c index 87baa793867..3ba35edde07 100644 --- a/applications/services/gui/modules/submenu.c +++ b/applications/services/gui/modules/submenu.c @@ -1,5 +1,4 @@ #include "submenu.h" -#include #include #include