summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-01 04:35:57 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-01 04:35:57 (EDT)
commit03a38e0049e76e3eae5ba6b0c7067f97311db8e6 (patch)
tree2d5f93f49893ac490c8b073d26daf2bd2f7ce9c9 /src
parent3398b59af2be618b3c70fa034df4b8deb53f773b (diff)
downloadmarquee-03a38e0049e76e3eae5ba6b0c7067f97311db8e6.zip
marquee-03a38e0049e76e3eae5ba6b0c7067f97311db8e6.tar.gz
marquee-03a38e0049e76e3eae5ba6b0c7067f97311db8e6.tar.bz2
src/html.c: Float submit and reset buttons to the right
Diffstat (limited to 'src')
-rw-r--r--src/html.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/html.c b/src/html.c
index 853c2e5..afcae07 100644
--- a/src/html.c
+++ b/src/html.c
@@ -98,6 +98,10 @@ static const gchar *styles =
"-wekbit-transition: all 250ms ease-in-out 0s;\n"
"-o-transition: all 250ms ease-in-out 0s;\n"
"}\n"
+ "div.dialog-buttonbox {\n"
+ "margin: 0;\n"
+ "float: right;\n"
+ "}\n"
"form input[type=submit], form input[type=reset] {\n"
"background-color: #DFDFDF;\n"
"}\n"
@@ -361,9 +365,11 @@ mq_html_form(const gchar *submit_label, const gchar *reset_label, ...)
len += strlen(child);
}
va_end(ap);
- len += strlen("<input type=\"reset\" value=\"") + strlen(reset_label) +
+ len += strlen("<div class=\"dialog-buttonbox\">\n") +
+ strlen("<input type=\"reset\" value=\"") + strlen(reset_label) +
strlen("\">\n<input type=\"submit\" value=\"") +
- strlen(submit_label) + strlen("\">\n</form>\n");
+ strlen(submit_label) + strlen("\">\n</div>\n") +
+ strlen("</form>\n");
++len; /* NUL byte */
/* Build string. */
@@ -375,11 +381,13 @@ mq_html_form(const gchar *submit_label, const gchar *reset_label, ...)
g_free(child);
}
va_end(ap);
+ ptr = g_stpcpy(ptr, "<div class=\"dialog-buttonbox\">\n");
ptr = g_stpcpy(ptr, "<input type=\"reset\" value=\"");
ptr = g_stpcpy(ptr, reset_label);
ptr = g_stpcpy(ptr, "\">\n<input type=\"submit\" value=\"");
ptr = g_stpcpy(ptr, submit_label);
- ptr = g_stpcpy(ptr, "\">\n</form>\n"); /* g_stpcpy() adds the NUL. */
+ ptr = g_stpcpy(ptr, "\">\n</div>\n");
+ ptr = g_stpcpy(ptr, "</form>\n"); /* g_stpcpy() adds the NUL. */
return form;
}