fix(color): popup menu toolbar may be clipped if only two entries (#7801)

This commit is contained in:
philmoz
2026-09-18 10:09:03 +10:00
committed by GitHub
parent 7744df16fd
commit 6fe19b2bfd
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -374,7 +374,7 @@ void Menu::updatePosition()
coord_t cw = lv_obj_get_width(content->getLvObj());
coord_t ch = lv_obj_get_height(content->getLvObj());
coord_t tw = lv_obj_get_width(toolbar->getLvObj());
coord_t th = lv_obj_get_height(toolbar->getLvObj());
coord_t th = max((coord_t)lv_obj_get_height(toolbar->getLvObj()), toolbar->height());
lv_obj_align(toolbar->getLvObj(), LV_ALIGN_CENTER, -cw / 2, 0);
lv_obj_align(content->getLvObj(), LV_ALIGN_CENTER, tw / 2, 0);
-1
View File
@@ -21,7 +21,6 @@
#include "modal_window.h"
class MaskBitmap;
class Menu;
class MenuWindowContent;
class MenuToolbar;
@@ -180,6 +180,8 @@ void MenuToolbar::addButton(const char* picto, int16_t filtermin,
rect_t r = getButtonRect(wideButton);
auto button = new MenuToolbarButton(this, r, picto);
setHeight(r.y + r.h + PAD_LARGE);
button->setPressHandler(std::bind(&MenuToolbar::filterMenu, this, button,
filtermin, filtermax, filterFunc, title));