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



commit 56c56f5bd396796e3f46a3486028719a36dad238
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 e78d5b6..60f6992 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 8dcfbc3..ec2d73b 100644
--- a/addressbook/gui/widgets/eab-contact-display.c
+++ b/addressbook/gui/widgets/eab-contact-display.c
@@ -72,7 +72,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"
@@ -90,7 +89,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" \
@@ -98,9 +97,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" \
@@ -285,9 +281,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);
@@ -300,7 +296,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);
@@ -311,7 +307,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>");
 	}
@@ -569,7 +565,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\">");
 
@@ -604,7 +600,7 @@ render_contact_column (GString *buffer,
 		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;" : "",
@@ -670,7 +666,7 @@ render_work_column (GString *buffer,
 	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);
 	}
@@ -697,7 +693,7 @@ render_personal_column (GString *buffer,
 	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 aa02b00..83e7bf2 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -42,6 +42,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]