fix(color): popup menu toolbar may be clipped if only two entries (#7801)
This commit is contained in:
@@ -374,7 +374,7 @@ void Menu::updatePosition()
|
|||||||
coord_t cw = lv_obj_get_width(content->getLvObj());
|
coord_t cw = lv_obj_get_width(content->getLvObj());
|
||||||
coord_t ch = lv_obj_get_height(content->getLvObj());
|
coord_t ch = lv_obj_get_height(content->getLvObj());
|
||||||
coord_t tw = lv_obj_get_width(toolbar->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(toolbar->getLvObj(), LV_ALIGN_CENTER, -cw / 2, 0);
|
||||||
lv_obj_align(content->getLvObj(), LV_ALIGN_CENTER, tw / 2, 0);
|
lv_obj_align(content->getLvObj(), LV_ALIGN_CENTER, tw / 2, 0);
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
#include "modal_window.h"
|
#include "modal_window.h"
|
||||||
|
|
||||||
class MaskBitmap;
|
class MaskBitmap;
|
||||||
class Menu;
|
|
||||||
class MenuWindowContent;
|
class MenuWindowContent;
|
||||||
class MenuToolbar;
|
class MenuToolbar;
|
||||||
|
|
||||||
|
|||||||
@@ -180,6 +180,8 @@ void MenuToolbar::addButton(const char* picto, int16_t filtermin,
|
|||||||
rect_t r = getButtonRect(wideButton);
|
rect_t r = getButtonRect(wideButton);
|
||||||
auto button = new MenuToolbarButton(this, r, picto);
|
auto button = new MenuToolbarButton(this, r, picto);
|
||||||
|
|
||||||
|
setHeight(r.y + r.h + PAD_LARGE);
|
||||||
|
|
||||||
button->setPressHandler(std::bind(&MenuToolbar::filterMenu, this, button,
|
button->setPressHandler(std::bind(&MenuToolbar::filterMenu, this, button,
|
||||||
filtermin, filtermax, filterFunc, title));
|
filtermin, filtermax, filterFunc, title));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user