Cosmetics
This commit is contained in:
+12
-2
@@ -26,6 +26,14 @@ void ExpansionPanel::updateHeight()
|
|||||||
setHeight(newHeight);
|
setHeight(newHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ExpansionPanel::setFocus(uint8_t flag)
|
||||||
|
{
|
||||||
|
if (!enabled || isOpen)
|
||||||
|
FormGroup::setFocus(flag);
|
||||||
|
else
|
||||||
|
header->setFocus(flag);
|
||||||
|
}
|
||||||
|
|
||||||
ExpansionPanelHeader::ExpansionPanelHeader(ExpansionPanel * parent):
|
ExpansionPanelHeader::ExpansionPanelHeader(ExpansionPanel * parent):
|
||||||
FormGroup(parent, {0, 0, parent->width(), parent->height()}, FORWARD_SCROLL)
|
FormGroup(parent, {0, 0, parent->width(), parent->height()}, FORWARD_SCROLL)
|
||||||
{
|
{
|
||||||
@@ -57,8 +65,10 @@ void ExpansionPanelHeader::onEvent(event_t event)
|
|||||||
#if defined(HARDWARE_TOUCH)
|
#if defined(HARDWARE_TOUCH)
|
||||||
bool ExpansionPanelHeader::onTouchEnd(coord_t, coord_t)
|
bool ExpansionPanelHeader::onTouchEnd(coord_t, coord_t)
|
||||||
{
|
{
|
||||||
static_cast<ExpansionPanel *>(parent)->toggle();
|
if (enabled) {
|
||||||
setFocus(SET_FOCUS_DEFAULT);
|
static_cast<ExpansionPanel *>(parent)->toggle();
|
||||||
|
setFocus(SET_FOCUS_DEFAULT);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-7
@@ -73,13 +73,7 @@ class ExpansionPanel: public FormGroup
|
|||||||
|
|
||||||
void updateHeight();
|
void updateHeight();
|
||||||
|
|
||||||
void setFocus(uint8_t flag) override
|
void setFocus(uint8_t flag) override;
|
||||||
{
|
|
||||||
if (isOpen)
|
|
||||||
FormGroup::setFocus(flag);
|
|
||||||
else
|
|
||||||
header->setFocus(flag);
|
|
||||||
}
|
|
||||||
|
|
||||||
FormGroup * body = nullptr;
|
FormGroup * body = nullptr;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user