From 86fc0f9988cf46031557f534abd26b4b5ced3917 Mon Sep 17 00:00:00 2001 From: Alfredo Monclus Date: Mon, 17 Jan 2022 03:12:54 -0300 Subject: [PATCH] Menu: Arrange 3 x 2 and 2 x 2 (#442) * Arrange 3 x 3 and 2 x 2 * typo --- panels/menu.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/panels/menu.py b/panels/menu.py index 7bc39d2d..93f3702f 100644 --- a/panels/menu.py +++ b/panels/menu.py @@ -43,6 +43,14 @@ class MenuPanel(ScreenPanel): if not self.evaluate_enable(item[key]['enable']): continue + if columns == 4: + if length <= 4: + # Arrange 2 x 2 + columns = 2 + elif length > 4 and length <= 6: + # Arrange 3 x 2 + columns = 3 + col = i % columns row = int(i/columns) width = 1