diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-04 13:09:39 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-04 13:10:19 (EDT) |
commit | 5b4c3c356b93347d3fac1f07d31fa4e44db3757c (patch) | |
tree | 0ca758386d2a8c2d8488a32351d0b599cdbc6ccc /src/utils | |
parent | 95f6d7b2b8f7530acd4da8c1ca30a57974763c6e (diff) | |
download | marquee-5b4c3c356b93347d3fac1f07d31fa4e44db3757c.zip marquee-5b4c3c356b93347d3fac1f07d31fa4e44db3757c.tar.gz marquee-5b4c3c356b93347d3fac1f07d31fa4e44db3757c.tar.bz2 |
mq_html_input_number_i(): Allow label to be disabled
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/html.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/utils/html.c b/src/utils/html.c index 68af9a6..3b5be2c 100644 --- a/src/utils/html.c +++ b/src/utils/html.c @@ -643,11 +643,21 @@ gchar * mq_html_input_number_i(const gchar *name, const gchar *label, gint min, gint step, gint max, gint value) { - return g_strdup_printf("<label for=\"%s\">\n<span>%s:</span>\n" - "<input type=\"number\" name=\"%s\" id=\"%s\"" - " min=\"%d\" step=\"%d\" max=\"%d\" value=\"%d\">\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=\"%d\" step=\"%d\" max=\"%d\" " + "value=\"%d\">\n" + "</label>\n", + name, label, name, name, min, step, max, value); + } else { + return g_strdup_printf( + "<input type=\"number\" name=\"%s\" id=\"%s\" " + "min=\"%d\" step=\"%d\" max=\"%d\" " + "value=\"%d\">\n", + name, name, min, step, max, value); + } } gchar * |