1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-06-14 02:30:41 +00:00

Initial support for vertical switchers and sliders.

Documentation to be added in a later commit.
This commit is contained in:
Ian Gray
2022-01-21 23:30:08 +00:00
parent 9cd15db1ad
commit 334bf16b09
7 changed files with 99 additions and 51 deletions

View File

@ -855,6 +855,14 @@ void ESPUIClass::setPanelWide(uint16_t id, bool wide) {
}
}
void ESPUIClass::setVertical(uint16_t id, bool vert) {
Control* control = getControl(id);
if (control)
{
control->vertical = vert;
}
}
void ESPUIClass::updateControl(uint16_t id, int clientId)
{
Control* control = getControl(id);
@ -1097,6 +1105,8 @@ void ESPUIClass::prepareJSONChunk(AsyncWebSocketClient* client, uint16_t startin
item["elementStyle"] = String(control->elementStyle);
if (control->wide == true)
item["wide"] = true;
if (control->vertical == true)
item["vertical"] = true;
if (control->parentControl != Control::noParent)
{

View File

@ -141,6 +141,7 @@ public:
ControlColor color;
bool visible;
bool wide;
bool vertical;
uint16_t parentControl;
String panelStyle;
String elementStyle;
@ -157,6 +158,7 @@ public:
color(color),
visible(visible),
wide(false),
vertical(false),
parentControl(parentControl),
next(nullptr)
{
@ -298,6 +300,7 @@ public:
void setElementStyle(uint16_t id, String style, int clientId = -1);
void setPanelWide(uint16_t id, bool wide);
void setVertical(uint16_t id, bool vert = true);
// Variables
const char* ui_title = "ESPUI"; // Store UI Title and Header Name

File diff suppressed because one or more lines are too long