Move magnifier settings into theme

This commit is contained in:
Simon Long 2024-05-03 15:22:18 +01:00
parent 15f35ed2ba
commit 19a57c6ea4
5 changed files with 62 additions and 79 deletions

View file

@ -746,28 +746,6 @@ set_adaptive_sync_mode(const char *str, enum adaptive_sync_mode *variable)
}
}
static bool parse_rgb(const char *str, int *r, int *g, int *b)
{
int rr, rg, rb;
if (!str) {
return false;
}
if (strlen(str) != 7) {
return false;
}
if (str[0] != '#') {
return false;
}
if (sscanf(str, "#%2X%2X%2X", &rr, &rg, &rb) != 3) {
return false;
}
*r = rr;
*g = rg;
*b = rb;
return true;
}
static void
entry(xmlNode *node, char *nodename, char *content)
{
@ -1058,19 +1036,6 @@ entry(xmlNode *node, char *nodename, char *content)
}
} else if (!strcasecmp(nodename, "ignoreButtonReleasePeriod.menu")) {
rc.menu_ignore_button_release_period = atoi(content);
} else if (!strcasecmp(nodename, "width.magnifier")) {
rc.mag_width = atoi(content);
} else if (!strcasecmp(nodename, "height.magnifier")) {
rc.mag_height = atoi(content);
} else if (!strcasecmp(nodename, "initScale.magnifier")) {
rc.mag_scale = atoi(content);
} else if (!strcasecmp(nodename, "borderColour.magnifier")) {
parse_rgb(content, &rc.mag_border_col.r, &rc.mag_border_col.g,
&rc.mag_border_col.b);
} else if (!strcasecmp(nodename, "borderWidth.magnifier")) {
rc.mag_border_width = atoi(content);
} else if (!strcasecmp(nodename, "useFilter.magnifier")) {
set_bool(content, &rc.mag_filter);
}
}
@ -1277,15 +1242,6 @@ rcxml_init(void)
rc.workspace_config.min_nr_workspaces = 1;
rc.menu_ignore_button_release_period = 250;
rc.mag_scale = 2;
rc.mag_width = 400;
rc.mag_height = 400;
rc.mag_border_col.r = 255;
rc.mag_border_col.g = 0;
rc.mag_border_col.b = 0;
rc.mag_border_width = 1;
rc.mag_filter = true;
}
static void