Load width and height for widgets.

This commit is contained in:
Steve 2018-02-14 22:32:03 +00:00
parent 6e93955589
commit 3e23d83f3a
2 changed files with 4 additions and 0 deletions

View File

@ -471,6 +471,8 @@ struct Widget {
int type; int type;
int x; int x;
int y; int y;
int w;
int h;
int visible; int visible;
int enabled; int enabled;
int numOptions; int numOptions;

View File

@ -216,6 +216,8 @@ static void loadWidgetGroup(char *filename)
STRNCPY(w->label, cJSON_GetObjectItem(node, "label")->valuestring, MAX_NAME_LENGTH); STRNCPY(w->label, cJSON_GetObjectItem(node, "label")->valuestring, MAX_NAME_LENGTH);
w->x = cJSON_GetObjectItem(node, "x")->valueint; w->x = cJSON_GetObjectItem(node, "x")->valueint;
w->y = cJSON_GetObjectItem(node, "y")->valueint; w->y = cJSON_GetObjectItem(node, "y")->valueint;
w->w = cJSON_GetObjectItem(node, "w")->valueint;
w->h = cJSON_GetObjectItem(node, "h")->valueint;
w->type = lookup(cJSON_GetObjectItem(node, "type")->valuestring); w->type = lookup(cJSON_GetObjectItem(node, "type")->valuestring);
switch (w->type) switch (w->type)