summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-01 03:26:37 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-01 03:27:53 (EDT)
commit352f786db4c46e8c63dc91e1cb5db575aafe3fbf (patch)
tree212aa2b75401e370fc15417bcbdcaab11105bfc5 /src
parent8db7bd7e8ef20a66beffe25a5bc13fe276d37902 (diff)
downloadmarquee-352f786db4c46e8c63dc91e1cb5db575aafe3fbf.zip
marquee-352f786db4c46e8c63dc91e1cb5db575aafe3fbf.tar.gz
marquee-352f786db4c46e8c63dc91e1cb5db575aafe3fbf.tar.bz2
src/html.c: Add basic page and form styles
Diffstat (limited to 'src')
-rw-r--r--src/html.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/src/html.c b/src/html.c
index 3a25580..8fa89b9 100644
--- a/src/html.c
+++ b/src/html.c
@@ -27,6 +27,42 @@
#include "html.h"
+static const gchar *styles =
+ "* {\n"
+ "margin: 6px;\n"
+ "padding: 0;\n"
+ "background: none;\n"
+ "border: 0 none;\n"
+ "}\n"
+ "body {\n"
+ "background-color: #CFCFCF;\n"
+ "font-family: sans-serif;\n"
+ "}\n"
+ "form input, form select {\n"
+ "border: 1px solid #9F9F9F;\n"
+ "border-radius: 3px;\n"
+ "background-color: #EFEFEF;\n"
+ "padding: 6px;\n"
+ "color: #000000;\n"
+ "transition: all 250ms ease-in-out 0s;\n"
+ "-moz-transition: all 250ms ease-in-out 0s;\n"
+ "-wekbit-transition: all 250ms ease-in-out 0s;\n"
+ "-o-transition: all 250ms ease-in-out 0s;\n"
+ "}\n"
+ "form input[type=submit], form input[type=reset] {\n"
+ "background-color: #DFDFDF;\n"
+ "}\n"
+ "form input:hover, form select:hover,\n"
+ "form input:focus, form select:focus {\n"
+ "border: 1px solid #4F8FCF;\n"
+ "outline: 0;\n"
+ "}\n"
+ "form input[type=submit]:hover, form input[type=reset]:hover,\n"
+ "form input[type=submit]:focus, form input[type=reset]:focus {\n"
+ "background-color: #EFEFEF;\n"
+ "}\n"
+ ;
+
gchar *
mq_html_document(const gchar *title, ...)
{
@@ -41,7 +77,9 @@ mq_html_document(const gchar *title, ...)
len += 3; /* "ltr" or "rtl" */
len += strlen("\">\n<head>\n<meta charset=\"utf-8\">\n<title>");
len += strlen(title);
- len += strlen("</title>\n</head>\n<body>\n");
+ len += strlen("</title>\n<style>\n");
+ len += strlen(styles);
+ len += strlen("</style>\n</head>\n<body>\n");
va_start(ap, title);
while ((child = va_arg(ap, gchar *))) {
len += strlen(child);
@@ -57,7 +95,9 @@ mq_html_document(const gchar *title, ...)
GTK_TEXT_DIR_RTL ? "rtl" : "ltr");
ptr = g_stpcpy(ptr, "\">\n<head>\n<meta charset=\"utf-8\">\n<title>");
ptr = g_stpcpy(ptr, title);
- ptr = g_stpcpy(ptr, "</title>\n</head>\n<body>\n");
+ ptr = g_stpcpy(ptr, "</title>\n<style>\n");
+ ptr = g_stpcpy(ptr, styles);
+ ptr = g_stpcpy(ptr, "</style>\n</head>\n<body>\n");
va_start(ap, title);
while ((child = va_arg(ap, gchar *))) {
ptr = g_stpcpy(ptr, child);