[evolution/webkit] Move common CSS styles to a .css file



commit d64e9831b00cc1d599b8741d170f5acf8a615256
Author: Dan VrÃtil <dvratil redhat com>
Date:   Mon Jul 11 17:12:03 2011 +0200

    Move common CSS styles to a .css file
    
    Move common CSS styles to a single .css file that can be included from
    any webview in Evolution and update EABContactDisplay HTML code accordingly

 addressbook/gui/widgets/Makefile.am           |    2 +-
 addressbook/gui/widgets/eab-contact-display.c |   22 +++++++++-------------
 data/Makefile.am                              |    1 +
 data/webview.css                              |   18 ++++++++++++++++++
 4 files changed, 29 insertions(+), 14 deletions(-)
---
diff --git a/addressbook/gui/widgets/Makefile.am b/addressbook/gui/widgets/Makefile.am
index 73cddb9..d304341 100644
--- a/addressbook/gui/widgets/Makefile.am
+++ b/addressbook/gui/widgets/Makefile.am
@@ -10,7 +10,7 @@ libeabwidgets_la_CPPFLAGS =				\
 	-DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\"	\
 	-DEVOLUTION_RULEDIR=\"$(ruledir)\"		\
 	-DEVOLUTION_IMAGESDIR=\"${imagesdir}\"		\
-	-DEVOLUTION_DATADIR=\"${datadir}\"		\
+	-DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"	\
 	-I$(top_srcdir)					\
 	-I$(top_srcdir)/filter				\
 	-I$(top_srcdir)/widgets				\
diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c
index 3170e8e..0e7a43e 100644
--- a/addressbook/gui/widgets/eab-contact-display.c
+++ b/addressbook/gui/widgets/eab-contact-display.c
@@ -76,7 +76,6 @@ common_location[] =
 	{ "OTHER", N_ ("Other") }
 };
 
-#define HEADER_COLOR      "#7f7f7f"
 #define IMAGE_COL_WIDTH   "20"
 #define CONTACT_LIST_ICON "stock_contact-list"
 #define AIM_ICON          "im-aim"
@@ -94,7 +93,7 @@ common_location[] =
 
 #define HTML_HEADER "<!doctype html public \"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN\">\n<html>\n"  \
                     "<head>\n<meta name=\"generator\" content=\"Evolution Addressbook Component\">\n" \
-                    "<style type=\"text/css\" rel=\"Stylesheet\" ref=\"file://" EVOLUTION_DATADIR "/evo_style.css\">" \
+                    "<link type=\"text/css\" rel=\"stylesheet\" href=\"file://" EVOLUTION_PRIVDATADIR "/theme/webview.css\">" \
                     "<style type=\"text/css\">\n" \
 		    "  div#header { width:100%; clear: both; }\n" \
 		    "  div#columns { width: 100%; clear: both; }\n" \
@@ -102,9 +101,6 @@ common_location[] =
 		    "  div.column { width: auto; float: left; margin-right: 15px; }\n" \
 		    "  img#contact-photo { float: left; }\n" \
 		    "  div#contact-name { float: left; margin-left: 20px; }\n" \
-		    "  h2 { color: " HEADER_COLOR "; }\n" \
-		    "  table th { color: " HEADER_COLOR "; text-align: left; }\n" \
-		    "  .type { color: " HEADER_COLOR "; }\n" \
 		    "</style>\n" \
 		    "<script type=\"text/javascript\">\n" \
 		    "function collapse_list (obj, listId) {\n" \
