Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/0e6ba162b22ca64b323ed9071c64a3e31b93c0f6
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/0e6ba162b22ca64b323ed9071c64a3e31b93c0f6
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/0e6ba162b22ca64b323ed9071c64a3e31b93c0f6

The branch, master has been updated
       via  0e6ba162b22ca64b323ed9071c64a3e31b93c0f6 (commit)
      from  14286b381b12034140768800c7ba10baa7c3b334 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=0e6ba162b22ca64b323ed9071c64a3e31b93c0f6
commit 0e6ba162b22ca64b323ed9071c64a3e31b93c0f6
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Internal content: Restyle certificate viewer page.

diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index c140fde..aa68fd2 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -31,6 +31,8 @@
 #include <stdio.h>
 #include <stdarg.h>
 
+#include "netsurf/plot_style.h"
+
 #include "utils/log.h"
 #include "testament.h"
 #include "utils/corestrings.h"
@@ -44,6 +46,8 @@
 #include "content/fetchers/about.h"
 #include "image/image_cache.h"
 
+#include "desktop/system_colour.h"
+
 struct fetch_about_context;
 
 typedef bool (*fetch_about_handler)(struct fetch_about_context *);
@@ -577,6 +581,28 @@ static bool fetch_about_certificate_handler(struct 
fetch_about_context *ctx)
        nserror res;
        struct cert_chain *chain = NULL;
 
+       colour bg;
+       colour fg;
+       colour border;
+       colour outside;
+
+       res = ns_system_colour_char("Window", &bg);
+       if (res != NSERROR_OK) {
+               return false;
+       }
+
+       res = ns_system_colour_char("WindowText", &fg);
+       if (res != NSERROR_OK) {
+               return false;
+       }
+
+       outside = mix_colour(fg, bg, 0x0c);
+       border = mix_colour(fg, bg, 0x40);
+
+       bg = colour_rb_swap(bg);
+       fg = colour_rb_swap(fg);
+       border = colour_rb_swap(border);
+       outside = colour_rb_swap(outside);
 
        /* content is going to return ok */
        fetch_set_http_code(ctx->fetchh, code);
@@ -587,17 +613,27 @@ static bool fetch_about_certificate_handler(struct 
fetch_about_context *ctx)
 
        /* page head */
        res = ssenddataf(ctx,
-                        "<html>\n<head>\n"
+                       "<html>\n<head>\n"
                        "<title>NetSurf Browser Certificate Viewer</title>\n"
                        "<link rel=\"stylesheet\" type=\"text/css\" "
-                       "href=\"resource:internal.css\">\n"
+                                       "href=\"resource:internal.css\">\n"
+                       "<style>\n"
+                       "html {\n"
+                       "\tbackground-color: #%06x;\n"
+                       "}\n"
+                       "body {\n"
+                       "\tcolor: #%06x;\n"
+                       "\tbackground-color: #%06x;\n"
+                       "\tborder-color: #%06x;\n"
+                       "}\n"
+                       "h2 {\n"
+                       "\tborder-color: #%06x;\n"
+                       "}\n"
+                       "</style>\n"
                        "</head>\n"
                        "<body id =\"certificate\">\n"
-                       "<p class=\"banner\">"
-                       "<a href=\"http://www.netsurf-browser.org/\";>"
-                       "<img src=\"resource:netsurf.png\" alt=\"NetSurf\"></a>"
-                       "</p>\n"
-                       "<h1>NetSurf Browser Certificate Viewer</h1>\n");
+                       "<h1>Certificate</h1>\n",
+                       outside, fg, bg, border, border);
        if (res != NSERROR_OK) {
                goto fetch_about_certificate_handler_aborted;
        }
