summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-11-04 13:25:59 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-11-04 13:25:59 (EDT)
commitc0b07c73529012f9df3c1f4a1f5fcb087fd0a1ec (patch)
treebfddf6c53568f79a91caa449b525dcda91309db9
parent5b4c3c356b93347d3fac1f07d31fa4e44db3757c (diff)
downloadmarquee-c0b07c73529012f9df3c1f4a1f5fcb087fd0a1ec.zip
marquee-c0b07c73529012f9df3c1f4a1f5fcb087fd0a1ec.tar.gz
marquee-c0b07c73529012f9df3c1f4a1f5fcb087fd0a1ec.tar.bz2
mq_html_input_number_d(): Allow label to be disabled
-rw-r--r--src/utils/html.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/utils/html.c b/src/utils/html.c
index 3b5be2c..9632baa 100644
--- a/src/utils/html.c
+++ b/src/utils/html.c
@@ -664,11 +664,21 @@ gchar *
mq_html_input_number_d(const gchar *name, const gchar *label,
gdouble min, gdouble step, gdouble max, gdouble value)
{
- return g_strdup_printf("<label for=\"%s\">\n<span>%s:</span>\n"
- "<input type=\"number\" name=\"%s\" id=\"%s\""
- " min=\"%f\" step=\"%f\" max=\"%f\" value=\"%f\">\n"
- "</label>\n",
- name, label, name, name, min, step, max, value);
+ if (label && label[0]) {
+ return g_strdup_printf(
+ "<label for=\"%s\">\n<span>%s:</span>\n"
+ "<input type=\"number\" name=\"%s\" id=\"%s\" "
+ "min=\"%f\" step=\"%f\" max=\"%f\" "
+ "value=\"%f\">\n"
+ "</label>\n",
+ name, label, name, name, min, step, max, value);
+ } else {
+ return g_strdup_printf(
+ "<input type=\"number\" name=\"%s\" id=\"%s\" "
+ "min=\"%f\" step=\"%f\" max=\"%f\" "
+ "value=\"%f\">\n",
+ name, name, min, step, max, value);
+ }
}
gchar *