@@ -287,9 +283,9 @@ accum_address (GString *buffer,
 		gchar *html = e_text_to_html (label, E_TEXT_TO_HTML_CONVERT_NL);
 
 		if (TEXT_IS_RIGHT_TO_LEFT)
-			g_string_append_printf (buffer, "<tr><td align=\"right\" valign=\"top\" nowrap>%s</td><td valign=\"top\" width=\"100\" align=\"right\" nowrap><font color=" HEADER_COLOR ">%s:</font>%s</td><td valign=\"top\" width=\"" IMAGE_COL_WIDTH "\"></td></tr>", html, html_label, map_link->str);
+			g_string_append_printf (buffer, "<tr><td align=\"right\" valign=\"top\" nowrap>%s</td><th>%s:<br>%s</th><td valign=\"top\" width=\"" IMAGE_COL_WIDTH "\"></td></tr>", html, html_label, map_link->str);
 		else
-			g_string_append_printf (buffer, "<tr><td valign=\"top\" width=\"" IMAGE_COL_WIDTH "\"></td><td valign=\"top\" width=\"100\" nowrap><font color=" HEADER_COLOR ">%s:</font>%s</td><td valign=\"top\" nowrap>%s</td></tr>", html_label, map_link->str, html);
+			g_string_append_printf (buffer, "<tr><td width=\"" IMAGE_COL_WIDTH "\"></td><th>%s:<br>%s</th><td valign=\"top\" nowrap>%s</td></tr>", html_label, map_link->str, html);
 
 		g_free (html);
 		g_string_free (map_link, TRUE);
@@ -302,7 +298,7 @@ accum_address (GString *buffer,
 		if (TEXT_IS_RIGHT_TO_LEFT)
 			g_string_append_printf (buffer, "<tr><td align=\"right\" valign=\"top\" nowrap>");
 		else
-			g_string_append_printf (buffer, "<tr><td valign=\"top\" width=\"" IMAGE_COL_WIDTH "\"></td><td valign=\"top\" width=\"100\"><font color=" HEADER_COLOR ">%s:</font>%s</td><td valign=\"top\" nowrap>", html_label, map_link->str);
+			g_string_append_printf (buffer, "<tr><td valign=\"top\" width=\"" IMAGE_COL_WIDTH "\"></td><th>%s:<br>%s</th><td valign=\"top\" nowrap>", html_label, map_link->str);
 
 		if (adr->po && *adr->po) g_string_append_printf (buffer, "%s<br>", adr->po);
 		if (adr->ext && *adr->ext) g_string_append_printf (buffer, "%s<br>", adr->ext);
@@ -313,7 +309,7 @@ accum_address (GString *buffer,
 		if (adr->country && *adr->country) g_string_append_printf (buffer, "%s<br>", adr->country);
 
 		if (TEXT_IS_RIGHT_TO_LEFT)
-			g_string_append_printf (buffer, "</td><td valign=\"top\" width=\"100\" align=\"right\"><font color=" HEADER_COLOR ">%s:</font>%s</td><td valign=\"top\" width=\"" IMAGE_COL_WIDTH "\"></td></tr>", html_label, map_link->str);
+			g_string_append_printf (buffer, "</td><th%s:<br>%s</th><td width=\"" IMAGE_COL_WIDTH "\"></td></tr>", html_label, map_link->str);
 		else
 			g_string_append_printf (buffer, "</td></tr>");
 	}
@@ -568,7 +564,7 @@ render_contact_list (GString *buffer,
 
 	render_title_block (buffer, contact);
 
-	g_string_append_printf (buffer, "<table border=\"0\"><tr><td colspan=\"2\" valign=\"top\"><font color=" HEADER_COLOR ">%s</font></td></tr>"
+	g_string_append_printf (buffer, "<table border=\"0\"><tr><th colspan=\"2\">%s</th></tr>"
 		"<tr><td with=" IMAGE_COL_WIDTH "></td><td>", _("List Members:"));
 	g_string_append (buffer, "<table border=\"0\" cellspacing=\"1\">");
 
@@ -603,7 +599,7 @@ render_contact_column (GString *buffer, EContact *contact)
 		if (!eab_parse_qp_email (l->data, &name, &mail))
 			mail = e_text_to_html (l->data, 0);
 
-		g_string_append_printf (email, "%s%s%s<a href=\"internal-mailto:%d\";>%s</a>%s <span class=\"type\">(%s)</span>",
+		g_string_append_printf (email, "%s%s%s<a href=\"internal-mailto:%d\";>%s</a>%s <span class=\"header\">(%s)</span>",
 						nl,
 						name ? name : "",
 						name ? " &lt;" : "",
@@ -668,7 +664,7 @@ render_work_column (GString *buffer, EContact *contact)
 	if (accum->len > 0) {
 		g_string_append_printf (buffer,
 			"<div class=\"column\" id=\"contact-work\">"
-			"<h2>%s</h2>"
+			"<h3>%s</h3>"
 			"<table border=\"0\" cellspacing=\"5\">%s</table>"
 			"</div>", _("Work"), accum->str);
 	}
@@ -694,7 +690,7 @@ render_personal_column (GString *buffer, EContact *contact)
 	if (accum->len > 0) {
 		g_string_append_printf (buffer,
 			"<div class=\"column\" id=\"contact-personal\">"
-			"<h2>%s</h2>"
+			"<h3>%s</h3>"
 			"<table border=\"0\" cellspacing=\"5\">%s</table>"
 			"</div>", _("Personal"), accum->str);
 	}
diff --git a/data/Makefile.am b/data/Makefile.am
index 3b17a94..e0c3e4b 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -16,6 +16,7 @@ dist_mime_DATA = evolution.mime
 themedir = $(privdatadir)/theme
 dist_theme_DATA =	\
 	default.css	\
+	webview.css	\
 	tab-bar-background.png \
 	tab-switcher.png 	\
 	tab-switcher-hover.png	\
diff --git a/data/webview.css b/data/webview.css
new file mode 100644
index 0000000..346c28a
--- /dev/null
+++ b/data/webview.css
@@ -0,0 +1,18 @@
+body, td, th {
+  font-size: 0.8em;
+}
+
+h1, h2, h3 {
+  color: #7f7f7f;
+}
+
+th {
+  color: #7f7f7f;
+  text-align: left;
+  font-weight: normal;
+  vertical-align: top;
+}
+
+.header {
+  color: #7f7f7f;
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]