diff --git a/resources/internal.css b/resources/internal.css
index f98f0cc..8dcc7cf 100644
--- a/resources/internal.css
+++ b/resources/internal.css
@@ -40,7 +40,8 @@ h1 {
 h2 {
        font-size: 160%;
        padding-top: 5mm;
-       border-top: 1px solid black; }
+       border-top-width: 1px;
+       border-top-style: solid; }
 
 h3 {
        font-size: 140%;


-----------------------------------------------------------------------

Summary of changes:
 content/fetchers/about.c |   50 +++++++++++++++++++++++++++++++++++++++-------
 resources/internal.css   |    3 ++-
 2 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index c140fde..aa68fd2 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -31,6 +31,8 @@
 #include <stdio.h>
 #include <stdarg.h>
 
+#include "netsurf/plot_style.h"
+
 #include "utils/log.h"
 #include "testament.h"
 #include "utils/corestrings.h"
@@ -44,6 +46,8 @@
 #include "content/fetchers/about.h"
 #include "image/image_cache.h"
 
+#include "desktop/system_colour.h"
+
 struct fetch_about_context;
 
 typedef bool (*fetch_about_handler)(struct fetch_about_context *);
@@ -577,6 +581,28 @@ static bool fetch_about_certificate_handler(struct 
fetch_about_context *ctx)
        nserror res;
        struct cert_chain *chain = NULL;
 
+       colour bg;
+       colour fg;
+       colour border;
+       colour outside;
+
+       res = ns_system_colour_char("Window", &bg);
+       if (res != NSERROR_OK) {
+               return false;
+       }
+
+       res = ns_system_colour_char("WindowText", &fg);
+       if (res != NSERROR_OK) {
+               return false;
+       }
+
+       outside = mix_colour(fg, bg, 0x0c);
+       border = mix_colour(fg, bg, 0x40);
+
+       bg = colour_rb_swap(bg);
+       fg = colour_rb_swap(fg);
+       border = colour_rb_swap(border);
+       outside = colour_rb_swap(outside);
 
        /* content is going to return ok */
        fetch_set_http_code(ctx->fetchh, code);
@@ -587,17 +613,27 @@ static bool fetch_about_certificate_handler(struct 
fetch_about_context *ctx)
 
        /* page head */
        res = ssenddataf(ctx,
-                        "<html>\n<head>\n"
+                       "<html>\n<head>\n"
                        "<title>NetSurf Browser Certificate Viewer</title>\n"
                        "<link rel=\"stylesheet\" type=\"text/css\" "
-                       "href=\"resource:internal.css\">\n"
+                                       "href=\"resource:internal.css\">\n"
+                       "<style>\n"
+                       "html {\n"
+                       "\tbackground-color: #%06x;\n"
+                       "}\n"
+                       "body {\n"
+                       "\tcolor: #%06x;\n"
+                       "\tbackground-color: #%06x;\n"
+                       "\tborder-color: #%06x;\n"
+                       "}\n"
+                       "h2 {\n"
+                       "\tborder-color: #%06x;\n"
+                       "}\n"
+                       "</style>\n"
                        "</head>\n"
                        "<body id =\"certificate\">\n"
-                       "<p class=\"banner\">"
-                       "<a href=\"http://www.netsurf-browser.org/\";>"
-                       "<img src=\"resource:netsurf.png\" alt=\"NetSurf\"></a>"
-                       "</p>\n"
-                       "<h1>NetSurf Browser Certificate Viewer</h1>\n");
+                       "<h1>Certificate</h1>\n",
+                       outside, fg, bg, border, border);
        if (res != NSERROR_OK) {
                goto fetch_about_certificate_handler_aborted;
        }
diff --git a/resources/internal.css b/resources/internal.css
index f98f0cc..8dcc7cf 100644
--- a/resources/internal.css
+++ b/resources/internal.css
@@ -40,7 +40,8 @@ h1 {
 h2 {
        font-size: 160%;
        padding-top: 5mm;
-       border-top: 1px solid black; }
+       border-top-width: 1px;
+       border-top-style: solid; }
 
 h3 {
        font-size: 140%;


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to