mirror of
https://github.com/s00500/ESPUI.git
synced 2025-07-04 06:10:18 +00:00
Merge pull request #147 from iangray001/designupdates
Separators, grouped controls, and wide controls
This commit is contained in:
@ -714,6 +714,10 @@ uint16_t ESPUIClass::gauge(const char* label, ControlColor color, int number, in
|
||||
return numberId;
|
||||
}
|
||||
|
||||
uint16_t ESPUIClass::separator(const char* label) {
|
||||
return addControl(ControlType::Separator, label, "", ControlColor::Alizarin, Control::noParent, nullptr);
|
||||
}
|
||||
|
||||
uint16_t ESPUIClass::accelerometer(const char* label, void (*callback)(Control*, int), ControlColor color)
|
||||
{
|
||||
return addControl(ControlType::Accel, label, "", color, Control::noParent, callback);
|
||||
@ -821,6 +825,14 @@ void ESPUIClass::setElementStyle(uint16_t id, String style, int clientId)
|
||||
}
|
||||
}
|
||||
|
||||
void ESPUIClass::setPanelWide(uint16_t id, bool wide) {
|
||||
Control* control = getControl(id);
|
||||
if (control)
|
||||
{
|
||||
control->wide = wide;
|
||||
}
|
||||
}
|
||||
|
||||
void ESPUIClass::updateControl(uint16_t id, int clientId)
|
||||
{
|
||||
Control* control = getControl(id);
|
||||
@ -1034,6 +1046,8 @@ Control* ESPUIClass::prepareJSONChunk(AsyncWebSocketClient* client, Control* con
|
||||
item["panelStyle"] = String(control->panelStyle);
|
||||
if (control->elementStyle != 0)
|
||||
item["elementStyle"] = String(control->elementStyle);
|
||||
if (control->wide == true)
|
||||
item["wide"] = true;
|
||||
|
||||
if (control->parentControl != Control::noParent)
|
||||
{
|
||||
|
Reference in New Issue
Block a user